@InterfaceAudience.Public @InterfaceStability.Evolving public final class CheckAndMutate extends Object implements Row
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);
Modifier and Type | Class and Description |
---|---|
static class |
CheckAndMutate.Builder
A builder class for building a CheckAndMutate object.
|
COMPARATOR
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Row row)
Compare this row to another row.
|
boolean |
equals(Object obj) |
Row |
getAction()
Returns the action done if check succeeds
|
CompareOperator |
getCompareOp()
Returns the comparison operator
|
byte[] |
getFamily()
Returns the family to check
|
Filter |
getFilter()
Returns the filter to check
|
byte[] |
getQualifier()
Returns the qualifier to check
|
byte[] |
getRow()
Returns the row
|
TimeRange |
getTimeRange()
Returns the time range to check
|
byte[] |
getValue()
Returns the expected value
|
boolean |
hasFilter()
Returns whether this has a filter or not
|
int |
hashCode() |
static CheckAndMutate.Builder |
newBuilder(byte[] row)
returns a builder object to build a CheckAndMutate object
|
public static CheckAndMutate.Builder newBuilder(byte[] row)
row
- rowpublic int compareTo(Row row)
Row
compareTo
in interface Comparable<Row>
compareTo
in interface Row
public byte[] getFamily()
public byte[] getQualifier()
public CompareOperator getCompareOp()
public byte[] getValue()
public boolean hasFilter()
public TimeRange getTimeRange()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.