hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [11/50] [abbrv] hbase git commit: HBASE-17470 Remove merge region code from region server (Stephen Yuan Jiang)
Date Mon, 23 Jan 2017 23:01:44 GMT
HBASE-17470 Remove merge region code from region server (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/805d39fc
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/805d39fc
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/805d39fc

Branch: refs/heads/HBASE-16961
Commit: 805d39fca6b6be004d2c554cc5d4f76bf48bc01a
Parents: 287f95a
Author: Stephen Yuan Jiang <syuanjiangdev@gmail.com>
Authored: Tue Jan 17 15:39:51 2017 -0800
Committer: Stephen Yuan Jiang <syuanjiangdev@gmail.com>
Committed: Tue Jan 17 15:39:51 2017 -0800

----------------------------------------------------------------------
 .../hbase/client/ConnectionImplementation.java  |    7 -
 .../hbase/shaded/protobuf/ProtobufUtil.java     |   63 -
 .../hbase/shaded/protobuf/RequestConverter.java |   18 -
 .../shaded/protobuf/generated/AdminProtos.java  | 1759 +-------
 .../generated/MasterProcedureProtos.java        | 1864 +-------
 .../shaded/protobuf/generated/MasterProtos.java | 4160 ++++++------------
 .../src/main/protobuf/Admin.proto               |   19 -
 .../src/main/protobuf/Master.proto              |   19 -
 .../src/main/protobuf/MasterProcedure.proto     |   15 -
 .../BaseMasterAndRegionObserver.java            |   12 +
 .../hbase/coprocessor/BaseMasterObserver.java   |   12 +
 .../hbase/coprocessor/MasterObserver.java       |    8 +
 .../org/apache/hadoop/hbase/master/HMaster.java |   50 -
 .../hbase/master/MasterCoprocessorHost.java     |   22 -
 .../hadoop/hbase/master/MasterRpcServices.java  |   46 -
 .../hadoop/hbase/master/MasterServices.java     |   17 -
 .../hadoop/hbase/master/ServerManager.java      |   31 -
 .../DispatchMergingRegionsProcedure.java        |  579 ---
 .../hbase/regionserver/CompactSplitThread.java  |   14 -
 .../hadoop/hbase/regionserver/HRegion.java      |  106 -
 .../hbase/regionserver/RSRpcServices.java       |   42 -
 .../hbase/regionserver/RegionMergeRequest.java  |  153 -
 .../RegionMergeTransactionFactory.java          |   76 -
 .../RegionMergeTransactionImpl.java             |  742 ----
 .../org/apache/hadoop/hbase/util/HMerge.java    |  348 --
 .../org/apache/hadoop/hbase/util/Merge.java     |  264 --
 .../apache/hadoop/hbase/client/TestAdmin1.java  |   50 +-
 .../coprocessor/TestRegionServerObserver.java   |  223 -
 .../hbase/master/MockNoopMasterServices.java    |   10 -
 .../hadoop/hbase/master/MockRegionServer.java   |    9 -
 .../TestDispatchMergingRegionsProcedure.java    |  264 --
 .../hadoop/hbase/regionserver/TestHRegion.java  |   49 -
 .../TestRegionMergeTransaction.java             |  485 --
 .../hadoop/hbase/util/TestMergeTable.java       |  172 -
 .../apache/hadoop/hbase/util/TestMergeTool.java |  301 --
 35 files changed, 1650 insertions(+), 10359 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/805d39fc/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
index cfed9f6..adbc7f9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
@@ -1312,13 +1312,6 @@ class ConnectionImplementation implements ClusterConnection, Closeable
{
       }
 
       @Override
-      public MasterProtos.DispatchMergingRegionsResponse dispatchMergingRegions(
-          RpcController controller, MasterProtos.DispatchMergingRegionsRequest request)
-          throws ServiceException {
-        return stub.dispatchMergingRegions(controller, request);
-      }
-
-      @Override
       public MasterProtos.MergeTableRegionsResponse mergeTableRegions(
           RpcController controller, MasterProtos.MergeTableRegionsRequest request)
           throws ServiceException {

http://git-wip-us.apache.org/repos/asf/hbase/blob/805d39fc/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
index 585a5f8..d862d5f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
@@ -121,7 +121,6 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetServerIn
 import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetServerInfoResponse;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileResponse;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.MergeRegionsRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.OpenRegionRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ServerInfo;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.SplitRegionRequest;
@@ -1950,46 +1949,6 @@ public final class ProtobufUtil {
     }
   }
 
-  /**
-   * A helper to merge regions using admin protocol. Send request to
-   * regionserver.
-   * @param admin
-   * @param region_a
-   * @param region_b
-   * @param forcible true if do a compulsory merge, otherwise we will only merge
-   *          two adjacent regions
-   * @param user effective user
-   * @throws IOException
-   */
-  public static void mergeRegions(final RpcController controller,
-      final AdminService.BlockingInterface admin,
-      final HRegionInfo region_a, final HRegionInfo region_b,
-      final boolean forcible, final User user) throws IOException {
-    final MergeRegionsRequest request = ProtobufUtil.buildMergeRegionsRequest(
-        region_a.getRegionName(), region_b.getRegionName(),forcible);
-    if (user != null) {
-      try {
-        user.runAs(new PrivilegedExceptionAction<Void>() {
-          @Override
-          public Void run() throws Exception {
-            admin.mergeRegions(controller, request);
-            return null;
-          }
-        });
-      } catch (InterruptedException ie) {
-        InterruptedIOException iioe = new InterruptedIOException();
-        iioe.initCause(ie);
-        throw iioe;
-      }
-    } else {
-      try {
-        admin.mergeRegions(controller, request);
-      } catch (ServiceException se) {
-        throw ProtobufUtil.getRemoteException(se);
-      }
-    }
-  }
-
 // End helpers for Admin
 
   /*
@@ -3225,28 +3184,6 @@ public final class ProtobufUtil {
    }
 
   /**
-   * Create a MergeRegionsRequest for the given regions
-   * @param regionA name of region a
-   * @param regionB name of region b
-   * @param forcible true if it is a compulsory merge
-   * @return a MergeRegionsRequest
-   */
-  public static MergeRegionsRequest buildMergeRegionsRequest(
-      final byte[] regionA, final byte[] regionB, final boolean forcible) {
-    MergeRegionsRequest.Builder builder = MergeRegionsRequest.newBuilder();
-    RegionSpecifier regionASpecifier = RequestConverter.buildRegionSpecifier(
-        RegionSpecifierType.REGION_NAME, regionA);
-    RegionSpecifier regionBSpecifier = RequestConverter.buildRegionSpecifier(
-        RegionSpecifierType.REGION_NAME, regionB);
-    builder.setRegionA(regionASpecifier);
-    builder.setRegionB(regionBSpecifier);
-    builder.setForcible(forcible);
-    // send the master's wall clock time as well, so that the RS can refer to it
-    builder.setMasterSystemTime(EnvironmentEdgeManager.currentTime());
-    return builder.build();
-  }
-
-  /**
    * Get a ServerName from the passed in data bytes.
    * @param data Data with a serialize server name in it; can handle the old style
    * servername where servername was host and port.  Works too with data that

http://git-wip-us.apache.org/repos/asf/hbase/blob/805d39fc/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
index 4acb525..fd08d98 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
@@ -84,7 +84,6 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.CreateTabl
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteColumnRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DeleteTableRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DisableTableRequest;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.DispatchMergingRegionsRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.EnableCatalogJanitorRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.EnableTableRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetClusterStatusRequest;
@@ -1089,23 +1088,6 @@ public final class RequestConverter {
     return builder.build();
   }
 
-  public static DispatchMergingRegionsRequest buildDispatchMergingRegionsRequest(
-      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();
-  }
-
   public static MergeTableRegionsRequest buildMergeTableRegionsRequest(
       final byte[][] encodedNameOfdaughaterRegions,
       final boolean forcible,


Mime
View raw message