Package org.apache.hadoop.hbase.client
Class CheckAndMutate
java.lang.Object
org.apache.hadoop.hbase.client.CheckAndMutate
- All Implemented Interfaces:
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
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder class for building a CheckAndMutate object. -
Field Summary
Fields inherited from interface org.apache.hadoop.hbase.client.Row
COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hbase.client.RowReturns the action done if check succeedsorg.apache.hadoop.hbase.CompareOperatorReturns the comparison operatorbyte[]Returns the family to checkorg.apache.hadoop.hbase.filter.FilterReturns the filter to checkbyte[]Returns the qualifier to checkbyte[]getRow()Returns the roworg.apache.hadoop.hbase.io.TimeRangeReturns the time range to checkbyte[]getValue()Returns the expected valuebooleanReturns whether this has a filter or notbooleanReturns whether query metrics are enabledstatic CheckAndMutate.BuildernewBuilder(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:
getRowin interfaceorg.apache.hadoop.hbase.client.Row
-
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 -
isQueryMetricsEnabled
Returns whether query metrics are enabled
-