HBASE-9899 for idempotent operation dups, return the result instead of throwing conflict exception (Guanghao Zhang): ADDENDUM

This commit is contained in:
stack 2016-08-09 07:09:44 -07:00
parent 5cadcd59aa
commit 46defe8e31
1 changed files with 6 additions and 4 deletions

View File

@ -620,12 +620,13 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
boolean canProceed = startNonceOperation(mutation, nonceGroup);
boolean success = false;
try {
long nonce = mutation.hasNonce() ? mutation.getNonce() : HConstants.NO_NONCE;
if (canProceed) {
r = region.append(append, nonceGroup, mutation.getNonce());
r = region.append(append, nonceGroup, nonce);
} else {
// convert duplicate append to get
List<Cell> results = region.get(ProtobufUtil.toGet(mutation, cellScanner), false,
nonceGroup, mutation.getNonce());
nonceGroup, nonce);
r = Result.create(results);
}
success = true;
@ -667,12 +668,13 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
boolean canProceed = startNonceOperation(mutation, nonceGroup);
boolean success = false;
try {
long nonce = mutation.hasNonce() ? mutation.getNonce() : HConstants.NO_NONCE;
if (canProceed) {
r = region.increment(increment, nonceGroup, mutation.getNonce());
r = region.increment(increment, nonceGroup, nonce);
} else {
// convert duplicate increment to get
List<Cell> results = region.get(ProtobufUtil.toGet(mutation, cells), false, nonceGroup,
mutation.getNonce());
nonce);
r = Result.create(results);
}
success = true;