hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject [14/19] hbase git commit: HBASE-18839 Apply RegionInfo to code base
Date Thu, 28 Sep 2017 12:30:44 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java
index d23cf7d..afd402b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java
@@ -40,31 +40,32 @@ import org.apache.commons.cli.ParseException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.hbase.ClusterStatus.Option;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.ClusterStatus.Option;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.ClusterConnection;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.favored.FavoredNodeAssignmentHelper;
 import org.apache.hadoop.hbase.favored.FavoredNodesPlan;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface;
-import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateFavoredNodesRequest;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateFavoredNodesResponse;
 import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.MunkresAssignment;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
+import org.apache.yetus.audience.InterfaceAudience;
+
+import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateFavoredNodesRequest;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.UpdateFavoredNodesResponse;
 
 /**
  * A tool that is used for manipulating and viewing favored nodes information
@@ -197,12 +198,12 @@ public class RegionPlacementMaintainer {
       Map<String, Map<String, Float>> regionLocalityMap, FavoredNodesPlan plan,
       boolean munkresForSecondaryAndTertiary) throws IOException {
       // Get the all the regions for the current table
-      List<HRegionInfo> regions =
+      List<RegionInfo> regions =
         assignmentSnapshot.getTableToRegionMap().get(tableName);
       int numRegions = regions.size();
 
       // Get the current assignment map
-      Map<HRegionInfo, ServerName> currentAssignmentMap =
+      Map<RegionInfo, ServerName> currentAssignmentMap =
         assignmentSnapshot.getRegionToRegionServerMap();
 
       // Get the all the region servers
@@ -257,12 +258,12 @@ public class RegionPlacementMaintainer {
         // Compute the total rack locality for each region in each rack. The total
         // rack locality is the sum of the localities of a region on all servers in
         // a rack.
-        Map<String, Map<HRegionInfo, Float>> rackRegionLocality = new HashMap<>();
+        Map<String, Map<RegionInfo, Float>> rackRegionLocality = new HashMap<>();
         for (int i = 0; i < numRegions; i++) {
-          HRegionInfo region = regions.get(i);
+          RegionInfo region = regions.get(i);
           for (int j = 0; j < regionSlots; j += slotsPerServer) {
             String rack = rackManager.getRack(servers.get(j / slotsPerServer));
-            Map<HRegionInfo, Float> rackLocality = rackRegionLocality.get(rack);
+            Map<RegionInfo, Float> rackLocality = rackRegionLocality.get(rack);
             if (rackLocality == null) {
               rackLocality = new HashMap<>();
               rackRegionLocality.put(rack, rackLocality);
@@ -417,18 +418,18 @@ public class RegionPlacementMaintainer {
         LOG.info("Assignment plan for secondary and tertiary generated " +
             "using MunkresAssignment");
       } else {
-        Map<HRegionInfo, ServerName> primaryRSMap = new HashMap<>();
+        Map<RegionInfo, ServerName> primaryRSMap = new HashMap<>();
         for (int i = 0; i < numRegions; i++) {
           primaryRSMap.put(regions.get(i), servers.get(primaryAssignment[i] / slotsPerServer));
         }
         FavoredNodeAssignmentHelper favoredNodeHelper =
             new FavoredNodeAssignmentHelper(servers, conf);
         favoredNodeHelper.initialize();
-        Map<HRegionInfo, ServerName[]> secondaryAndTertiaryMap =
+        Map<RegionInfo, ServerName[]> secondaryAndTertiaryMap =
             favoredNodeHelper.placeSecondaryAndTertiaryWithRestrictions(primaryRSMap);
         for (int i = 0; i < numRegions; i++) {
           List<ServerName> favoredServers = new ArrayList<>(FavoredNodeAssignmentHelper.FAVORED_NODES_NUM);
-          HRegionInfo currentRegion = regions.get(i);
+          RegionInfo currentRegion = regions.get(i);
           ServerName s = primaryRSMap.get(currentRegion);
           favoredServers.add(ServerName.valueOf(s.getHostname(), s.getPort(),
               ServerName.NON_STARTCODE));
@@ -467,7 +468,7 @@ public class RegionPlacementMaintainer {
     FavoredNodesPlan plan = new FavoredNodesPlan();
 
     // Get the table to region mapping
-    Map<TableName, List<HRegionInfo>> tableToRegionMap =
+    Map<TableName, List<RegionInfo>> tableToRegionMap =
       assignmentSnapshot.getTableToRegionMap();
     LOG.info("Start to generate the new assignment plan for the " +
          + tableToRegionMap.keySet().size() + " tables" );
@@ -635,8 +636,8 @@ public class RegionPlacementMaintainer {
     try {
       LOG.info("Start to update the hbase:meta with the new assignment plan");
       Map<String, List<ServerName>> assignmentMap = plan.getAssignmentMap();
-      Map<HRegionInfo, List<ServerName>> planToUpdate = new HashMap<>(assignmentMap.size());
-      Map<String, HRegionInfo> regionToRegionInfoMap =
+      Map<RegionInfo, List<ServerName>> planToUpdate = new HashMap<>(assignmentMap.size());
+      Map<String, RegionInfo> regionToRegionInfoMap =
         getRegionAssignmentSnapshot().getRegionNameToRegionInfoMap();
       for (Map.Entry<String, List<ServerName>> entry : assignmentMap.entrySet()) {
         planToUpdate.put(regionToRegionInfoMap.get(entry.getKey()), entry.getValue());
@@ -659,21 +660,21 @@ public class RegionPlacementMaintainer {
   throws IOException{
     LOG.info("Start to update the region servers with the new assignment plan");
     // Get the region to region server map
-    Map<ServerName, List<HRegionInfo>> currentAssignment =
+    Map<ServerName, List<RegionInfo>> currentAssignment =
       this.getRegionAssignmentSnapshot().getRegionServerToRegionMap();
 
     // track of the failed and succeeded updates
     int succeededNum = 0;
     Map<ServerName, Exception> failedUpdateMap = new HashMap<>();
 
-    for (Map.Entry<ServerName, List<HRegionInfo>> entry :
+    for (Map.Entry<ServerName, List<RegionInfo>> entry :
       currentAssignment.entrySet()) {
-      List<Pair<HRegionInfo, List<ServerName>>> regionUpdateInfos = new ArrayList<>();
+      List<Pair<RegionInfo, List<ServerName>>> regionUpdateInfos = new ArrayList<>();
       try {
         // Keep track of the favored updates for the current region server
         FavoredNodesPlan singleServerPlan = null;
         // Find out all the updates for the current region server
-        for (HRegionInfo region : entry.getValue()) {
+        for (RegionInfo region : entry.getValue()) {
           List<ServerName> favoredServerList = plan.getFavoredNodes(region);
           if (favoredServerList != null &&
               favoredServerList.size() == FavoredNodeAssignmentHelper.FAVORED_NODES_NUM) {
@@ -746,7 +747,7 @@ public class RegionPlacementMaintainer {
       throws IOException {
     Map<TableName, Integer> movesPerTable = new HashMap<>();
     SnapshotOfRegionAssignmentFromMeta snapshot = this.getRegionAssignmentSnapshot();
-    Map<TableName, List<HRegionInfo>> tableToRegions = snapshot
+    Map<TableName, List<RegionInfo>> tableToRegions = snapshot
         .getTableToRegionMap();
     FavoredNodesPlan oldPlan = snapshot.getExistingAssignmentPlan();
     Set<TableName> tables = snapshot.getTableSet();
@@ -756,8 +757,8 @@ public class RegionPlacementMaintainer {
           && !this.targetTableSet.contains(table)) {
         continue;
       }
-      List<HRegionInfo> regions = tableToRegions.get(table);
-      for (HRegionInfo region : regions) {
+      List<RegionInfo> regions = tableToRegions.get(table);
+      for (RegionInfo region : regions) {
         List<ServerName> oldServers = oldPlan.getFavoredNodes(region);
         List<ServerName> newServers = newPlan.getFavoredNodes(region);
         if (oldServers != null && newServers != null) {
@@ -789,7 +790,7 @@ public class RegionPlacementMaintainer {
     SnapshotOfRegionAssignmentFromMeta snapshot = this.getRegionAssignmentSnapshot();
     FavoredNodesPlan oldPlan = snapshot.getExistingAssignmentPlan();
     Set<TableName> tables = snapshot.getTableSet();
-    Map<TableName, List<HRegionInfo>> tableToRegionsMap = snapshot.getTableToRegionMap();
+    Map<TableName, List<RegionInfo>> tableToRegionsMap = snapshot.getTableToRegionMap();
     for (TableName table : tables) {
       float[] deltaLocality = new float[3];
       float[] locality = new float[3];
@@ -797,13 +798,13 @@ public class RegionPlacementMaintainer {
           && !this.targetTableSet.contains(table)) {
         continue;
       }
-      List<HRegionInfo> regions = tableToRegionsMap.get(table);
+      List<RegionInfo> regions = tableToRegionsMap.get(table);
       System.out.println("==================================================");
       System.out.println("Assignment Plan Projection Report For Table: " + table);
       System.out.println("\t Total regions: " + regions.size());
       System.out.println("\t" + movesPerTable.get(table)
           + " primaries will move due to their primary has changed");
-      for (HRegionInfo currentRegion : regions) {
+      for (RegionInfo currentRegion : regions) {
         Map<String, Float> regionLocality = regionLocalityMap.get(currentRegion
             .getEncodedName());
         if (regionLocality == null) {
@@ -881,7 +882,7 @@ public class RegionPlacementMaintainer {
     SnapshotOfRegionAssignmentFromMeta snapshot = this.getRegionAssignmentSnapshot();
     FavoredNodesPlan assignmentPlan = snapshot.getExistingAssignmentPlan();
     Set<TableName> tables = snapshot.getTableSet();
-    Map<TableName, List<HRegionInfo>> tableToRegionsMap = snapshot
+    Map<TableName, List<RegionInfo>> tableToRegionsMap = snapshot
         .getTableToRegionMap();
     for (TableName table : tables) {
       float[] locality = new float[3];
@@ -889,8 +890,8 @@ public class RegionPlacementMaintainer {
           && !this.targetTableSet.contains(table)) {
         continue;
       }
-      List<HRegionInfo> regions = tableToRegionsMap.get(table);
-      for (HRegionInfo currentRegion : regions) {
+      List<RegionInfo> regions = tableToRegionsMap.get(table);
+      for (RegionInfo currentRegion : regions) {
         Map<String, Float> regionLocality = regionLocalityMap.get(currentRegion
             .getEncodedName());
         if (regionLocality == null) {
@@ -1094,7 +1095,7 @@ public class RegionPlacementMaintainer {
         LOG.info("Going to update the region " + regionName + " with the new favored nodes " +
             favoredNodesStr);
         List<ServerName> favoredNodes = null;
-        HRegionInfo regionInfo =
+        RegionInfo regionInfo =
             rp.getRegionAssignmentSnapshot().getRegionNameToRegionInfoMap().get(regionName);
         if (regionInfo == null) {
           LOG.error("Cannot find the region " + regionName + " from the META");

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlan.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlan.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlan.java
index dbeaa58..10252df 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlan.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlan.java
@@ -20,10 +20,10 @@ package org.apache.hadoop.hbase.master;
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.yetus.audience.InterfaceStability;
-import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.ServerName;
 
 /**
  * Stores the plan for the move of an individual region.
@@ -38,7 +38,7 @@ import org.apache.hadoop.hbase.ServerName;
 @InterfaceAudience.LimitedPrivate("Coprocessors")
 @InterfaceStability.Evolving
 public class RegionPlan implements Comparable<RegionPlan> {
-  private final HRegionInfo hri;
+  private final RegionInfo hri;
   private final ServerName source;
   private ServerName dest;
 
@@ -66,7 +66,7 @@ public class RegionPlan implements Comparable<RegionPlan> {
    * @param source regionserver region should be moved from
    * @param dest regionserver region should be moved to
    */
