public static class CheckAndMutateUtil.RequestBuilder extends Object
ConditionalRowMutations.| Constructor and Description |
|---|
RequestBuilder(HBaseRequestAdapter hbaseAdapter,
byte[] row,
byte[] family)
RequestBuilder.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation |
build() |
CheckAndMutateUtil.RequestBuilder |
ifMatches(org.apache.hadoop.hbase.filter.CompareFilter.CompareOp compareOp,
byte[] value)
For non-null values, this produces a
RowFilter equivalent to:
new ValueFilter(reverseCompareOp(compareOp), new BinaryComparator(value)
Null values are bit tricky. |
CheckAndMutateUtil.RequestBuilder |
ifNotExists() |
CheckAndMutateUtil.RequestBuilder |
qualifier(byte[] qualifier) |
CheckAndMutateUtil.RequestBuilder |
timeRange(long start,
long end) |
CheckAndMutateUtil.RequestBuilder |
withDelete(org.apache.hadoop.hbase.client.Delete delete) |
CheckAndMutateUtil.RequestBuilder |
withMutations(org.apache.hadoop.hbase.client.RowMutations rm) |
CheckAndMutateUtil.RequestBuilder |
withPut(org.apache.hadoop.hbase.client.Put put) |
public RequestBuilder(HBaseRequestAdapter hbaseAdapter, byte[] row, byte[] family)
hbaseAdapter - a HBaseRequestAdapter used to convert HBase Mutation to Cloud Bigtable Mutationrow - the RowKey in which to to check value matchingfamily - the family in which to check value matching.public CheckAndMutateUtil.RequestBuilder qualifier(byte[] qualifier)
public CheckAndMutateUtil.RequestBuilder ifNotExists()
public CheckAndMutateUtil.RequestBuilder ifMatches(org.apache.hadoop.hbase.filter.CompareFilter.CompareOp compareOp, @Nullable byte[] value)
RowFilter equivalent to:
new ValueFilter(reverseCompareOp(compareOp), new BinaryComparator(value)
Null values are bit tricky. In HBase 1.* style check and mutate, value == null always means `check non-existence` regardless of compareOp. That's semantically confusing for CompareOperators other than EQUALS. It's even more confusing if value == null and compareOp = NOT_EQUALS.
HBase 2.* APIs introduced an explicit method of checking for "Non-Existence" as an
independent concept from compareOp, which is the inspiration for the ifNotExists()
method.
Checking for existence in HBase can be expressed as follows:
compareOp = CompareOp.GREATER_OR_EQUAL, value = new byte[]{Byte.MIN_VALUE})
Bigtable decided that value == null with a compareOp of NOT_EQUALS actually means check for existence, even though HBase will still treat it as non-existence.
compareOp - a CompareFilter.CompareOpvalue - a byte array.CheckAndMutateUtil.RequestBuilder object with compareOp and byte array value.public CheckAndMutateUtil.RequestBuilder timeRange(long start, long end)
public CheckAndMutateUtil.RequestBuilder withPut(org.apache.hadoop.hbase.client.Put put) throws org.apache.hadoop.hbase.DoNotRetryIOException
org.apache.hadoop.hbase.DoNotRetryIOExceptionpublic CheckAndMutateUtil.RequestBuilder withDelete(org.apache.hadoop.hbase.client.Delete delete) throws org.apache.hadoop.hbase.DoNotRetryIOException
org.apache.hadoop.hbase.DoNotRetryIOExceptionpublic CheckAndMutateUtil.RequestBuilder withMutations(org.apache.hadoop.hbase.client.RowMutations rm) throws org.apache.hadoop.hbase.DoNotRetryIOException
org.apache.hadoop.hbase.DoNotRetryIOExceptionpublic com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation build()