HBASE-19912 Remove useless 'writeToWAL' flag of Region#checkAndRowMutate

Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
kewang 2018-02-01 18:22:05 +08:00 committed by Michael Stack
parent 4cdc13b86e
commit 86ca65218d
4 changed files with 7 additions and 10 deletions

View File

@ -3919,16 +3919,14 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
throws IOException{ throws IOException{
checkMutationType(mutation, row); checkMutationType(mutation, row);
return doCheckAndRowMutate(row, family, qualifier, op, comparator, null, return doCheckAndRowMutate(row, family, qualifier, op, comparator, null,
mutation, writeToWAL); mutation);
} }
@Override @Override
public boolean checkAndRowMutate(byte [] row, byte [] family, byte [] qualifier, public boolean checkAndRowMutate(byte [] row, byte [] family, byte [] qualifier,
CompareOperator op, ByteArrayComparable comparator, RowMutations rm, CompareOperator op, ByteArrayComparable comparator, RowMutations rm)
boolean writeToWAL)
throws IOException { throws IOException {
return doCheckAndRowMutate(row, family, qualifier, op, comparator, rm, null, return doCheckAndRowMutate(row, family, qualifier, op, comparator, rm, null);
writeToWAL);
} }
/** /**
@ -3937,7 +3935,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
*/ */
private boolean doCheckAndRowMutate(byte [] row, byte [] family, byte [] qualifier, private boolean doCheckAndRowMutate(byte [] row, byte [] family, byte [] qualifier,
CompareOperator op, ByteArrayComparable comparator, RowMutations rowMutations, CompareOperator op, ByteArrayComparable comparator, RowMutations rowMutations,
Mutation mutation, boolean writeToWAL) Mutation mutation)
throws IOException { throws IOException {
// Could do the below checks but seems wacky with two callers only. Just comment out for now. // Could do the below checks but seems wacky with two callers only. Just comment out for now.
// One caller passes a Mutation, the other passes RowMutation. Presume all good so we don't // One caller passes a Mutation, the other passes RowMutation. Presume all good so we don't

View File

@ -618,7 +618,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
resultOrExceptionOrBuilder.build()); resultOrExceptionOrBuilder.build());
} }
return region.checkAndRowMutate(row, family, qualifier, op, return region.checkAndRowMutate(row, family, qualifier, op,
comparator, rm, Boolean.TRUE); comparator, rm);
} }
/** /**

View File

@ -309,12 +309,11 @@ public interface Region extends ConfigurationObserver {
* @param op the comparison operator * @param op the comparison operator
* @param comparator * @param comparator
* @param mutations * @param mutations
* @param writeToWAL
* @return true if mutations were applied, false otherwise * @return true if mutations were applied, false otherwise
* @throws IOException * @throws IOException
*/ */
boolean checkAndRowMutate(byte [] row, byte [] family, byte [] qualifier, CompareOperator op, boolean checkAndRowMutate(byte [] row, byte [] family, byte [] qualifier, CompareOperator op,
ByteArrayComparable comparator, RowMutations mutations, boolean writeToWAL) ByteArrayComparable comparator, RowMutations mutations)
throws IOException; throws IOException;
/** /**

View File

@ -6387,7 +6387,7 @@ public class TestHRegion {
RowMutations rm = new RowMutations(row); RowMutations rm = new RowMutations(row);
rm.add(p); rm.add(p);
assertTrue(region.checkAndRowMutate(row, fam1, qual1, CompareOperator.EQUAL, assertTrue(region.checkAndRowMutate(row, fam1, qual1, CompareOperator.EQUAL,
new BinaryComparator(qual1), rm, false)); new BinaryComparator(qual1), rm));
result = region.get(new Get(row)); result = region.get(new Get(row));
c = result.getColumnLatestCell(fam1, qual1); c = result.getColumnLatestCell(fam1, qual1);
assertEquals(10L, c.getTimestamp()); assertEquals(10L, c.getTimestamp());