Package org.apache.hadoop.hbase.client
Class CheckAndMutate
java.lang.Object
org.apache.hadoop.hbase.client.CheckAndMutate
- All Implemented Interfaces:
Comparable<Row>
,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
Modifier and TypeFieldDescriptionprivate final Row
private final byte[]
private final Filter
private final CompareOperator
private final byte[]
private final byte[]
private final TimeRange
private final byte[]
Fields inherited from interface org.apache.hadoop.hbase.client.Row
COMPARATOR
-
Constructor Summary
ModifierConstructorDescriptionprivate
CheckAndMutate
(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, byte[] value, TimeRange timeRange, Row action) private
CheckAndMutate
(byte[] row, Filter filter, TimeRange timeRange, Row action) -
Method Summary
Modifier and TypeMethodDescriptionint
Compare this row to another row.boolean
Returns the action done if check succeedsReturns the comparison operatorbyte[]
Returns the family to checkReturns the filter to checkbyte[]
Returns the qualifier to checkbyte[]
getRow()
Returns the rowReturns 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
-
Field Details
-
row
-
family
-
qualifier
-
op
-
value
-
filter
-
timeRange
-
action
-
-
Constructor Details
-
CheckAndMutate
private CheckAndMutate(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, byte[] value, TimeRange timeRange, Row action) -
CheckAndMutate
-
-
Method Details
-
newBuilder
returns a builder object to build a CheckAndMutate object- Parameters:
row
- row- Returns:
- a builder object
-
getRow
Returns the row -
compareTo
Description copied from interface:Row
Compare this row to another row.- Specified by:
compareTo
in interfaceComparable<Row>
- Specified by:
compareTo
in interfaceRow
-
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
-