Package org.apache.hadoop.hbase.client
Class CheckAndMutate
java.lang.Object
org.apache.hadoop.hbase.client.CheckAndMutate
- All Implemented Interfaces:
Comparable<org.apache.hadoop.hbase.client.Row>
,org.apache.hadoop.hbase.client.Row
@Public
@Evolving
public final class CheckAndMutate
extends Object
implements org.apache.hadoop.hbase.client.Row
Used to perform CheckAndMutate operations.
Use the builder class to instantiate a CheckAndMutate object. This builder class is fluent style APIs, the code are like:
// A CheckAndMutate operation where do the specified action if the column (specified by the
// family and the qualifier) of the row equals to the specified value
CheckAndMutate checkAndMutate = CheckAndMutate.newBuilder(row)
.ifEquals(family, qualifier, value)
.build(put);
// A CheckAndMutate operation where do the specified action if the column (specified by the
// family and the qualifier) of the row doesn't exist
CheckAndMutate checkAndMutate = CheckAndMutate.newBuilder(row)
.ifNotExists(family, qualifier)
.build(put);
// A CheckAndMutate operation where do the specified action if the row matches the filter
CheckAndMutate checkAndMutate = CheckAndMutate.newBuilder(row)
.ifMatches(filter)
.build(delete);
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A builder class for building a CheckAndMutate object. -
Field Summary
Fields inherited from interface org.apache.hadoop.hbase.client.Row
COMPARATOR
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(org.apache.hadoop.hbase.client.Row row) Compare this row to another row.boolean
org.apache.hadoop.hbase.client.Row
Returns the action done if check succeedsorg.apache.hadoop.hbase.CompareOperator
Returns the comparison operatorbyte[]
Returns the family to checkorg.apache.hadoop.hbase.filter.Filter
Returns the filter to checkbyte[]
Returns the qualifier to checkbyte[]
getRow()
Returns the roworg.apache.hadoop.hbase.io.TimeRange
Returns the time range to checkbyte[]
getValue()
Returns the expected valueboolean
Returns whether this has a filter or notint
hashCode()
static CheckAndMutate.Builder
newBuilder
(byte[] row) returns a builder object to build a CheckAndMutate object
-
Method Details
-
newBuilder
returns a builder object to build a CheckAndMutate object- Parameters:
row
- row- Returns:
- a builder object
-
getRow
Returns the row- Specified by:
getRow
in interfaceorg.apache.hadoop.hbase.client.Row
-
compareTo
Description copied from interface:org.apache.hadoop.hbase.client.Row
Compare this row to another row.- Specified by:
compareTo
in interfaceComparable<org.apache.hadoop.hbase.client.Row>
- Specified by:
compareTo
in interfaceorg.apache.hadoop.hbase.client.Row
-
equals
-
hashCode
-
getFamily
Returns the family to check -
getQualifier
Returns the qualifier to check -
getCompareOp
Returns the comparison operator -
getValue
Returns the expected value -
getFilter
Returns the filter to check -
hasFilter
Returns whether this has a filter or not -
getTimeRange
Returns the time range to check -
getAction
Returns the action done if check succeeds
-