-  public RegionPlan(final HRegionInfo hri, ServerName source, ServerName dest) {
+  public RegionPlan(final RegionInfo hri, ServerName source, ServerName dest) {
     this.hri = hri;
     this.source = source;
     this.dest = dest;
@@ -103,7 +103,7 @@ public class RegionPlan implements Comparable<RegionPlan> {
     return this.hri.getEncodedName();
   }
 
-  public HRegionInfo getRegionInfo() {
+  public RegionInfo getRegionInfo() {
     return this.hri;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
index 4dba66e..b63d55a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
@@ -43,32 +43,32 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.ClockOutOfSyncException;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.NotServingRegionException;
 import org.apache.hadoop.hbase.RegionLoad;
 import org.apache.hadoop.hbase.ServerLoad;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.YouAreDeadException;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.client.ClusterConnection;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.client.RetriesExhaustedException;
 import org.apache.hadoop.hbase.ipc.HBaseRpcController;
 import org.apache.hadoop.hbase.ipc.RpcControllerFactory;
 import org.apache.hadoop.hbase.monitoring.MonitoredTask;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
-import org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations;
-import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionStoreSequenceIds;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.StoreSequenceId;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.zookeeper.ZKUtil;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.zookeeper.KeeperException;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
+import org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations;
+import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionStoreSequenceIds;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.StoreSequenceId;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest;
 
 /**
  * The ServerManager class manages info about region servers.
@@ -257,7 +257,7 @@ public class ServerManager {
   private void updateLastFlushedSequenceIds(ServerName sn, ServerLoad hsl) {
     Map<byte[], RegionLoad> regionsLoad = hsl.getRegionsLoad();
     for (Entry<byte[], RegionLoad> entry : regionsLoad.entrySet()) {
-      byte[] encodedRegionName = Bytes.toBytes(HRegionInfo.encodeRegionName(entry.getKey()));
+      byte[] encodedRegionName = Bytes.toBytes(RegionInfo.encodeRegionName(entry.getKey()));
       Long existingValue = flushedSequenceIdByRegion.get(encodedRegionName);
       long l = entry.getValue().getCompleteSequenceId();
       // Don't let smaller sequence ids override greater sequence ids.
@@ -714,7 +714,7 @@ public class ServerManager {
    * @param region region to  warmup
    */
   public void sendRegionWarmup(ServerName server,
-      HRegionInfo region) {
+      RegionInfo region) {
     if (server == null) return;
     try {
       AdminService.BlockingInterface admin = getRsAdmin(server);
@@ -732,7 +732,7 @@ public class ServerManager {
    * to close the region.  This bypasses the active hmaster.
    */
   public static void closeRegionSilentlyAndWait(ClusterConnection connection,
-    ServerName server, HRegionInfo region, long timeout) throws IOException, InterruptedException {
+    ServerName server, RegionInfo region, long timeout) throws IOException, InterruptedException {
     AdminService.BlockingInterface rs = connection.getAdmin(server);
     HBaseRpcController controller = connection.getRpcControllerFactory().newController();
     try {
@@ -744,7 +744,7 @@ public class ServerManager {
     while (System.currentTimeMillis() < expiration) {
       controller.reset();
       try {
-        HRegionInfo rsRegion =
+        RegionInfo rsRegion =
           ProtobufUtil.getRegionInfo(controller, rs, region.getRegionName());
         if (rsRegion == null) return;
       } catch (IOException ioe) {
@@ -1023,14 +1023,14 @@ public class ServerManager {
   /**
    * Called by delete table and similar to notify the ServerManager that a region was removed.
    */
-  public void removeRegion(final HRegionInfo regionInfo) {
+  public void removeRegion(final RegionInfo regionInfo) {
     final byte[] encodedName = regionInfo.getEncodedNameAsBytes();
     storeFlushedSequenceIdsByRegion.remove(encodedName);
     flushedSequenceIdByRegion.remove(encodedName);
   }
 
   @VisibleForTesting
-  public boolean isRegionInServerManagerStates(final HRegionInfo hri) {
+  public boolean isRegionInServerManagerStates(final RegionInfo hri) {
     final byte[] encodedName = hri.getEncodedNameAsBytes();
     return (storeFlushedSequenceIdsByRegion.containsKey(encodedName)
         || flushedSequenceIdByRegion.containsKey(encodedName));
@@ -1039,8 +1039,8 @@ public class ServerManager {
   /**
    * Called by delete table and similar to notify the ServerManager that a region was removed.
    */
-  public void removeRegions(final List<HRegionInfo> regions) {
-    for (HRegionInfo hri: regions) {
+  public void removeRegions(final List<RegionInfo> regions) {
+    for (RegionInfo hri: regions) {
       removeRegion(hri);
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SnapshotOfRegionAssignmentFromMeta.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SnapshotOfRegionAssignmentFromMeta.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SnapshotOfRegionAssignmentFromMeta.java
index 403a24e..5d889a4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SnapshotOfRegionAssignmentFromMeta.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SnapshotOfRegionAssignmentFromMeta.java
@@ -34,19 +34,19 @@ import java.util.TreeMap;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.hadoop.hbase.favored.FavoredNodeAssignmentHelper;
-import org.apache.hadoop.hbase.favored.FavoredNodesPlan;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HRegionLocation;
+import org.apache.hadoop.hbase.MetaTableAccessor;
+import org.apache.hadoop.hbase.MetaTableAccessor.Visitor;
 import org.apache.hadoop.hbase.RegionLocations;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.MetaTableAccessor;
-import org.apache.hadoop.hbase.MetaTableAccessor.Visitor;
 import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.favored.FavoredNodeAssignmentHelper;
+import org.apache.hadoop.hbase.favored.FavoredNodesPlan;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * Used internally for reading meta and constructing datastructures that are
@@ -62,18 +62,18 @@ public class SnapshotOfRegionAssignmentFromMeta {
   private final Connection connection;
 
   /** the table name to region map */
-  private final Map<TableName, List<HRegionInfo>> tableToRegionMap;
+  private final Map<TableName, List<RegionInfo>> tableToRegionMap;
   /** the region to region server map */
-  //private final Map<HRegionInfo, ServerName> regionToRegionServerMap;
-  private Map<HRegionInfo, ServerName> regionToRegionServerMap;
+  //private final Map<RegionInfo, ServerName> regionToRegionServerMap;
+  private Map<RegionInfo, ServerName> regionToRegionServerMap;
   /** the region name to region info map */
-  private final Map<String, HRegionInfo> regionNameToRegionInfoMap;
+  private final Map<String, RegionInfo> regionNameToRegionInfoMap;
 
   /** the regionServer to region map */
-  private final Map<ServerName, List<HRegionInfo>> currentRSToRegionMap;
-  private final Map<ServerName, List<HRegionInfo>> secondaryRSToRegionMap;
-  private final Map<ServerName, List<HRegionInfo>> teritiaryRSToRegionMap;
-  private final Map<ServerName, List<HRegionInfo>> primaryRSToRegionMap;
+  private final Map<ServerName, List<RegionInfo>> currentRSToRegionMap;
+  private final Map<ServerName, List<RegionInfo>> secondaryRSToRegionMap;
+  private final Map<ServerName, List<RegionInfo>> teritiaryRSToRegionMap;
+  private final Map<ServerName, List<RegionInfo>> primaryRSToRegionMap;
   /** the existing assignment plan in the hbase:meta region */
   private final FavoredNodesPlan existingAssignmentPlan;
   private final Set<TableName> disabledTables;
@@ -113,7 +113,7 @@ public class SnapshotOfRegionAssignmentFromMeta {
           if (result ==  null || result.isEmpty()) return true;
           RegionLocations rl = MetaTableAccessor.getRegionLocations(result);
           if (rl == null) return true;
-          HRegionInfo hri = rl.getRegionLocation(0).getRegionInfo();
+          RegionInfo hri = rl.getRegionLocation(0).getRegionInfo();
           if (hri == null) return true;
           if (hri.getTable() == null) return true;
           if (disabledTables.contains(hri.getTable())) {
@@ -172,13 +172,13 @@ public class SnapshotOfRegionAssignmentFromMeta {
       "snapshot");
   }
 
-  private void addRegion(HRegionInfo regionInfo) {
+  private void addRegion(RegionInfo regionInfo) {
     // Process the region name to region info map
     regionNameToRegionInfoMap.put(regionInfo.getRegionNameAsString(), regionInfo);
 
     // Process the table to region map
     TableName tableName = regionInfo.getTable();
-    List<HRegionInfo> regionList = tableToRegionMap.get(tableName);
+    List<RegionInfo> regionList = tableToRegionMap.get(tableName);
     if (regionList == null) {
       regionList = new ArrayList<>();
     }
@@ -187,14 +187,14 @@ public class SnapshotOfRegionAssignmentFromMeta {
     tableToRegionMap.put(tableName, regionList);
   }
 
-  private void addAssignment(HRegionInfo regionInfo, ServerName server) {
+  private void addAssignment(RegionInfo regionInfo, ServerName server) {
     // Process the region to region server map
     regionToRegionServerMap.put(regionInfo, server);
 
     if (server == null) return;
 
     // Process the region server to region map
-    List<HRegionInfo> regionList = currentRSToRegionMap.get(server);
+    List<RegionInfo> regionList = currentRSToRegionMap.get(server);
     if (regionList == null) {
       regionList = new ArrayList<>();
     }
@@ -202,9 +202,9 @@ public class SnapshotOfRegionAssignmentFromMeta {
     currentRSToRegionMap.put(server, regionList);
   }
 
-  private void addPrimaryAssignment(HRegionInfo regionInfo, ServerName server) {
+  private void addPrimaryAssignment(RegionInfo regionInfo, ServerName server) {
     // Process the region server to region map
-    List<HRegionInfo> regionList = primaryRSToRegionMap.get(server);
+    List<RegionInfo> regionList = primaryRSToRegionMap.get(server);
     if (regionList == null) {
       regionList = new ArrayList<>();
     }
@@ -212,9 +212,9 @@ public class SnapshotOfRegionAssignmentFromMeta {
     primaryRSToRegionMap.put(server, regionList);
   }
 
-  private void addSecondaryAssignment(HRegionInfo regionInfo, ServerName server) {
+  private void addSecondaryAssignment(RegionInfo regionInfo, ServerName server) {
     // Process the region server to region map
-    List<HRegionInfo> regionList = secondaryRSToRegionMap.get(server);
+    List<RegionInfo> regionList = secondaryRSToRegionMap.get(server);
     if (regionList == null) {
       regionList = new ArrayList<>();
     }
@@ -222,9 +222,9 @@ public class SnapshotOfRegionAssignmentFromMeta {
     secondaryRSToRegionMap.put(server, regionList);
   }
 
-  private void addTeritiaryAssignment(HRegionInfo regionInfo, ServerName server) {
+  private void addTeritiaryAssignment(RegionInfo regionInfo, ServerName server) {
     // Process the region server to region map
-    List<HRegionInfo> regionList = teritiaryRSToRegionMap.get(server);
+    List<RegionInfo> regionList = teritiaryRSToRegionMap.get(server);
     if (regionList == null) {
       regionList = new ArrayList<>();
     }
@@ -236,7 +236,7 @@ public class SnapshotOfRegionAssignmentFromMeta {
    * Get the regioninfo for a region
    * @return the regioninfo
    */
-  public Map<String, HRegionInfo> getRegionNameToRegionInfoMap() {
+  public Map<String, RegionInfo> getRegionNameToRegionInfoMap() {
     return this.regionNameToRegionInfoMap;
   }
 
@@ -244,7 +244,7 @@ public class SnapshotOfRegionAssignmentFromMeta {
    * Get regions for tables
    * @return a mapping from table to regions
    */
-  public Map<TableName, List<HRegionInfo>> getTableToRegionMap() {
+  public Map<TableName, List<RegionInfo>> getTableToRegionMap() {
     return tableToRegionMap;
   }
 
@@ -252,7 +252,7 @@ public class SnapshotOfRegionAssignmentFromMeta {
    * Get region to region server map
    * @return region to region server map
    */
-  public Map<HRegionInfo, ServerName> getRegionToRegionServerMap() {
+  public Map<RegionInfo, ServerName> getRegionToRegionServerMap() {
     return regionToRegionServerMap;
   }
 
@@ -260,7 +260,7 @@ public class SnapshotOfRegionAssignmentFromMeta {
    * Get regionserver to region map
    * @return regionserver to region map
    */
-  public Map<ServerName, List<HRegionInfo>> getRegionServerToRegionMap() {
+  public Map<ServerName, List<RegionInfo>> getRegionServerToRegionMap() {
     return currentRSToRegionMap;
   }
 
@@ -280,15 +280,15 @@ public class SnapshotOfRegionAssignmentFromMeta {
     return this.tableToRegionMap.keySet();
   }
 
-  public Map<ServerName, List<HRegionInfo>> getSecondaryToRegionInfoMap() {
+  public Map<ServerName, List<RegionInfo>> getSecondaryToRegionInfoMap() {
     return this.secondaryRSToRegionMap;
   }
 
-  public Map<ServerName, List<HRegionInfo>> getTertiaryToRegionInfoMap() {
+  public Map<ServerName, List<RegionInfo>> getTertiaryToRegionInfoMap() {
     return this.teritiaryRSToRegionMap;
   }
 
-  public Map<ServerName, List<HRegionInfo>> getPrimaryToRegionInfoMap() {
+  public Map<ServerName, List<RegionInfo>> getPrimaryToRegionInfoMap() {
     return this.primaryRSToRegionMap;
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
index bc05c0c..8027b6a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
@@ -24,8 +24,6 @@ import static org.apache.hadoop.hbase.master.SplitLogManager.TerminationStatus.F
 import static org.apache.hadoop.hbase.master.SplitLogManager.TerminationStatus.IN_PROGRESS;
 import static org.apache.hadoop.hbase.master.SplitLogManager.TerminationStatus.SUCCESS;
 
-import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
-
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.util.ArrayList;
@@ -48,22 +46,24 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.PathFilter;
 import org.apache.hadoop.hbase.ChoreService;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.ScheduledChore;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.SplitLogCounters;
 import org.apache.hadoop.hbase.Stoppable;
-import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.coordination.BaseCoordinatedStateManager;
 import org.apache.hadoop.hbase.coordination.SplitLogManagerCoordination;
 import org.apache.hadoop.hbase.coordination.SplitLogManagerCoordination.SplitLogManagerDetails;
 import org.apache.hadoop.hbase.monitoring.MonitoredTask;
 import org.apache.hadoop.hbase.monitoring.TaskMonitor;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hbase.wal.AbstractFSWALProvider;
+import org.apache.yetus.audience.InterfaceAudience;
+
+import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode;
 
 /**
  * Distributes the task of log splitting to the available region servers.
@@ -545,7 +545,7 @@ public class SplitLogManager {
     getSplitLogManagerCoordination().setRecoveryMode(isForInitialization);
   }
 
-  public void markRegionsRecovering(ServerName server, Set<HRegionInfo> userRegions)
+  public void markRegionsRecovering(ServerName server, Set<RegionInfo> userRegions)
       throws InterruptedIOException, IOException {
     if (userRegions == null || (!isLogReplaying())) {
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignProcedure.java
index 4a0f2d8..01a5f83 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignProcedure.java
@@ -20,12 +20,12 @@
 package org.apache.hadoop.hbase.master.assignment;
 
 import java.io.IOException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.client.RetriesExhaustedException;
 import org.apache.hadoop.hbase.client.TableState;
 import org.apache.hadoop.hbase.exceptions.UnexpectedStateException;
@@ -38,6 +38,8 @@ import org.apache.hadoop.hbase.procedure2.ProcedureMetrics;
 import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer;
 import org.apache.hadoop.hbase.procedure2.ProcedureSuspendedException;
 import org.apache.hadoop.hbase.procedure2.RemoteProcedureDispatcher.RemoteOperation;
+import org.apache.yetus.audience.InterfaceAudience;
+
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignRegionStateData;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.RegionTransitionState;
@@ -87,17 +89,17 @@ public class AssignProcedure extends RegionTransitionProcedure {
     super();
   }
 
-  public AssignProcedure(final HRegionInfo regionInfo) {
+  public AssignProcedure(final RegionInfo regionInfo) {
     this(regionInfo, false);
   }
 
-  public AssignProcedure(final HRegionInfo regionInfo, final boolean forceNewPlan) {
+  public AssignProcedure(final RegionInfo regionInfo, final boolean forceNewPlan) {
     super(regionInfo);
     this.forceNewPlan = forceNewPlan;
     this.targetServer = null;
   }
 
-  public AssignProcedure(final HRegionInfo regionInfo, final ServerName destinationServer) {
+  public AssignProcedure(final RegionInfo regionInfo, final ServerName destinationServer) {
     super(regionInfo);
     this.forceNewPlan = false;
     this.targetServer = destinationServer;
@@ -123,7 +125,7 @@ public class AssignProcedure extends RegionTransitionProcedure {
       throws IOException {
     final AssignRegionStateData.Builder state = AssignRegionStateData.newBuilder()
         .setTransitionState(getTransitionState())
-        .setRegionInfo(HRegionInfo.convert(getRegionInfo()));
+        .setRegionInfo(ProtobufUtil.toRegionInfo(getRegionInfo()));
     if (forceNewPlan) {
       state.setForceNewPlan(true);
     }
@@ -138,7 +140,7 @@ public class AssignProcedure extends RegionTransitionProcedure {
       throws IOException {
     final AssignRegionStateData state = serializer.deserialize(AssignRegionStateData.class);
     setTransitionState(state.getTransitionState());
-    setRegionInfo(HRegionInfo.convert(state.getRegionInfo()));
+    setRegionInfo(ProtobufUtil.toRegionInfo(state.getRegionInfo()));
     forceNewPlan = state.getForceNewPlan();
     if (state.hasTargetServer()) {
       this.targetServer = ProtobufUtil.toServerName(state.getTargetServer());

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
index f96c1a5..021d411 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
@@ -40,17 +40,16 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseIOException;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.PleaseHoldException;
 import org.apache.hadoop.hbase.RegionException;
 import org.apache.hadoop.hbase.RegionStateListener;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.YouAreDeadException;
-import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.hadoop.hbase.client.RegionInfo;
+import org.apache.hadoop.hbase.client.RegionInfoBuilder;
 import org.apache.hadoop.hbase.client.TableState;
 import org.apache.hadoop.hbase.exceptions.UnexpectedStateException;
-import org.apache.hadoop.hbase.master.balancer.FavoredStochasticBalancer;
 import org.apache.hadoop.hbase.favored.FavoredNodesManager;
 import org.apache.hadoop.hbase.favored.FavoredNodesPromoter;
 import org.apache.hadoop.hbase.master.AssignmentListener;
@@ -66,7 +65,7 @@ import org.apache.hadoop.hbase.master.TableStateManager;
 import org.apache.hadoop.hbase.master.assignment.RegionStates.RegionStateNode;
 import org.apache.hadoop.hbase.master.assignment.RegionStates.ServerState;
 import org.apache.hadoop.hbase.master.assignment.RegionStates.ServerStateNode;
-// TODO: why are they here?
+import org.apache.hadoop.hbase.master.balancer.FavoredStochasticBalancer;
 import org.apache.hadoop.hbase.master.normalizer.RegionNormalizer;
 import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
 import org.apache.hadoop.hbase.master.procedure.MasterProcedureScheduler;
@@ -77,19 +76,21 @@ import org.apache.hadoop.hbase.procedure2.ProcedureEvent;
 import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;
 import org.apache.hadoop.hbase.procedure2.ProcedureInMemoryChore;
 import org.apache.hadoop.hbase.procedure2.util.StringUtils;
-import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionRequest;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionResponse;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hbase.util.Threads;
 import org.apache.hadoop.hbase.util.VersionInfo;
+import org.apache.yetus.audience.InterfaceAudience;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
-import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;
+import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionRequest;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionResponse;
+
+// TODO: why are they here?
 
 /**
  * The AssignmentManager is the coordinator for region assign/unassign operations.
@@ -256,7 +257,7 @@ public class AssignmentManager implements ServerListener {
     if (hasProcExecutor) {
       getProcedureScheduler().suspendEvent(metaLoadEvent);
       setFailoverCleanupDone(false);
-      for (HRegionInfo hri: getMetaRegionSet()) {
+      for (RegionInfo hri: getMetaRegionSet()) {
         setMetaInitialized(hri, false);
       }
     }
@@ -326,7 +327,7 @@ public class AssignmentManager implements ServerListener {
     return regionStateStore;
   }
 
-  public List<ServerName> getFavoredNodes(final HRegionInfo regionInfo) {
+  public List<ServerName> getFavoredNodes(final RegionInfo regionInfo) {
     return this.shouldAssignRegionsWithFavoredNodes?
         ((FavoredStochasticBalancer)getBalancer()).getFavoredNodes(regionInfo):
           ServerName.EMPTY_SERVER_LIST;
@@ -351,7 +352,7 @@ public class AssignmentManager implements ServerListener {
   // ============================================================================================
   //  META Helpers
   // ============================================================================================
-  private boolean isMetaRegion(final HRegionInfo regionInfo) {
+  private boolean isMetaRegion(final RegionInfo regionInfo) {
     return regionInfo.isMetaRegion();
   }
 
@@ -359,8 +360,8 @@ public class AssignmentManager implements ServerListener {
     return getMetaRegionFromName(regionName) != null;
   }
 
-  public HRegionInfo getMetaRegionFromName(final byte[] regionName) {
-    for (HRegionInfo hri: getMetaRegionSet()) {
+  public RegionInfo getMetaRegionFromName(final byte[] regionName) {
+    for (RegionInfo hri: getMetaRegionSet()) {
       if (Bytes.equals(hri.getRegionName(), regionName)) {
         return hri;
       }
@@ -369,7 +370,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   public boolean isCarryingMeta(final ServerName serverName) {
-    for (HRegionInfo hri: getMetaRegionSet()) {
+    for (RegionInfo hri: getMetaRegionSet()) {
       if (isCarryingRegion(serverName, hri)) {
         return true;
       }
@@ -377,23 +378,23 @@ public class AssignmentManager implements ServerListener {
     return false;
   }
 
-  private boolean isCarryingRegion(final ServerName serverName, final HRegionInfo regionInfo) {
+  private boolean isCarryingRegion(final ServerName serverName, final RegionInfo regionInfo) {
     // TODO: check for state?
     final RegionStateNode node = regionStates.getRegionNode(regionInfo);
     return(node != null && serverName.equals(node.getRegionLocation()));
   }
 
-  private HRegionInfo getMetaForRegion(final HRegionInfo regionInfo) {
+  private RegionInfo getMetaForRegion(final RegionInfo regionInfo) {
     //if (regionInfo.isMetaRegion()) return regionInfo;
     // TODO: handle multiple meta. if the region provided is not meta lookup
     // which meta the region belongs to.
-    return HRegionInfo.FIRST_META_REGIONINFO;
+    return RegionInfoBuilder.FIRST_META_REGIONINFO;
   }
 
   // TODO: handle multiple meta.
-  private static final Set<HRegionInfo> META_REGION_SET =
-      Collections.singleton(HRegionInfo.FIRST_META_REGIONINFO);
-  public Set<HRegionInfo> getMetaRegionSet() {
+  private static final Set<RegionInfo> META_REGION_SET =
+      Collections.singleton(RegionInfoBuilder.FIRST_META_REGIONINFO);
+  public Set<RegionInfo> getMetaRegionSet() {
     return META_REGION_SET;
   }
 
@@ -411,15 +412,15 @@ public class AssignmentManager implements ServerListener {
   public boolean waitMetaInitialized(final Procedure proc) {
     // TODO: handle multiple meta. should this wait on all meta?
     // this is used by the ServerCrashProcedure...
-    return waitMetaInitialized(proc, HRegionInfo.FIRST_META_REGIONINFO);
+    return waitMetaInitialized(proc, RegionInfoBuilder.FIRST_META_REGIONINFO);
   }
 
-  public boolean waitMetaInitialized(final Procedure proc, final HRegionInfo regionInfo) {
+  public boolean waitMetaInitialized(final Procedure proc, final RegionInfo regionInfo) {
     return getProcedureScheduler().waitEvent(
       getMetaInitializedEvent(getMetaForRegion(regionInfo)), proc);
   }
 
-  private void setMetaInitialized(final HRegionInfo metaRegionInfo, final boolean isInitialized) {
+  private void setMetaInitialized(final RegionInfo metaRegionInfo, final boolean isInitialized) {
     assert isMetaRegion(metaRegionInfo) : "unexpected non-meta region " + metaRegionInfo;
     final ProcedureEvent metaInitEvent = getMetaInitializedEvent(metaRegionInfo);
     if (isInitialized) {
@@ -429,7 +430,7 @@ public class AssignmentManager implements ServerListener {
     }
   }
 
-  private ProcedureEvent getMetaInitializedEvent(final HRegionInfo metaRegionInfo) {
+  private ProcedureEvent getMetaInitializedEvent(final RegionInfo metaRegionInfo) {
     assert isMetaRegion(metaRegionInfo) : "unexpected non-meta region " + metaRegionInfo;
     // TODO: handle multiple meta.
     return metaInitializedEvent;
@@ -451,11 +452,11 @@ public class AssignmentManager implements ServerListener {
   // ============================================================================================
   //  TODO: Sync helpers
   // ============================================================================================
-  public void assignMeta(final HRegionInfo metaRegionInfo) throws IOException {
+  public void assignMeta(final RegionInfo metaRegionInfo) throws IOException {
     assignMeta(metaRegionInfo, null);
   }
 
-  public void assignMeta(final HRegionInfo metaRegionInfo, final ServerName serverName)
+  public void assignMeta(final RegionInfo metaRegionInfo, final ServerName serverName)
       throws IOException {
     assert isMetaRegion(metaRegionInfo) : "unexpected non-meta region " + metaRegionInfo;
     AssignProcedure proc;
@@ -490,9 +491,9 @@ public class AssignmentManager implements ServerListener {
               // handling.
               continue;
             }
-            List<HRegionInfo> regionsShouldMove = getCarryingSystemTables(server);
+            List<RegionInfo> regionsShouldMove = getCarryingSystemTables(server);
             if (!regionsShouldMove.isEmpty()) {
-              for (HRegionInfo regionInfo : regionsShouldMove) {
+              for (RegionInfo regionInfo : regionsShouldMove) {
                 // null value for dest forces destination server to be selected by balancer
                 RegionPlan plan = new RegionPlan(regionInfo, server, null);
                 if (regionInfo.isMetaRegion()) {
@@ -514,31 +515,31 @@ public class AssignmentManager implements ServerListener {
     }).start();
   }
 
-  private List<HRegionInfo> getCarryingSystemTables(ServerName serverName) {
+  private List<RegionInfo> getCarryingSystemTables(ServerName serverName) {
     Set<RegionStateNode> regions = this.getRegionStates().getServerNode(serverName).getRegions();
     if (regions == null) {
       return new ArrayList<>();
     }
     return regions.stream()
         .map(RegionStateNode::getRegionInfo)
-        .filter(HRegionInfo::isSystemTable)
+        .filter(RegionInfo::isSystemTable)
         .collect(Collectors.toList());
   }
 
-  public void assign(final HRegionInfo regionInfo) throws IOException {
+  public void assign(final RegionInfo regionInfo) throws IOException {
     assign(regionInfo, true);
   }
 
-  public void assign(final HRegionInfo regionInfo, final boolean forceNewPlan) throws IOException {
+  public void assign(final RegionInfo regionInfo, final boolean forceNewPlan) throws IOException {
     AssignProcedure proc = createAssignProcedure(regionInfo, forceNewPlan);
     ProcedureSyncWait.submitAndWaitProcedure(master.getMasterProcedureExecutor(), proc);
   }
 
-  public void unassign(final HRegionInfo regionInfo) throws IOException {
+  public void unassign(final RegionInfo regionInfo) throws IOException {
     unassign(regionInfo, false);
   }
 
-  public void unassign(final HRegionInfo regionInfo, final boolean forceNewPlan)
+  public void unassign(final RegionInfo regionInfo, final boolean forceNewPlan)
   throws IOException {
     // TODO: rename this reassign
     RegionStateNode node = this.regionStates.getRegionNode(regionInfo);
@@ -557,13 +558,13 @@ public class AssignmentManager implements ServerListener {
   }
 
   @VisibleForTesting
-  public boolean waitForAssignment(final HRegionInfo regionInfo) throws IOException {
+  public boolean waitForAssignment(final RegionInfo regionInfo) throws IOException {
     return waitForAssignment(regionInfo, Long.MAX_VALUE);
   }
 
   @VisibleForTesting
   // TODO: Remove this?
-  public boolean waitForAssignment(final HRegionInfo regionInfo, final long timeout)
+  public boolean waitForAssignment(final RegionInfo regionInfo, final long timeout)
   throws IOException {
     RegionStateNode node = null;
     // This method can be called before the regionInfo has made it into the regionStateMap
@@ -597,16 +598,16 @@ public class AssignmentManager implements ServerListener {
   //  RegionTransition procedures helpers
   // ============================================================================================
 
-  public AssignProcedure[] createAssignProcedures(final Collection<HRegionInfo> regionInfo) {
+  public AssignProcedure[] createAssignProcedures(final Collection<RegionInfo> regionInfo) {
     return createAssignProcedures(regionInfo, false);
   }
 
-  public AssignProcedure[] createAssignProcedures(final Collection<HRegionInfo> regionInfo,
+  public AssignProcedure[] createAssignProcedures(final Collection<RegionInfo> regionInfo,
       final boolean forceNewPlan) {
     if (regionInfo.isEmpty()) return null;
     final AssignProcedure[] procs = new AssignProcedure[regionInfo.size()];
     int index = 0;
-    for (HRegionInfo hri: regionInfo) {
+    for (RegionInfo hri: regionInfo) {
       procs[index++] = createAssignProcedure(hri, forceNewPlan);
     }
     return procs;
@@ -629,10 +630,10 @@ public class AssignmentManager implements ServerListener {
     return procs.toArray(UNASSIGNED_PROCEDURE_FOR_TYPE_INFO);
   }
 
-  public MoveRegionProcedure[] createReopenProcedures(final Collection<HRegionInfo> regionInfo) {
+  public MoveRegionProcedure[] createReopenProcedures(final Collection<RegionInfo> regionInfo) {
     final MoveRegionProcedure[] procs = new MoveRegionProcedure[regionInfo.size()];
     int index = 0;
-    for (HRegionInfo hri: regionInfo) {
+    for (RegionInfo hri: regionInfo) {
       final ServerName serverName = regionStates.getRegionServerOfRegion(hri);
       final RegionPlan plan = new RegionPlan(hri, serverName, serverName);
       procs[index++] = createMoveRegionProcedure(plan);
@@ -664,21 +665,21 @@ public class AssignmentManager implements ServerListener {
     return createReopenProcedures(regionStates.getRegionsOfTable(tableName));
   }
 
-  public AssignProcedure createAssignProcedure(final HRegionInfo regionInfo,
+  public AssignProcedure createAssignProcedure(final RegionInfo regionInfo,
       final boolean forceNewPlan) {
     AssignProcedure proc = new AssignProcedure(regionInfo, forceNewPlan);
     proc.setOwner(getProcedureEnvironment().getRequestUser().getShortName());
     return proc;
   }
 
-  public AssignProcedure createAssignProcedure(final HRegionInfo regionInfo,
+  public AssignProcedure createAssignProcedure(final RegionInfo regionInfo,
       final ServerName targetServer) {
     AssignProcedure proc = new AssignProcedure(regionInfo, targetServer);
     proc.setOwner(getProcedureEnvironment().getRequestUser().getShortName());
     return proc;
   }
 
-  public UnassignProcedure createUnassignProcedure(final HRegionInfo regionInfo,
+  public UnassignProcedure createUnassignProcedure(final RegionInfo regionInfo,
       final ServerName destinationServer, final boolean force) {
     // If destinationServer is null, figure it.
     ServerName sn = destinationServer != null? destinationServer:
@@ -707,13 +708,13 @@ public class AssignmentManager implements ServerListener {
   }
 
 
-  public SplitTableRegionProcedure createSplitProcedure(final HRegionInfo regionToSplit,
+  public SplitTableRegionProcedure createSplitProcedure(final RegionInfo regionToSplit,
       final byte[] splitKey) throws IOException {
     return new SplitTableRegionProcedure(getProcedureEnvironment(), regionToSplit, splitKey);
   }
 
-  public MergeTableRegionsProcedure createMergeProcedure(final HRegionInfo regionToMergeA,
-      final HRegionInfo regionToMergeB) throws IOException {
+  public MergeTableRegionsProcedure createMergeProcedure(final RegionInfo regionToMergeA,
+      final RegionInfo regionToMergeB) throws IOException {
     return new MergeTableRegionsProcedure(getProcedureEnvironment(), regionToMergeA,regionToMergeB);
   }
 
@@ -721,10 +722,10 @@ public class AssignmentManager implements ServerListener {
    * Delete the region states. This is called by "DeleteTable"
    */
   public void deleteTable(final TableName tableName) throws IOException {
-    final ArrayList<HRegionInfo> regions = regionStates.getTableRegionsInfo(tableName);
+    final ArrayList<RegionInfo> regions = regionStates.getTableRegionsInfo(tableName);
     regionStateStore.deleteRegions(regions);
     for (int i = 0; i < regions.size(); ++i) {
-      final HRegionInfo regionInfo = regions.get(i);
+      final RegionInfo regionInfo = regions.get(i);
       // we expect the region to be offline
       regionStates.removeFromOfflineRegions(regionInfo);
       regionStates.deleteRegion(regionInfo);
@@ -748,7 +749,7 @@ public class AssignmentManager implements ServerListener {
           case FAILED_OPEN:
           case CLOSED:
             assert transition.getRegionInfoCount() == 1 : transition;
-            final HRegionInfo hri = HRegionInfo.convert(transition.getRegionInfo(0));
+            final RegionInfo hri = ProtobufUtil.toRegionInfo(transition.getRegionInfo(0));
             updateRegionTransition(serverName, transition.getTransitionCode(), hri,
                 transition.hasOpenSeqNum() ? transition.getOpenSeqNum() : HConstants.NO_SEQNUM);
             break;
@@ -757,9 +758,9 @@ public class AssignmentManager implements ServerListener {
           case SPLIT:
           case SPLIT_REVERTED:
             assert transition.getRegionInfoCount() == 3 : transition;
-            final HRegionInfo parent = HRegionInfo.convert(transition.getRegionInfo(0));
-            final HRegionInfo splitA = HRegionInfo.convert(transition.getRegionInfo(1));
-            final HRegionInfo splitB = HRegionInfo.convert(transition.getRegionInfo(2));
+            final RegionInfo parent = ProtobufUtil.toRegionInfo(transition.getRegionInfo(0));
+            final RegionInfo splitA = ProtobufUtil.toRegionInfo(transition.getRegionInfo(1));
+            final RegionInfo splitB = ProtobufUtil.toRegionInfo(transition.getRegionInfo(2));
             updateRegionSplitTransition(serverName, transition.getTransitionCode(),
               parent, splitA, splitB);
             break;
@@ -768,9 +769,9 @@ public class AssignmentManager implements ServerListener {
           case MERGED:
           case MERGE_REVERTED:
             assert transition.getRegionInfoCount() == 3 : transition;
-            final HRegionInfo merged = HRegionInfo.convert(transition.getRegionInfo(0));
-            final HRegionInfo mergeA = HRegionInfo.convert(transition.getRegionInfo(1));
-            final HRegionInfo mergeB = HRegionInfo.convert(transition.getRegionInfo(2));
+            final RegionInfo merged = ProtobufUtil.toRegionInfo(transition.getRegionInfo(0));
+            final RegionInfo mergeA = ProtobufUtil.toRegionInfo(transition.getRegionInfo(1));
+            final RegionInfo mergeB = ProtobufUtil.toRegionInfo(transition.getRegionInfo(2));
             updateRegionMergeTransition(serverName, transition.getTransitionCode(),
               merged, mergeA, mergeB);
             break;
@@ -789,7 +790,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   private void updateRegionTransition(final ServerName serverName, final TransitionCode state,
-      final HRegionInfo regionInfo, final long seqId)
+      final RegionInfo regionInfo, final long seqId)
       throws PleaseHoldException, UnexpectedStateException {
     checkFailoverCleanupCompleted(regionInfo);
 
@@ -830,7 +831,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   private void updateRegionSplitTransition(final ServerName serverName, final TransitionCode state,
-      final HRegionInfo parent, final HRegionInfo hriA, final HRegionInfo hriB)
+      final RegionInfo parent, final RegionInfo hriA, final RegionInfo hriB)
       throws IOException {
     checkFailoverCleanupCompleted(parent);
 
@@ -863,7 +864,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   private void updateRegionMergeTransition(final ServerName serverName, final TransitionCode state,
-      final HRegionInfo merged, final HRegionInfo hriA, final HRegionInfo hriB) throws IOException {
+      final RegionInfo merged, final RegionInfo hriA, final RegionInfo hriB) throws IOException {
     checkFailoverCleanupCompleted(merged);
 
     if (state != TransitionCode.READY_TO_MERGE) {
@@ -935,7 +936,7 @@ public class AssignmentManager implements ServerListener {
       final Set<byte[]> regionNames) {
     try {
       for (byte[] regionName: regionNames) {
-        final HRegionInfo hri = getMetaRegionFromName(regionName);
+        final RegionInfo hri = getMetaRegionFromName(regionName);
         if (hri == null) {
           if (LOG.isTraceEnabled()) {
             LOG.trace("Skip online report for region=" + Bytes.toStringBinary(regionName) +
@@ -1094,12 +1095,12 @@ public class AssignmentManager implements ServerListener {
       return m != null? m.values(): Collections.EMPTY_SET;
     }
 
-    public boolean isRegionOverThreshold(final HRegionInfo regionInfo) {
+    public boolean isRegionOverThreshold(final RegionInfo regionInfo) {
       Map<String, RegionState> m = this.ritsOverThreshold;
       return m != null && m.containsKey(regionInfo.getEncodedName());
     }
 
-    public boolean isRegionTwiceOverThreshold(final HRegionInfo regionInfo) {
+    public boolean isRegionTwiceOverThreshold(final RegionInfo regionInfo) {
       Map<String, RegionState> m = this.ritsOverThreshold;
       if (m == null) return false;
       final RegionState state = m.get(regionInfo.getEncodedName());
@@ -1138,7 +1139,7 @@ public class AssignmentManager implements ServerListener {
     metrics.updateRITCountOverThreshold(ritStat.getTotalRITsOverThreshold());
   }
 
-  private void handleRegionOverStuckWarningThreshold(final HRegionInfo regionInfo) {
+  private void handleRegionOverStuckWarningThreshold(final RegionInfo regionInfo) {
     final RegionStateNode regionNode = regionStates.getRegionNode(regionInfo);
     //if (regionNode.isStuck()) {
     LOG.warn("TODO Handle stuck in transition: " + regionNode);
@@ -1176,7 +1177,7 @@ public class AssignmentManager implements ServerListener {
     // TODO: use a thread pool
     regionStateStore.visitMeta(new RegionStateStore.RegionStateVisitor() {
       @Override
-      public void visitRegionState(final HRegionInfo regionInfo, final State state,
+      public void visitRegionState(final RegionInfo regionInfo, final State state,
           final ServerName regionLocation, final ServerName lastHost, final long openSeqNum) {
         final RegionStateNode regionNode = regionStates.getOrCreateRegionNode(regionInfo);
         synchronized (regionNode) {
@@ -1211,7 +1212,7 @@ public class AssignmentManager implements ServerListener {
     boolean failover = !master.getServerManager().getDeadServers().isEmpty();
 
     final Set<ServerName> offlineServersWithOnlineRegions = new HashSet<ServerName>();
-    final ArrayList<HRegionInfo> regionsToAssign = new ArrayList<HRegionInfo>();
+    final ArrayList<RegionInfo> regionsToAssign = new ArrayList<RegionInfo>();
     long st, et;
 
     st = System.currentTimeMillis();
@@ -1246,7 +1247,7 @@ public class AssignmentManager implements ServerListener {
 
     // assign offline regions
     st = System.currentTimeMillis();
-    for (HRegionInfo regionInfo: getOrderedRegions(regionsToAssign)) {
+    for (RegionInfo regionInfo: getOrderedRegions(regionsToAssign)) {
       master.getMasterProcedureExecutor().submitProcedure(
         createAssignProcedure(regionInfo, false));
     }
@@ -1285,7 +1286,7 @@ public class AssignmentManager implements ServerListener {
    * @param hri region to check if it is already rebuild
    * @throws PleaseHoldException if the failover cleanup is not completed
    */
-  private void checkFailoverCleanupCompleted(final HRegionInfo hri) throws PleaseHoldException {
+  private void checkFailoverCleanupCompleted(final RegionInfo hri) throws PleaseHoldException {
     if (!isRunning()) {
       throw new PleaseHoldException("AssignmentManager not running");
     }
@@ -1317,18 +1318,18 @@ public class AssignmentManager implements ServerListener {
       " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta);
   }
 
-  public void offlineRegion(final HRegionInfo regionInfo) {
+  public void offlineRegion(final RegionInfo regionInfo) {
     // TODO used by MasterRpcServices ServerCrashProcedure
     final RegionStateNode node = regionStates.getRegionNode(regionInfo);
     if (node != null) node.offline();
   }
 
-  public void onlineRegion(final HRegionInfo regionInfo, final ServerName serverName) {
+  public void onlineRegion(final RegionInfo regionInfo, final ServerName serverName) {
     // TODO used by TestSplitTransactionOnCluster.java
   }
 
-  public Map<ServerName, List<HRegionInfo>> getSnapShotOfAssignment(
-      final Collection<HRegionInfo> regions) {
+  public Map<ServerName, List<RegionInfo>> getSnapShotOfAssignment(
+      final Collection<RegionInfo> regions) {
     return regionStates.getSnapShotOfAssignment(regions);
   }
 
@@ -1359,13 +1360,13 @@ public class AssignmentManager implements ServerListener {
    * @param regions
    * @return A list of regions with system regions at front
    */
-  public List<HRegionInfo> getOrderedRegions(
-      final List<HRegionInfo> regions) {
+  public List<RegionInfo> getOrderedRegions(
+      final List<RegionInfo> regions) {
     if (regions == null) return Collections.emptyList();
 
-    List<HRegionInfo> systemList = new ArrayList<>();
-    List<HRegionInfo> userList = new ArrayList<>();
-    for (HRegionInfo hri : regions) {
+    List<RegionInfo> systemList = new ArrayList<>();
+    List<RegionInfo> userList = new ArrayList<>();
+    for (RegionInfo hri : regions) {
       if (hri.isSystemTable()) systemList.add(hri);
       else userList.add(hri);
     }
@@ -1395,11 +1396,11 @@ public class AssignmentManager implements ServerListener {
     return regionStates.getRegionsInTransition();
   }
 
-  public List<HRegionInfo> getAssignedRegions() {
+  public List<RegionInfo> getAssignedRegions() {
     return regionStates.getAssignedRegions();
   }
 
-  public HRegionInfo getRegionInfo(final byte[] regionName) {
+  public RegionInfo getRegionInfo(final byte[] regionName) {
     final RegionStateNode regionState = regionStates.getRegionNodeFromName(regionName);
     return regionState != null ? regionState.getRegionInfo() : null;
   }
@@ -1407,7 +1408,7 @@ public class AssignmentManager implements ServerListener {
   // ============================================================================================
   //  TODO: Region Status update
   // ============================================================================================
-  private void sendRegionOpenedNotification(final HRegionInfo regionInfo,
+  private void sendRegionOpenedNotification(final RegionInfo regionInfo,
       final ServerName serverName) {
     getBalancer().regionOnline(regionInfo, serverName);
     if (!this.listeners.isEmpty()) {
@@ -1417,7 +1418,7 @@ public class AssignmentManager implements ServerListener {
     }
   }
 
-  private void sendRegionClosedNotification(final HRegionInfo regionInfo) {
+  private void sendRegionClosedNotification(final RegionInfo regionInfo) {
     getBalancer().regionOffline(regionInfo);
     if (!this.listeners.isEmpty()) {
       for (AssignmentListener listener : this.listeners) {
@@ -1454,7 +1455,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   public void markRegionAsOpened(final RegionStateNode regionNode) throws IOException {
-    final HRegionInfo hri = regionNode.getRegionInfo();
+    final RegionInfo hri = regionNode.getRegionInfo();
     synchronized (regionNode) {
       State state = regionNode.transitionState(State.OPEN, RegionStates.STATES_EXPECTED_ON_OPEN);
       if (isMetaRegion(hri)) {
@@ -1473,7 +1474,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   public void markRegionAsClosing(final RegionStateNode regionNode) throws IOException {
-    final HRegionInfo hri = regionNode.getRegionInfo();
+    final RegionInfo hri = regionNode.getRegionInfo();
     synchronized (regionNode) {
       State state = regionNode.transitionState(State.CLOSING, RegionStates.STATES_EXPECTED_ON_CLOSE);
       // Set meta has not initialized early. so people trying to create/edit tables will wait
@@ -1496,7 +1497,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   public void markRegionAsClosed(final RegionStateNode regionNode) throws IOException {
-    final HRegionInfo hri = regionNode.getRegionInfo();
+    final RegionInfo hri = regionNode.getRegionInfo();
     synchronized (regionNode) {
       State state = regionNode.transitionState(State.CLOSED, RegionStates.STATES_EXPECTED_ON_CLOSE);
       regionStates.removeRegionFromServer(regionNode.getRegionLocation(), regionNode);
@@ -1509,8 +1510,8 @@ public class AssignmentManager implements ServerListener {
     }
   }
 
-  public void markRegionAsSplit(final HRegionInfo parent, final ServerName serverName,
-      final HRegionInfo daughterA, final HRegionInfo daughterB)
+  public void markRegionAsSplit(final RegionInfo parent, final ServerName serverName,
+      final RegionInfo daughterA, final RegionInfo daughterB)
   throws IOException {
     // Update hbase:meta. Parent will be marked offline and split up in hbase:meta.
     // The parent stays in regionStates until cleared when removed by CatalogJanitor.
@@ -1535,8 +1536,8 @@ public class AssignmentManager implements ServerListener {
    * by the catalog janitor running against hbase:meta. It notices when the merged region no
    * longer holds references to the old regions.
    */
-  public void markRegionAsMerged(final HRegionInfo child, final ServerName serverName,
-      final HRegionInfo mother, final HRegionInfo father) throws IOException {
+  public void markRegionAsMerged(final RegionInfo child, final ServerName serverName,
+      final RegionInfo mother, final RegionInfo father) throws IOException {
     final RegionStateNode node = regionStates.getOrCreateRegionNode(child);
     node.setState(State.MERGED);
     regionStates.deleteRegion(mother);
@@ -1552,7 +1553,7 @@ public class AssignmentManager implements ServerListener {
    * Favored nodes should be applied only when FavoredNodes balancer is configured and the region
    * belongs to a non-system table.
    */
-  private boolean shouldAssignFavoredNodes(HRegionInfo region) {
+  private boolean shouldAssignFavoredNodes(RegionInfo region) {
     return this.shouldAssignRegionsWithFavoredNodes &&
         FavoredNodesManager.isFavoredNodeApplicable(region);
   }
@@ -1622,8 +1623,8 @@ public class AssignmentManager implements ServerListener {
   }
 
   @edu.umd.cs.findbugs.annotations.SuppressWarnings("WA_AWAIT_NOT_IN_LOOP")
-  private HashMap<HRegionInfo, RegionStateNode> waitOnAssignQueue() {
-    HashMap<HRegionInfo, RegionStateNode> regions = null;
+  private HashMap<RegionInfo, RegionStateNode> waitOnAssignQueue() {
+    HashMap<RegionInfo, RegionStateNode> regions = null;
 
     assignQueueLock.lock();
     try {
@@ -1633,7 +1634,7 @@ public class AssignmentManager implements ServerListener {
 
       if (!isRunning()) return null;
       assignQueueFullCond.await(assignDispatchWaitMillis, TimeUnit.MILLISECONDS);
-      regions = new HashMap<HRegionInfo, RegionStateNode>(pendingAssignQueue.size());
+      regions = new HashMap<RegionInfo, RegionStateNode>(pendingAssignQueue.size());
       for (RegionStateNode regionNode: pendingAssignQueue) {
         regions.put(regionNode.getRegionInfo(), regionNode);
       }
@@ -1648,7 +1649,7 @@ public class AssignmentManager implements ServerListener {
   }
 
   private void processAssignQueue() {
-    final HashMap<HRegionInfo, RegionStateNode> regions = waitOnAssignQueue();
+    final HashMap<RegionInfo, RegionStateNode> regions = waitOnAssignQueue();
     if (regions == null || regions.size() == 0 || !isRunning()) {
       return;
     }
@@ -1658,13 +1659,13 @@ public class AssignmentManager implements ServerListener {
     }
 
     // TODO: Optimize balancer. pass a RegionPlan?
-    final HashMap<HRegionInfo, ServerName> retainMap = new HashMap<>();
-    final List<HRegionInfo> userRRList = new ArrayList<>();
+    final HashMap<RegionInfo, ServerName> retainMap = new HashMap<>();
+    final List<RegionInfo> userRRList = new ArrayList<>();
     // regions for system tables requiring reassignment
-    final List<HRegionInfo> sysRRList = new ArrayList<>();
+    final List<RegionInfo> sysRRList = new ArrayList<>();
     for (RegionStateNode regionNode : regions.values()) {
       boolean sysTable = regionNode.isSystemTable();
-      final List<HRegionInfo> rrList = sysTable ? sysRRList : userRRList;
+      final List<RegionInfo> rrList = sysTable ? sysRRList : userRRList;
 
       if (regionNode.getRegionLocation() != null) {
         retainMap.put(regionNode.getRegionInfo(), regionNode.getRegionLocation());
@@ -1711,8 +1712,8 @@ public class AssignmentManager implements ServerListener {
     processAssignmentPlans(regions, retainMap, userRRList, servers);
   }
 
-  private void processAssignmentPlans(final HashMap<HRegionInfo, RegionStateNode> regions,
-      final HashMap<HRegionInfo, ServerName> retainMap, final List<HRegionInfo> rrList,
+  private void processAssignmentPlans(final HashMap<RegionInfo, RegionStateNode> regions,
+      final HashMap<RegionInfo, ServerName> retainMap, final List<RegionInfo> rrList,
       final List<ServerName> servers) {
     boolean isTraceEnabled = LOG.isTraceEnabled();
     if (isTraceEnabled) {
@@ -1736,7 +1737,7 @@ public class AssignmentManager implements ServerListener {
     // TODO: Do we need to split retain and round-robin?
     // the retain seems to fallback to round-robin/random if the region is not in the map.
     if (!rrList.isEmpty()) {
-      Collections.sort(rrList);
+      Collections.sort(rrList, RegionInfo.COMPARATOR);
       if (isTraceEnabled) {
         LOG.trace("round robin regions=" + rrList);
       }
@@ -1749,8 +1750,8 @@ public class AssignmentManager implements ServerListener {
     }
   }
 
-  private void acceptPlan(final HashMap<HRegionInfo, RegionStateNode> regions,
-      final Map<ServerName, List<HRegionInfo>> plan) throws HBaseIOException {
+  private void acceptPlan(final HashMap<RegionInfo, RegionStateNode> regions,
+      final Map<ServerName, List<RegionInfo>> plan) throws HBaseIOException {
     final ProcedureEvent[] events = new ProcedureEvent[regions.size()];
     final long st = System.currentTimeMillis();
 
@@ -1761,9 +1762,9 @@ public class AssignmentManager implements ServerListener {
     if (plan.isEmpty()) return;
 
     int evcount = 0;
-    for (Map.Entry<ServerName, List<HRegionInfo>> entry: plan.entrySet()) {
+    for (Map.Entry<ServerName, List<RegionInfo>> entry: plan.entrySet()) {
       final ServerName server = entry.getKey();
-      for (HRegionInfo hri: entry.getValue()) {
+      for (RegionInfo hri: entry.getValue()) {
         final RegionStateNode regionNode = regions.get(hri);
         regionNode.setRegionLocation(server);
         events[evcount++] = regionNode.getProcedureEvent();
@@ -1778,11 +1779,11 @@ public class AssignmentManager implements ServerListener {
     }
   }
 
-  private void addToPendingAssignment(final HashMap<HRegionInfo, RegionStateNode> regions,
-      final Collection<HRegionInfo> pendingRegions) {
+  private void addToPendingAssignment(final HashMap<RegionInfo, RegionStateNode> regions,
+      final Collection<RegionInfo> pendingRegions) {
     assignQueueLock.lock();
     try {
-      for (HRegionInfo hri: pendingRegions) {
+      for (RegionInfo hri: pendingRegions) {
         pendingAssignQueue.add(regions.get(hri));
       }
     } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMergedRegionsProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMergedRegionsProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMergedRegionsProcedure.java
index 6ca00da..37521cc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMergedRegionsProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMergedRegionsProcedure.java
@@ -18,17 +18,20 @@
 package org.apache.hadoop.hbase.master.assignment;
 
 import java.io.IOException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.MetaTableAccessor;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.master.procedure.AbstractStateMachineTableProcedure;
 import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
 import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer;
 import org.apache.hadoop.hbase.procedure2.ProcedureSuspendedException;
 import org.apache.hadoop.hbase.procedure2.ProcedureYieldException;
+import org.apache.yetus.audience.InterfaceAudience;
+
+import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.GCMergedRegionsState;
 
@@ -43,14 +46,14 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.G
 public class GCMergedRegionsProcedure
 extends AbstractStateMachineTableProcedure<GCMergedRegionsState> {
   private static final Log LOG = LogFactory.getLog(GCMergedRegionsProcedure.class);
-  private HRegionInfo father;
-  private HRegionInfo mother;
-  private HRegionInfo mergedChild;
+  private RegionInfo father;
+  private RegionInfo mother;
+  private RegionInfo mergedChild;
 
   public GCMergedRegionsProcedure(final MasterProcedureEnv env,
-      final HRegionInfo mergedChild,
-      final HRegionInfo father,
-      final HRegionInfo mother) {
+      final RegionInfo mergedChild,
+      final RegionInfo father,
+      final RegionInfo mother) {
     super(env);
     this.father = father;
     this.mother = mother;
@@ -100,7 +103,7 @@ extends AbstractStateMachineTableProcedure<GCMergedRegionsState> {
   private GCRegionProcedure[] createGCRegionProcedures(final MasterProcedureEnv env) {
     GCRegionProcedure [] procs = new GCRegionProcedure[2];
     int index = 0;
-    for (HRegionInfo hri: new HRegionInfo [] {this.father, this.mother}) {
+    for (RegionInfo hri: new RegionInfo [] {this.father, this.mother}) {
       GCRegionProcedure proc = new GCRegionProcedure(env, hri);
       proc.setOwner(env.getRequestUser().getShortName());
       procs[index++] = proc;
@@ -135,9 +138,9 @@ extends AbstractStateMachineTableProcedure<GCMergedRegionsState> {
     super.serializeStateData(serializer);
     final MasterProcedureProtos.GCMergedRegionsStateData.Builder msg =
         MasterProcedureProtos.GCMergedRegionsStateData.newBuilder().
-        setParentA(HRegionInfo.convert(this.father)).
-        setParentB(HRegionInfo.convert(this.mother)).
-        setMergedChild(HRegionInfo.convert(this.mergedChild));
+        setParentA(ProtobufUtil.toRegionInfo(this.father)).
+        setParentB(ProtobufUtil.toRegionInfo(this.mother)).
+        setMergedChild(ProtobufUtil.toRegionInfo(this.mergedChild));
     serializer.serialize(msg.build());
   }
 
@@ -147,9 +150,9 @@ extends AbstractStateMachineTableProcedure<GCMergedRegionsState> {
     super.deserializeStateData(serializer);
     final MasterProcedureProtos.GCMergedRegionsStateData msg =
         serializer.deserialize(MasterProcedureProtos.GCMergedRegionsStateData.class);
-    this.father = HRegionInfo.convert(msg.getParentA());
-    this.mother = HRegionInfo.convert(msg.getParentB());
-    this.mergedChild = HRegionInfo.convert(msg.getMergedChild());
+    this.father = ProtobufUtil.toRegionInfo(msg.getParentA());
+    this.mother = ProtobufUtil.toRegionInfo(msg.getParentB());
+    this.mergedChild = ProtobufUtil.toRegionInfo(msg.getMergedChild());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/a11a35a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCRegionProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCRegionProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCRegionProcedure.java
index bc3cc0f..805b870 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCRegionProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCRegionProcedure.java
@@ -18,13 +18,13 @@
 package org.apache.hadoop.hbase.master.assignment;
 
 import java.io.IOException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.MetaTableAccessor;
 import org.apache.hadoop.hbase.backup.HFileArchiver;
-import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.favored.FavoredNodesManager;
 import org.apache.hadoop.hbase.master.MasterServices;
 import org.apache.hadoop.hbase.master.procedure.AbstractStateMachineRegionProcedure;
@@ -32,10 +32,12 @@ import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
 import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer;
 import org.apache.hadoop.hbase.procedure2.ProcedureSuspendedException;
 import org.apache.hadoop.hbase.procedure2.ProcedureYieldException;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.GCRegionState;
+import org.apache.yetus.audience.InterfaceAudience;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;
+import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.GCRegionState;
 
 /**
  * GC a Region that is no longer in use. It has been split or merged away.
@@ -47,7 +49,7 @@ import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;
 public class GCRegionProcedure extends AbstractStateMachineRegionProcedure<GCRegionState> {
   private static final Log LOG = LogFactory.getLog(GCRegionProcedure.class);
 
-  public GCRegionProcedure(final MasterProcedureEnv env, final HRegionInfo hri) {
+  public GCRegionProcedure(final MasterProcedureEnv env, final RegionInfo hri) {
     super(env, hri);
   }
 
@@ -135,7 +137,7 @@ public class GCRegionProcedure extends AbstractStateMachineRegionProcedure<GCReg
     // Double serialization of regionname. Superclass is also serializing. Fix.
     final MasterProcedureProtos.GCRegionStateData.Builder msg =
         MasterProcedureProtos.GCRegionStateData.newBuilder()
-        .setRegionInfo(HRegionInfo.convert(getRegion()));
+        .setRegionInfo(ProtobufUtil.toRegionInfo(getRegion()));
     serializer.serialize(msg.build());
   }
 
@@ -145,7 +147,7 @@ public class GCRegionProcedure extends AbstractStateMachineRegionProcedure<GCReg
     super.deserializeStateData(serializer);
     final MasterProcedureProtos.GCRegionStateData msg =
         serializer.deserialize(MasterProcedureProtos.GCRegionStateData.class);
-    setRegion(HRegionInfo.convert(msg.getRegionInfo()));
+    setRegion(ProtobufUtil.toRegionInfo(msg.getRegionInfo()));
   }
 
   @Override


Mime
View raw message