@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.
|
Modifier and Type | Field and Description |
---|---|
private Row |
action |
private byte[] |
family |
private Filter |
filter |
private CompareOperator |
op |
private byte[] |
qualifier |
private byte[] |
row |
private TimeRange |
timeRange |
private byte[] |
value |
COMPARATOR
Modifier | Constructor and Description |
---|---|
private |
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) |
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
|
private final byte[] row
private final byte[] family
private final byte[] qualifier
private final CompareOperator op
private final byte[] value
private 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)
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.