HBASE-25339 Method parameter and member variable are duplicated in checkSplittable() of SplitTableRegionProcedure

Closes #2717

Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
GeorryHuang 2020-11-30 17:55:49 +05:30 committed by Viraj Jasani
parent fc62214e77
commit c76145c505
No known key found for this signature in database
GPG Key ID: B3D6C0B41C8ADFD5
1 changed files with 4 additions and 5 deletions

View File

@ -110,7 +110,7 @@ public class SplitTableRegionProcedure
// we fail-fast on construction. There it skips the split with just a warning.
checkOnline(env, regionToSplit);
this.bestSplitRow = splitRow;
checkSplittable(env, regionToSplit, bestSplitRow);
checkSplittable(env, regionToSplit);
final TableName table = regionToSplit.getTable();
final long rid = getDaughterRegionIdTimestamp(regionToSplit);
this.daughterOneRI = RegionInfoBuilder.newBuilder(table)
@ -173,10 +173,9 @@ public class SplitTableRegionProcedure
* Check whether the region is splittable
* @param env MasterProcedureEnv
* @param regionToSplit parent Region to be split
* @param splitRow if splitRow is not specified, will first try to get bestSplitRow from RS
*/
private void checkSplittable(final MasterProcedureEnv env,
final RegionInfo regionToSplit, final byte[] splitRow) throws IOException {
final RegionInfo regionToSplit) throws IOException {
// Ask the remote RS if this region is splittable.
// If we get an IOE, report it along w/ the failure so can see why we are not splittable at
// this time.
@ -227,12 +226,12 @@ public class SplitTableRegionProcedure
if (Bytes.equals(regionToSplit.getStartKey(), bestSplitRow)) {
throw new DoNotRetryIOException(
"Split row is equal to startkey: " + Bytes.toStringBinary(splitRow));
"Split row is equal to startkey: " + Bytes.toStringBinary(bestSplitRow));
}
if (!regionToSplit.containsRow(bestSplitRow)) {
throw new DoNotRetryIOException("Split row is not inside region key range splitKey:" +
Bytes.toStringBinary(splitRow) + " region: " + regionToSplit);
Bytes.toStringBinary(bestSplitRow) + " region: " + regionToSplit);
}
}