brfrn169 commented on a change in pull request #2094:
URL: https://github.com/apache/hbase/pull/2094#discussion_r463466849
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##########
@@ -4272,43 +4275,96 @@ protected Durability getEffectiveDurability(Durability
d) {
}
@Override
+ @Deprecated
public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator, TimeRange timeRange, Mutation mutation)
throws IOException {
- return doCheckAndRowMutate(row, family, qualifier, op, comparator, null,
timeRange, null,
- mutation);
+ CheckAndMutate.Builder builder = CheckAndMutate.newBuilder(row)
+ .ifMatches(family, qualifier, op,
comparator.getValue()).timeRange(timeRange);
+ try {
+ if (mutation instanceof Put) {
+ return checkAndMutate(builder.build((Put) mutation)).isSuccess();
+ } else if (mutation instanceof Delete) {
+ return checkAndMutate(builder.build((Delete) mutation)).isSuccess();
+ } else {
+ throw new DoNotRetryIOException(
+ "Unsupported mutate type: " +
mutation.getClass().getSimpleName().toUpperCase());
+ }
+ } catch (IllegalArgumentException e) {
Review comment:
Sure, thanks. Will do that as your review.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]