Repository: hbase Updated Branches: refs/heads/master 9454daf25 -> 638ca24f0
HBASE-14552 (addendum) Procedure V2: Reimplement DispatchMergingRegionHandler (add nonce support) (Stephen Yuan Jiang) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/638ca24f Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/638ca24f Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/638ca24f Branch: refs/heads/master Commit: 638ca24f01f58a02b39d92e786b7d81de5a2f3b5 Parents: 9454daf Author: Stephen Yuan Jiang <syuanjiang...@gmail.com> Authored: Tue Jul 19 08:49:23 2016 -0700 Committer: Stephen Yuan Jiang <syuanjiang...@gmail.com> Committed: Tue Jul 19 08:49:23 2016 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hbase/client/HBaseAdmin.java | 10 +++++++--- .../apache/hadoop/hbase/protobuf/RequestConverter.java | 9 +++++++-- .../java/org/apache/hadoop/hbase/client/TestAdmin1.java | 8 ++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/638ca24f/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index d18b8b3..ac98bdb 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -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); http://git-wip-us.apache.org/repos/asf/hbase/blob/638ca24f/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java index ce01e1e..c5fe988 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java @@ -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(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/638ca24f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java index ec64eac..b59a583 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java @@ -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) {