HBASE-14552 (addendum) Procedure V2: Reimplement DispatchMergingRegionHandler (add nonce support) (Stephen Yuan Jiang)
This commit is contained in:
parent
9454daf25b
commit
638ca24f01
|
@ -1614,7 +1614,7 @@ public class HBaseAdmin implements Admin {
|
|||
}
|
||||
|
||||
DispatchMergingRegionsResponse response =
|
||||
executeCallable(new MasterCallable<DispatchMergingRegionsResponse>(getConnection()) {
|
||||
executeCallable(new MasterCallable<DispatchMergingRegionsResponse>(getConnection()) {
|
||||
@Override
|
||||
public DispatchMergingRegionsResponse call(int callTimeout) throws ServiceException {
|
||||
PayloadCarryingRpcController controller = rpcControllerFactory.newController();
|
||||
|
@ -1622,8 +1622,12 @@ public class HBaseAdmin implements Admin {
|
|||
|
||||
try {
|
||||
DispatchMergingRegionsRequest request = RequestConverter
|
||||
.buildDispatchMergingRegionsRequest(encodedNameOfRegionA,
|
||||
encodedNameOfRegionB, forcible);
|
||||
.buildDispatchMergingRegionsRequest(
|
||||
encodedNameOfRegionA,
|
||||
encodedNameOfRegionB,
|
||||
forcible,
|
||||
ng.getNonceGroup(),
|
||||
ng.newNonce());
|
||||
return master.dispatchMergingRegions(controller, request);
|
||||
} catch (DeserializationException de) {
|
||||
LOG.error("Could not parse destination server name: " + de);
|
||||
|
|
|
@ -1103,14 +1103,19 @@ public final class RequestConverter {
|
|||
}
|
||||
|
||||
public static DispatchMergingRegionsRequest buildDispatchMergingRegionsRequest(
|
||||
final byte[] encodedNameOfRegionA, final byte[] encodedNameOfRegionB,
|
||||
final boolean forcible) throws DeserializationException {
|
||||
final byte[] encodedNameOfRegionA,
|
||||
final byte[] encodedNameOfRegionB,
|
||||
final boolean forcible,
|
||||
final long nonceGroup,
|
||||
final long nonce) throws DeserializationException {
|
||||
DispatchMergingRegionsRequest.Builder builder = DispatchMergingRegionsRequest.newBuilder();
|
||||
builder.setRegionA(buildRegionSpecifier(
|
||||
RegionSpecifierType.ENCODED_REGION_NAME, encodedNameOfRegionA));
|
||||
builder.setRegionB(buildRegionSpecifier(
|
||||
RegionSpecifierType.ENCODED_REGION_NAME, encodedNameOfRegionB));
|
||||
builder.setForcible(forcible);
|
||||
builder.setNonceGroup(nonceGroup);
|
||||
builder.setNonce(nonce);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -1189,8 +1189,12 @@ public class TestAdmin1 {
|
|||
// Try going to the master directly (that will skip the check in admin)
|
||||
try {
|
||||
DispatchMergingRegionsRequest request = RequestConverter
|
||||
.buildDispatchMergingRegionsRequest(regions.get(1).getFirst().getEncodedNameAsBytes(),
|
||||
regions.get(2).getFirst().getEncodedNameAsBytes(), true);
|
||||
.buildDispatchMergingRegionsRequest(
|
||||
regions.get(1).getFirst().getEncodedNameAsBytes(),
|
||||
regions.get(2).getFirst().getEncodedNameAsBytes(),
|
||||
true,
|
||||
HConstants.NO_NONCE,
|
||||
HConstants.NO_NONCE);
|
||||
((ClusterConnection) TEST_UTIL.getAdmin().getConnection()).getMaster()
|
||||
.dispatchMergingRegions(null, request);
|
||||
} catch (ServiceException m) {
|
||||
|
|
Loading…
Reference in New Issue