hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject [2/3] hbase git commit: HBASE-12510 Make hbase-consensus independent of HRegionInfo (and other cruft removal)
Date Sat, 06 Dec 2014 20:55:29 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/main/java/org/apache/hadoop/hbase/consensus/util/RaftUtil.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/main/java/org/apache/hadoop/hbase/consensus/util/RaftUtil.java b/hbase-consensus/src/main/java/org/apache/hadoop/hbase/consensus/util/RaftUtil.java
index d73cb8e..d9e41b8 100644
--- a/hbase-consensus/src/main/java/org/apache/hadoop/hbase/consensus/util/RaftUtil.java
+++ b/hbase-consensus/src/main/java/org/apache/hadoop/hbase/consensus/util/RaftUtil.java
@@ -9,10 +9,10 @@ import com.facebook.swift.service.ThriftClientManager;
 import com.google.common.base.Joiner;
 import com.google.common.collect.ImmutableSet;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HServerAddress;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.consensus.quorum.AggregateTimer;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RepeatingTimer;
 import org.apache.hadoop.hbase.consensus.quorum.TimeoutEventHandler;
 import org.apache.hadoop.hbase.consensus.quorum.Timer;
@@ -51,19 +51,15 @@ public class RaftUtil {
     }
   }
 
-  public static HRegionInfo createDummyRegionInfo(String region) {
-    return createDummyRegionInfo(region, null);
+  public static QuorumInfo createDummyQuorumInfo(String region) {
+    return createDummyQuorumInfo(region, null);
   }
 
-  public static HRegionInfo createDummyRegionInfo(String region, Map<HServerAddress,
+  public static QuorumInfo createDummyQuorumInfo(String region, Map<HServerAddress,
     Integer> peers) {
-    HRegionInfo regionInfo = new HRegionInfo(new HTableDescriptor(region),
-        Bytes.toBytes("00000000"), Bytes.toBytes("ffffffff"), false, 1000,
-        null, null);
     Map<String, Map<HServerAddress, Integer>> peerMap = new HashMap<>();
-    peerMap.put(HRegionInfo.LOCAL_DC_KEY, peers);
-    regionInfo.setPeers(peerMap);
-    return regionInfo;
+    peerMap.put(QuorumInfo.LOCAL_DC_KEY, peers);
+    return new QuorumInfo(peerMap, region);
   }
 
   public static <T> String listToString(List<T> list) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractWAL.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractWAL.java b/hbase-consensus/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractWAL.java
index 2ae84d1..ea5b5c9 100644
--- a/hbase-consensus/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractWAL.java
+++ b/hbase-consensus/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractWAL.java
@@ -1,6 +1,5 @@
 package org.apache.hadoop.hbase.regionserver.wal;
 
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.regionserver.metrics.PercentileMetric;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Histogram;
@@ -30,10 +29,11 @@ public abstract class AbstractWAL {
     PercentileMetric.HISTOGRAM_MINVALUE_DEFAULT,
     PercentileMetric.HISTOGRAM_MAXVALUE_DEFAULT);
 
+  /*
   public abstract long append(HRegionInfo info, byte [] tableName, WALEdit edits,
                      final long now)
     throws IOException, ExecutionException, InterruptedException;
-
+  */
   public abstract long startMemStoreFlush(final byte[] regionName);
   public abstract void completeMemStoreFlush(final byte[] regionName, final byte[] tableName,
                                     final long logSeqId, final boolean isMetaRegion);

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/LocalTestBed.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/LocalTestBed.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/LocalTestBed.java
index 9f7a7c3..25b879d 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/LocalTestBed.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/LocalTestBed.java
@@ -2,12 +2,12 @@ package org.apache.hadoop.hbase.consensus;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HServerAddress;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.consensus.exceptions.LeaderNotReadyException;
 import org.apache.hadoop.hbase.consensus.exceptions.NewLeaderException;
 import org.apache.hadoop.hbase.consensus.quorum.QuorumAgent;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.InstrumentedConsensusServiceImpl;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
@@ -37,7 +37,7 @@ public class LocalTestBed {
   private static int nextPortNumber;
 
   private Configuration conf;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private final List<int[]> mockLogs;
   private boolean checkLeaderCount = false;
@@ -53,14 +53,14 @@ public class LocalTestBed {
   public final long BigBang = System.currentTimeMillis();
 
   public static class HealthChecker extends Thread {
-    private HRegionInfo   regionInfo;
+    private QuorumInfo   quorumInfo;
     private RaftTestUtil  testUtil;
     private boolean       autoRestartThriftServer;
     private long          checkInterval;
     private AtomicBoolean time2die = new AtomicBoolean(false);
 
-    public HealthChecker(HRegionInfo regionInfo, RaftTestUtil testUtil, boolean autoRestartThriftServer, long checkInterval) {
-      this.regionInfo = regionInfo;
+    public HealthChecker(QuorumInfo quorumInfo, RaftTestUtil testUtil, boolean autoRestartThriftServer, long checkInterval) {
+      this.quorumInfo = quorumInfo;
       this.testUtil = testUtil;
       this.autoRestartThriftServer = autoRestartThriftServer;
       this.checkInterval = checkInterval;
@@ -74,7 +74,7 @@ public class LocalTestBed {
           long now = System.currentTimeMillis();
           if (now >= previousCheckTime + checkInterval) {
             LOG.info("checking the health of all quorum members ......");
-            testUtil.checkHealth(regionInfo, autoRestartThriftServer);
+            testUtil.checkHealth(quorumInfo, autoRestartThriftServer);
             previousCheckTime = now = System.currentTimeMillis();
           }
           long sleepTime = previousCheckTime + checkInterval - now;
@@ -219,9 +219,9 @@ public class LocalTestBed {
       Set<LinkState> currentHiccups = new HashSet<LinkState>();
       Set<LinkState> allHiccups = new HashSet<LinkState>(); // include future hiccups
       Set<LinkState> nohiccups = new HashSet<LinkState>();
-      for (HServerAddress dst : regionInfo.getPeersWithRank().keySet()) {
+      for (HServerAddress dst : quorumInfo.getPeersWithRank().keySet()) {
         dst = RaftUtil.getLocalConsensusAddress(dst);
-        for (HServerAddress src : regionInfo.getPeersWithRank().keySet()) {
+        for (HServerAddress src : quorumInfo.getPeersWithRank().keySet()) {
           src = RaftUtil.getLocalConsensusAddress(src);
           if (src.equals(dst)) {
             continue;
@@ -273,11 +273,11 @@ public class LocalTestBed {
         }
       }
 
-      for (HServerAddress dst : regionInfo.getPeersWithRank().keySet()) {
+      for (HServerAddress dst : quorumInfo.getPeersWithRank().keySet()) {
         dst = RaftUtil.getLocalConsensusAddress(dst);
         InstrumentedConsensusServiceImpl service = (InstrumentedConsensusServiceImpl)
           (servers.get(dst.getHostAddressWithPort()).getHandler());
-        for (HServerAddress src : regionInfo.getPeersWithRank().keySet()) {
+        for (HServerAddress src : quorumInfo.getPeersWithRank().keySet()) {
           src = RaftUtil.getLocalConsensusAddress(src);
           if (!src.equals(dst) && !clear) {
             long delay = (long)(prng.nextDouble()*(maxRandomDelay-minRandomDelay) + minRandomDelay);
@@ -698,7 +698,7 @@ public class LocalTestBed {
       LOG.info("Clearing network states ......");
       adversary.getChaos().updateNetworkStates(System.currentTimeMillis(), true);
       LOG.info("-------- Verifying log consistency amongst all quorum members");
-      while (!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE, true)) {
+      while (!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE, true)) {
         testbed.dumpStates();
         if (testbed.checkLeaderCount()) {
           Assert.assertTrue(testbed.getLeaderCount() < 2);
@@ -732,10 +732,10 @@ public class LocalTestBed {
     RAFT_TEST_UTIL.setUsePeristentLog(usePersistentLog);
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, mockLogs);
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    checker = new HealthChecker(regionInfo, RAFT_TEST_UTIL, autoRestartThriftServer, 30000L);
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, mockLogs);
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    checker = new HealthChecker(quorumInfo, RAFT_TEST_UTIL, autoRestartThriftServer, 30000L);
     checker.start();
   }
 
@@ -766,7 +766,7 @@ public class LocalTestBed {
   }
 
   public void dumpStates() {
-    RAFT_TEST_UTIL.dumpStates(regionInfo);
+    RAFT_TEST_UTIL.dumpStates(quorumInfo);
     LOG.info("Total Commit = " + commitSuccessCount.get()+ " successes and " + commitFailureCount.get() + " failures "
         + " with " + getPacketDropCount()  + "(" + getHiccupPacketDropCount() + ") total-dropped (hiccup) packets "
         + " and " + RAFT_TEST_UTIL.getServerRestartCount() + " server restarts "
@@ -801,11 +801,11 @@ public class LocalTestBed {
         }
         agent.syncAppend(edit);
         // Verify all the logs across the majority are the same
-        RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_MAJORITY, false);
+        RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_MAJORITY, false);
         return true;
       } catch (NewLeaderException e) {
         LOG.warn("Got a new leader in the quorum: " + e.getNewLeaderAddress());
-        RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_MAJORITY, false);
+        RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_MAJORITY, false);
       } catch (Exception e) {
         Throwable cause = e;
         while (cause != null) {
@@ -838,7 +838,7 @@ public class LocalTestBed {
     do {
       int leaderCnt = 0;
       for (LocalConsensusServer server : RAFT_TEST_UTIL.getServers().values()) {
-        RaftQuorumContext c = server.getHandler().getRaftQuorumContext(regionInfo.getEncodedName());
+        RaftQuorumContext c = server.getHandler().getRaftQuorumContext(quorumInfo.getQuorumName());
         if (c != null && c.isLeader()) {
           leaderQuorum = c;
           leaderCnt++;
@@ -854,7 +854,7 @@ public class LocalTestBed {
   public int getLeaderCount() {
     int leaderCnt = 0;
     for (LocalConsensusServer server : RAFT_TEST_UTIL.getServers().values()) {
-      RaftQuorumContext c = server.getHandler().getRaftQuorumContext(regionInfo.getEncodedName());
+      RaftQuorumContext c = server.getHandler().getRaftQuorumContext(quorumInfo.getQuorumName());
       if (c != null && c.isLeader()) {
         leaderCnt++;
       }
@@ -862,8 +862,6 @@ public class LocalTestBed {
     return leaderCnt;
   }
 
-
-
   public static void noThrowSleep(long ms) {
     try {
       Thread.sleep(ms);
@@ -916,11 +914,11 @@ public class LocalTestBed {
   }
 
   public long getPacketDropCount() {
-    return RAFT_TEST_UTIL.getPacketDropCount(regionInfo);
+    return RAFT_TEST_UTIL.getPacketDropCount(quorumInfo);
   }
 
   public long getHiccupPacketDropCount() {
-    return RAFT_TEST_UTIL.getHiccupPacketDropCount(regionInfo);
+    return RAFT_TEST_UTIL.getHiccupPacketDropCount(quorumInfo);
   }
 
   // shoplifted from http://preshing.com/20111007/how-to-generate-random-timings-for-a-poisson-process/

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/RaftTestUtil.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/RaftTestUtil.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/RaftTestUtil.java
index d259308..a58afdd 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/RaftTestUtil.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/RaftTestUtil.java
@@ -7,7 +7,6 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HServerAddress;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.KeyValue;
@@ -181,9 +180,10 @@ public class RaftTestUtil {
 
   /**
    * Creates a new quorum from the given quorum info object.
-   * @param regionInfo
+   * @param quorumInfo The quorum info.
+   * @param mockLogs Mock logs for the quorum members.
    */
-  public void addQuorum(final HRegionInfo regionInfo, List<int[]> mockLogs)
+  public void addQuorum(final QuorumInfo quorumInfo, List<int[]> mockLogs)
           throws IOException {
     int i = 0;
     int[] mockLog;
@@ -192,7 +192,7 @@ public class RaftTestUtil {
       if (mockLogs != null) {
         mockLog = mockLogs.get(i++);
       }
-      addQuorumForServer(server, regionInfo.getQuorumInfo(), mockLog);
+      addQuorumForServer(server, quorumInfo, mockLog);
     }
   }
 
@@ -236,12 +236,12 @@ public class RaftTestUtil {
     return serverRestartCount.get();
   }
 
-  public void checkHealth(HRegionInfo regionInfo, boolean reset) {
+  public void checkHealth(QuorumInfo quorumInfo, boolean reset) {
     for (LocalConsensusServer server : servers.values()) {
       boolean healthy = false;
       LOG.info("Checking the health of ThriftServer for " + server + " ......");
       try {
-        healthy = checkHealth(regionInfo, server);
+        healthy = checkHealth(quorumInfo, server);
       } catch (Exception ex) {
         LOG.error("Failed to check the status for " + server, ex);
       }
@@ -258,7 +258,7 @@ public class RaftTestUtil {
     }
   }
 
-  public boolean checkHealth(HRegionInfo regionInfo, LocalConsensusServer server) throws Exception {
+  public boolean checkHealth(QuorumInfo quorumInfo, LocalConsensusServer server) throws Exception {
     HServerAddress consensusServerAddress = new HServerAddress(LOCAL_HOST,
       server.getThriftServer().getPort());
     int timeout = 5000;
@@ -266,13 +266,13 @@ public class RaftTestUtil {
     QuorumThriftClientAgent agent = new QuorumThriftClientAgent(
         consensusServerAddress.toString(), timeout, timeout, timeout, 3);
     LOG.info("QuorumThriftClientAgent for " + consensusServerAddress + " = " + agent);
-    PeerStatus status = agent.getPeerStatus(regionInfo.getEncodedName());
+    PeerStatus status = agent.getPeerStatus(quorumInfo.getQuorumName());
     LOG.info("PeerStatus for " + consensusServerAddress + ": " + status);
     return status != null;
   }
 
   public RaftQuorumContext restartLocalConsensusServer(LocalConsensusServer server,
-                                                       final HRegionInfo regionInfo,
+                                                       final QuorumInfo quorumInfo,
                                                        final String contextAddress)
 
     throws IOException {
@@ -291,8 +291,8 @@ public class RaftTestUtil {
     conf.setInt(
       HConstants.RAFT_LOG_DELETION_INTERVAL_KEY,
       100);
-    RaftQuorumContext context = createRaftQuorumContext(
-            regionInfo.getQuorumInfo(), conf, consensusServerAddress, server);
+    RaftQuorumContext context = createRaftQuorumContext(quorumInfo, conf,
+      consensusServerAddress, server);
     context.initializeLog();
     context.reseedStartIndex(seedIndex);
     context.startStateMachines();
@@ -300,11 +300,11 @@ public class RaftTestUtil {
     return context;
   }
 
-  public void startQuorum(final HRegionInfo regionInfo)
+  public void startQuorum(final QuorumInfo quorumInfo)
     throws IOException {
     for (LocalConsensusServer server : servers.values()) {
       RaftQuorumContext context =
-        server.getHandler().getRaftQuorumContext(regionInfo.getEncodedName());
+        server.getHandler().getRaftQuorumContext(quorumInfo.getQuorumName());
       context.initializeLog();
       context.reseedStartIndex(seedIndex);
       context.startStateMachines();
@@ -436,13 +436,13 @@ public class RaftTestUtil {
     }
   }
 
-  public void dumpStates(final HRegionInfo info) {
+  public void dumpStates(final QuorumInfo info) {
     LOG.info("---- logs for region " + info + ":");
     List<String> logs = new ArrayList<String>();
     List<Integer> ports = new ArrayList<Integer>();
     for (LocalConsensusServer server : servers.values()) {
       final CommitLogManagerInterface log =
-        server.getHandler().getRaftQuorumContext(info.getEncodedName()).getLogManager();
+        server.getHandler().getRaftQuorumContext(info.getQuorumName()).getLogManager();
       logs.add(log.dumpLogs(-1));
       ports.add(server.getThriftServer().getPort());
     }
@@ -530,7 +530,7 @@ public class RaftTestUtil {
     }
   }
 
-  public HRegionInfo initializePeers() {
+  public QuorumInfo initializePeers() {
     Map<HServerAddress, Integer> peers = new HashMap<>();
     int rank = servers.size();
     for (LocalConsensusServer server : servers.values()) {
@@ -545,19 +545,17 @@ public class RaftTestUtil {
     HColumnDescriptor hcd = new HColumnDescriptor(FAMILY).setMaxVersions(Integer.MAX_VALUE);
     table.addFamily(hcd);
 
-    HRegionInfo regionInfo = new HRegionInfo(table, Bytes.toBytes("00000000"),
-      Bytes.toBytes("ffffffff"));
     Map<String, Map<HServerAddress, Integer>> peerMap = new HashMap<>();
-    peerMap.put(HRegionInfo.LOCAL_DC_KEY, peers);
-    regionInfo.setPeers(peerMap);
+    peerMap.put(QuorumInfo.LOCAL_DC_KEY, peers);
 
-    return regionInfo;
+    String quorumName = "dummyTable,123,deadbeef.";
+    return new QuorumInfo(peerMap, quorumName);
   }
 
-  public HRegionInfo resetPeers(HRegionInfo regionInfo, List<int[]> logs) throws Exception {
+  public QuorumInfo resetPeers(QuorumInfo quorumInfo, List<int[]> logs) throws Exception {
 
-    addQuorum(regionInfo, logs);
-    return regionInfo;
+    addQuorum(quorumInfo, logs);
+    return quorumInfo;
   }
 
   public void setSeedIndex(long seedIndex) {
@@ -623,12 +621,12 @@ public class RaftTestUtil {
     return 1;
   }
 
-  public boolean simulatePacketDropForServer(final HRegionInfo regionInfo, int rank,
+  public boolean simulatePacketDropForServer(final QuorumInfo quorumInfo, int rank,
                                              final InstrumentedConsensusServiceImpl.PacketDropStyle style) {
     HServerAddress server = null;
 
-    for (HServerAddress s : regionInfo.getPeersWithRank().keySet()) {
-      if (regionInfo.getPeersWithRank().get(s) == rank) {
+    for (HServerAddress s : quorumInfo.getPeersWithRank().keySet()) {
+      if (quorumInfo.getPeersWithRank().get(s) == rank) {
         server = s;
         break;
       }
@@ -645,9 +643,9 @@ public class RaftTestUtil {
     return true;
   }
 
-  public long getHiccupPacketDropCount(final HRegionInfo regionInfo) {
+  public long getHiccupPacketDropCount(final QuorumInfo quorumInfo) {
     long count = 0;
-    for (HServerAddress server : regionInfo.getPeersWithRank().keySet()) {
+    for (HServerAddress server : quorumInfo.getPeersWithRank().keySet()) {
       InstrumentedConsensusServiceImpl service = (InstrumentedConsensusServiceImpl)
               (servers.get(RaftUtil.getLocalConsensusAddress(server).getHostAddressWithPort()).getHandler());
       count += service.getHiccupPacketDropCount();
@@ -655,9 +653,9 @@ public class RaftTestUtil {
     return count;
   }
 
-  public long getPacketDropCount(final HRegionInfo regionInfo) {
+  public long getPacketDropCount(final QuorumInfo quorumInfo) {
     long count = 0;
-    for (HServerAddress server : regionInfo.getPeersWithRank().keySet()) {
+    for (HServerAddress server : quorumInfo.getPeersWithRank().keySet()) {
       InstrumentedConsensusServiceImpl service = (InstrumentedConsensusServiceImpl)
               (servers.get(RaftUtil.getLocalConsensusAddress(server).getHostAddressWithPort()).getHandler());
       count += service.getPacketDropCount();
@@ -669,28 +667,28 @@ public class RaftTestUtil {
     this.usePersistentLog = usePersistentLog;
   }
 
-  public RaftQuorumContext getRaftQuorumContextByAddress(HRegionInfo regionInfo,
+  public RaftQuorumContext getRaftQuorumContextByAddress(QuorumInfo quorumInfo,
     String address) {
     return getServers().get(address).getHandler()
-      .getRaftQuorumContext(regionInfo.getEncodedName());
+      .getRaftQuorumContext(quorumInfo.getQuorumName());
   }
 
-  public RaftQuorumContext getRaftQuorumContextByRank(HRegionInfo regionInfo, int rank) {
+  public RaftQuorumContext getRaftQuorumContextByRank(QuorumInfo quorumInfo, int rank) {
     String peerAddress = null;
-    for (HServerAddress addr : regionInfo.getPeersWithRank().keySet()) {
-      if (regionInfo.getPeersWithRank().get(addr) == rank) {
+    for (HServerAddress addr : quorumInfo.getPeersWithRank().keySet()) {
+      if (quorumInfo.getPeersWithRank().get(addr) == rank) {
         peerAddress = RaftUtil.getLocalConsensusAddress(addr).getHostAddressWithPort();
       }
     }
 
     return getServers().get(peerAddress).getHandler().
-      getRaftQuorumContext(regionInfo.getEncodedName());
+      getRaftQuorumContext(quorumInfo.getQuorumName());
   }
 
-  public LocalConsensusServer stopLocalConsensusServer(HRegionInfo regionInfo, int rank) {
+  public LocalConsensusServer stopLocalConsensusServer(QuorumInfo quorumInfo, int rank) {
     String peerAddress = null;
-    for (HServerAddress addr : regionInfo.getPeersWithRank().keySet()) {
-      if (regionInfo.getPeersWithRank().get(addr) == rank) {
+    for (HServerAddress addr : quorumInfo.getPeersWithRank().keySet()) {
+      if (quorumInfo.getPeersWithRank().get(addr) == rank) {
         peerAddress = RaftUtil.getLocalConsensusAddress(addr).getHostAddressWithPort();
       }
     }
@@ -705,19 +703,19 @@ public class RaftTestUtil {
     return server;
   }
 
-  public void printStatusOfQuorum(HRegionInfo regionInfo) {
+  public void printStatusOfQuorum(QuorumInfo quorumInfo) {
     System.out.println(" ======= Status Update =========");
     for (LocalConsensusServer server : getServers().values()) {
       RaftQuorumContext context =
-        server.getHandler().getRaftQuorumContext(regionInfo.getEncodedName());
+        server.getHandler().getRaftQuorumContext(quorumInfo.getQuorumName());
       System.out.println(context + " ; " + context.getPaxosState() + " ; " + context.getLogState());
     }
     System.out.println(" ================");
   }
 
   public List<RaftQuorumContext> getQuorumContexts(
-    final HRegionInfo regionInfo) {
-      Set<HServerAddress> replias = regionInfo.getPeersWithRank().keySet();
+    final QuorumInfo quorumInfo) {
+      Set<HServerAddress> replias = quorumInfo.getPeersWithRank().keySet();
       List<RaftQuorumContext> contexts = new ArrayList<>(replias.size());
 
       for (HServerAddress address : replias) {
@@ -725,16 +723,16 @@ public class RaftTestUtil {
                 RaftUtil.getLocalConsensusAddress(address).
                         getHostAddressWithPort();
         if (getServers().containsKey(consensusServerAddress)) {
-          contexts.add(getRaftQuorumContextByAddress(regionInfo,
+          contexts.add(getRaftQuorumContextByAddress(quorumInfo,
                   consensusServerAddress));
         }
       }
       return contexts;
     }
 
-  public RaftQuorumContext getLeaderQuorumContext(HRegionInfo regionInfo) {
+  public RaftQuorumContext getLeaderQuorumContext(QuorumInfo quorumInfo) {
     RaftQuorumContext leader = null;
-    for (RaftQuorumContext context : getQuorumContexts(regionInfo)) {
+    for (RaftQuorumContext context : getQuorumContexts(quorumInfo)) {
       if (context.isLeader()) {
         leader = context;
       }
@@ -742,9 +740,9 @@ public class RaftTestUtil {
     return leader;
   }
 
-  public void waitForLeader(final HRegionInfo regionInfo)
+  public void waitForLeader(final QuorumInfo quorumInfo)
           throws InterruptedException {
-    while (getLeaderQuorumContext(regionInfo) == null) {
+    while (getLeaderQuorumContext(quorumInfo) == null) {
       Thread.sleep(500);
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/ReplicationLoadForUnitTest.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/ReplicationLoadForUnitTest.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/ReplicationLoadForUnitTest.java
index e4cf944..4257c0d 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/ReplicationLoadForUnitTest.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/ReplicationLoadForUnitTest.java
@@ -1,7 +1,7 @@
 package org.apache.hadoop.hbase.consensus;
 
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
@@ -14,16 +14,16 @@ public class ReplicationLoadForUnitTest {
   private volatile boolean stop = false;
 
   private RaftTestUtil util;
-  private HRegionInfo regionInfo;
+  private QuorumInfo quorumInfo;
   private QuorumClient client;
   private int quorumSize = 5;
   private int majoritySize = 3;
 
   private volatile long sleepTime = 50;
 
-  public ReplicationLoadForUnitTest(HRegionInfo regionInfo, QuorumClient client,
+  public ReplicationLoadForUnitTest(QuorumInfo quorumInfo, QuorumClient client,
                                     RaftTestUtil util, int quorumSize, int majoritySize) {
-    this.regionInfo = regionInfo;
+    this.quorumInfo = quorumInfo;
     this.client = client;
     this.util = util;
     this.quorumSize = quorumSize;
@@ -34,11 +34,11 @@ public class ReplicationLoadForUnitTest {
   public int makeProgress(long sleepTime, int prevLoad) throws InterruptedException {
     System.out.println("Let the client load fly for " + sleepTime + " ms");
     Thread.sleep(sleepTime);
-    util.printStatusOfQuorum(regionInfo);
+    util.printStatusOfQuorum(quorumInfo);
 
     while (transactionNums <= prevLoad) {
       System.out.println("No Progress ! prev " + prevLoad + " current " + transactionNums);
-      util.printStatusOfQuorum(regionInfo);
+      util.printStatusOfQuorum(quorumInfo);
       Thread.sleep(sleepTime);
     }
 
@@ -59,7 +59,7 @@ public class ReplicationLoadForUnitTest {
               client.replicateCommits(RaftTestUtil.generateTransaction(1 * 1024));
               if ((++transactionNums) % progressInterval == 0) {
                 System.out.println("Sent " + transactionNums + " transactions to the quorum");
-                util.printStatusOfQuorum(regionInfo);
+                util.printStatusOfQuorum(quorumInfo);
               }
 
             } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicCommit.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicCommit.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicCommit.java
index b54c2a6..96e9129 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicCommit.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicCommit.java
@@ -1,23 +1,21 @@
 package org.apache.hadoop.hbase.consensus;
 
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 
 public class TestBasicCommit {
   private static int QUORUM_SIZE = 3;
   private static int QUORUM_MAJORITY = 2;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private static QuorumClient client;
   private static volatile int transactionNum = 0;
@@ -31,12 +29,12 @@ public class TestBasicCommit {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
     transactionNum = 0;
-    loader = new ReplicationLoadForUnitTest(regionInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
+    loader = new ReplicationLoadForUnitTest(quorumInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
       QUORUM_MAJORITY);
   }
 
@@ -59,17 +57,17 @@ public class TestBasicCommit {
     transactionNum = loader.makeProgress(sleepTime, transactionNum);
 
     // Get all the quorum contexts from rank 3 to rank 1
-    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 3);
-    RaftQuorumContext c2 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 2);
-    RaftQuorumContext c1 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 1);
+    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 3);
+    RaftQuorumContext c2 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 2);
+    RaftQuorumContext c1 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 1);
 
     // Shutdown 1st quorum member whose rank is 1.
     System.out.println("Stopping one quorum member: " + c1);
-    LocalConsensusServer s1 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 1);
+    LocalConsensusServer s1 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 1);
 
     // Shutdown 2nd quorum member whose rank 2
     System.out.println("Stopping another quorum member: " + c2);
-    LocalConsensusServer s2 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 2);
+    LocalConsensusServer s2 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 2);
 
     // Sleep for some time to make sure the leader is stuck in retry
 
@@ -77,18 +75,18 @@ public class TestBasicCommit {
 
     // Shutdown 3rd quorum member whose rank 3
     System.out.println("Stopping another quorum member: " + c3);
-    LocalConsensusServer s3 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 3);
+    LocalConsensusServer s3 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 3);
 
     // Restart 3
-    c3 = RAFT_TEST_UTIL.restartLocalConsensusServer(s3, regionInfo, c3.getMyAddress());
+    c3 = RAFT_TEST_UTIL.restartLocalConsensusServer(s3, quorumInfo, c3.getMyAddress());
     System.out.println("Restarted one quorum member: " + c3);
 
     // Restart 2
-    c2 = RAFT_TEST_UTIL.restartLocalConsensusServer(s2, regionInfo, c2.getMyAddress());
+    c2 = RAFT_TEST_UTIL.restartLocalConsensusServer(s2, quorumInfo, c2.getMyAddress());
     System.out.println("Restarted one quorum member: " + c2);
 
     // Restart 1
-    c1 = RAFT_TEST_UTIL.restartLocalConsensusServer(s1, regionInfo, c1.getMyAddress());
+    c1 = RAFT_TEST_UTIL.restartLocalConsensusServer(s1, quorumInfo, c1.getMyAddress());
     System.out.println("Restarted one quorum member: " + c1);
 
     // Let the traffic fly for a while
@@ -106,7 +104,7 @@ public class TestBasicCommit {
     loader.slowDownReplicationLoad();
 
     // Verify logs are identical across all the quorum members
-    while (!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE)) {
+    while (!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE)) {
       Thread.sleep(10 * 1000);
       System.out.println("Verifying logs ....");
       Assert.assertTrue("Rank 3 shall be the leader of the quorum", c3.isLeader());

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicLeaderElection.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicLeaderElection.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicLeaderElection.java
index de31eea..352c4f2 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicLeaderElection.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicLeaderElection.java
@@ -1,7 +1,7 @@
 package org.apache.hadoop.hbase.consensus;
 
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
 import org.junit.After;
@@ -19,7 +19,7 @@ import static junit.framework.Assert.assertEquals;
 public class TestBasicLeaderElection {
 
   private static int QUORUM_SIZE = 5;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private final List<int[]> mockLogs;
 
@@ -28,9 +28,9 @@ public class TestBasicLeaderElection {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, mockLogs);
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, mockLogs);
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
   }
 
   @After
@@ -62,13 +62,14 @@ public class TestBasicLeaderElection {
       } catch (InterruptedException e) {}
 
       for (LocalConsensusServer server : RAFT_TEST_UTIL.getServers().values()) {
-        RaftQuorumContext c = server.getHandler().getRaftQuorumContext(regionInfo.getEncodedName());
+        RaftQuorumContext c = server.getHandler().getRaftQuorumContext(
+          quorumInfo.getQuorumName());
         if (c.isLeader()) {
           leaderCnt++;
         }
       }
     }
-    while(!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE) && leaderCnt != 1);
+    while(!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE) && leaderCnt != 1);
     assertEquals("There should be only one leader", 1, leaderCnt);
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerFailure.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerFailure.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerFailure.java
index ceab1f5..30658d1 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerFailure.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerFailure.java
@@ -1,8 +1,8 @@
 package org.apache.hadoop.hbase.consensus;
 
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
 import org.junit.After;
@@ -19,7 +19,7 @@ public class TestBasicPeerFailure {
           TestBasicPeerFailure.class);
   private static int QUORUM_SIZE = 5;
   private static int QUORUM_MAJORITY = 3;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private static QuorumClient client;
   private static volatile int transactionNum = 0;
@@ -31,12 +31,12 @@ public class TestBasicPeerFailure {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
     transactionNum = 0;
-    loader = new ReplicationLoadForUnitTest(regionInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
+    loader = new ReplicationLoadForUnitTest(quorumInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
       QUORUM_MAJORITY);
   }
 
@@ -61,7 +61,7 @@ public class TestBasicPeerFailure {
   public void testStepDownOnNoProgress() throws InterruptedException {
     final long sleepTime =
             2 * HConstants.PROGRESS_TIMEOUT_INTERVAL_IN_MILLISECONDS;
-    RaftQuorumContext c5 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 5);
+    RaftQuorumContext c5 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 5);
 
     // Start the client load
     loader.startReplicationLoad(100);
@@ -73,7 +73,7 @@ public class TestBasicPeerFailure {
     // Stop the majority of replicas
     for (int i = 0; i < QUORUM_MAJORITY; i++) {
       System.out.println("Stopping replica with rank " + (i + 1));
-      RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, i + 1);
+      RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, i + 1);
     }
 
     Thread.sleep(2 * HConstants.PROGRESS_TIMEOUT_INTERVAL_IN_MILLISECONDS);
@@ -99,13 +99,13 @@ public class TestBasicPeerFailure {
     transactionNum = loader.makeProgress(sleepTime, transactionNum);
 
     // Get all the quorum contexts from rank 5 to rank 3
-    RaftQuorumContext c5 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 5);
-    RaftQuorumContext c4 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 4);
-    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 3);
+    RaftQuorumContext c5 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 5);
+    RaftQuorumContext c4 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 4);
+    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 3);
 
     // Shutdown 1st quorum member whose rank is 5.
     System.out.println("Stopping one quorum member: " + c5);
-    LocalConsensusServer s5 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 5);
+    LocalConsensusServer s5 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 5);
 
     // Let the traffic fly for a while
     if ((++failureCnt % failureInterval) == 0) {
@@ -115,7 +115,7 @@ public class TestBasicPeerFailure {
 
     // Shutdown 2nd quorum member whose rank 4
     System.out.println("Stopping another quorum member: " + c4);
-    LocalConsensusServer s4 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 4);
+    LocalConsensusServer s4 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 4);
 
     // Let the traffic fly for a while
     if ((++failureCnt % failureInterval) == 0) {
@@ -124,7 +124,7 @@ public class TestBasicPeerFailure {
     }
 
     // Restart the quorum member whose rank is 4
-    c4 = RAFT_TEST_UTIL.restartLocalConsensusServer(s4, regionInfo, c4.getMyAddress());
+    c4 = RAFT_TEST_UTIL.restartLocalConsensusServer(s4, quorumInfo, c4.getMyAddress());
     System.out.println("Restarted one quorum member: " + c4);
 
     // Let the traffic fly for a while
@@ -139,7 +139,7 @@ public class TestBasicPeerFailure {
       transactionNum = loader.makeProgress(sleepTime, transactionNum);
     }
     // Restart the quorum member whose rank is 5
-    c5 = RAFT_TEST_UTIL.restartLocalConsensusServer(s5, regionInfo, c5.getMyAddress());
+    c5 = RAFT_TEST_UTIL.restartLocalConsensusServer(s5, quorumInfo, c5.getMyAddress());
     System.out.println("Restarted another quorum member: " + c5);
 
     // Let the traffic fly for a while
@@ -156,7 +156,7 @@ public class TestBasicPeerFailure {
     loader.slowDownReplicationLoad();
 
     // Verify logs are identical across all the quorum members
-    while (!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE)) {
+    while (!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE)) {
       Thread.sleep(10 * 1000);
       System.out.println("Verifying logs ....");
       Assert.assertTrue("Rank 5 shall be the leader of the quorum", c5.isLeader());

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSeeding.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSeeding.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSeeding.java
index 02dc112..b2080f3 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSeeding.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSeeding.java
@@ -7,9 +7,9 @@ import java.util.Collection;
 import java.util.List;
 
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.After;
@@ -28,7 +28,7 @@ public class TestBasicPeerSeeding {
 
   private static final int QUORUM_SIZE = 5;
   private static final int QUORUM_MAJORITY = 3;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private final List<int[]> mockLogs;
   private final long seedIndex = 4;
@@ -39,11 +39,11 @@ public class TestBasicPeerSeeding {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.assertAllServersRunning();
     RAFT_TEST_UTIL.setUsePeristentLog(true);
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, mockLogs);
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, mockLogs);
     RAFT_TEST_UTIL.setSeedIndex(seedIndex);
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
   }
 
   @After
@@ -67,8 +67,8 @@ public class TestBasicPeerSeeding {
       LOG.info("Passed the " + i + " commit !");
     }
     // Verify all the logs across the quorum are the same
-    while(!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE)) {
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+    while(!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE)) {
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
       try {
         // Sleep for MAX_TIMEOUT time for leader election to complete
         Thread.sleep(HConstants.QUORUM_CLIENT_COMMIT_DEADLINE_DEFAULT);
@@ -82,11 +82,11 @@ public class TestBasicPeerSeeding {
   private void testSingleCommit() {
 
     try {
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
       client.replicateCommits(Arrays.asList(generateTestingWALEdit()));
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
       // Verify all the logs across the majority are the same
-      RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_MAJORITY);
+      RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_MAJORITY);
     } catch (Exception e) {
       LOG.error("Errors: ", e);
       fail("Unexpected exception: e");

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSlow.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSlow.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSlow.java
index 138c674..7851078 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSlow.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicPeerSlow.java
@@ -1,8 +1,8 @@
 package org.apache.hadoop.hbase.consensus;
 
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.InstrumentedConsensusServiceImpl;
 import org.junit.After;
@@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit;
 public class TestBasicPeerSlow {
   private static int QUORUM_SIZE = 5;
   private static int QUORUM_MAJORITY = 3;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private static QuorumClient client;
   private static volatile int transactionNums = 0;
@@ -38,10 +38,10 @@ public class TestBasicPeerSlow {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, RaftTestUtil.getScratchSetup(QUORUM_SIZE));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, RaftTestUtil.getScratchSetup(QUORUM_SIZE));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
 
     transactionNums = 0;
     stop = false;
@@ -122,8 +122,8 @@ public class TestBasicPeerSlow {
       InstrumentedConsensusServiceImpl.PacketDropStyle style =
         InstrumentedConsensusServiceImpl.PacketDropStyle.values()[event[1]];
 
-      RaftQuorumContext context = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, rank);
-      RAFT_TEST_UTIL.simulatePacketDropForServer(regionInfo, rank, style);
+      RaftQuorumContext context = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, rank);
+      RAFT_TEST_UTIL.simulatePacketDropForServer(quorumInfo, rank, style);
 
       System.out.println("Set package drop for the quorum: " + context + " as " + style);
     }
@@ -148,8 +148,8 @@ public class TestBasicPeerSlow {
       InstrumentedConsensusServiceImpl.PacketDropStyle nodrop =
         InstrumentedConsensusServiceImpl.PacketDropStyle.NONE;
 
-      RaftQuorumContext context = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, rank);
-      RAFT_TEST_UTIL.simulatePacketDropForServer(regionInfo, rank, nodrop);
+      RaftQuorumContext context = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, rank);
+      RAFT_TEST_UTIL.simulatePacketDropForServer(quorumInfo, rank, nodrop);
 
       System.out.println("Reset package drop for the quorum: " + context + " as " + nodrop);
     }
@@ -161,7 +161,7 @@ public class TestBasicPeerSlow {
     makeProgress(sleepTime, transactionNums, true);
 
     // Verify logs are identical across all the quorum members
-    while (!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE)) {
+    while (!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE)) {
       Thread.sleep(5 * 1000);
       clientTrafficFrequency = clientTrafficFrequency * 10;
       System.out.println("Verifying logs ....");
@@ -177,13 +177,13 @@ public class TestBasicPeerSlow {
     throws InterruptedException {
     System.out.println("Let the client load fly for " + sleepTime + " ms");
     Thread.sleep(sleepTime);
-    RAFT_TEST_UTIL.printStatusOfQuorum(regionInfo);
+    RAFT_TEST_UTIL.printStatusOfQuorum(quorumInfo);
 
     int i = 0;
     while ((waitForProgress && transactionNums <= prevLoad) ||
       (!waitForProgress && (++i <= 1))) {
       System.out.println("No Progress ! prev " + prevLoad + " current " + transactionNums);
-      RAFT_TEST_UTIL.printStatusOfQuorum(regionInfo);
+      RAFT_TEST_UTIL.printStatusOfQuorum(quorumInfo);
       Thread.sleep(sleepTime);
     }
 
@@ -206,7 +206,7 @@ public class TestBasicPeerSlow {
               if ((++transactionNums) % progressInterval == 0) {
                 System.out.println("Sent " + transactionNums +
                   "transactions to the quorum");
-                RAFT_TEST_UTIL.printStatusOfQuorum(regionInfo);
+                RAFT_TEST_UTIL.printStatusOfQuorum(quorumInfo);
               }
             } catch (Exception e) {
               System.out.print(String.format("Cannot replicate transaction" + e));

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumCommit.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumCommit.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumCommit.java
index 1c63a47..bb89597 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumCommit.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumCommit.java
@@ -1,18 +1,14 @@
 package org.apache.hadoop.hbase.consensus;
 
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.consensus.quorum.QuorumAgent;
-import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
-import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.After;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -32,7 +28,7 @@ public class TestBasicQuorumCommit {
 
   private static final int QUORUM_SIZE = 5;
   private static final int QUORUM_MAJORITY = 3;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private final List<int[]> mockLogs;
   private QuorumClient client;
@@ -42,10 +38,10 @@ public class TestBasicQuorumCommit {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.assertAllServersRunning();
     RAFT_TEST_UTIL.setUsePeristentLog(true);
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, mockLogs);
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, mockLogs);
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
   }
 
   @After
@@ -69,8 +65,8 @@ public class TestBasicQuorumCommit {
       LOG.info("Passed the " + i + " commit !");
     }
     // Verify all the logs across the quorum are the same
-    while(!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE)) {
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+    while(!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE)) {
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
       try {
         // Sleep for MAX_TIMEOUT time for leader election to complete
         Thread.sleep(HConstants.QUORUM_CLIENT_COMMIT_DEADLINE_DEFAULT);
@@ -83,11 +79,11 @@ public class TestBasicQuorumCommit {
 
   private void testSingleCommit() {
     try {
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
       client.replicateCommits(Arrays.asList(generateTestingWALEdit()));
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
       // Verify all the logs across the majority are the same
-      RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_MAJORITY);
+      RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_MAJORITY);
     } catch (Exception e) {
       LOG.error("Errors: ", e);
       fail("Unexpected exception: " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumMembershipChange.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumMembershipChange.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumMembershipChange.java
index e75e4af..1d33457 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumMembershipChange.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicQuorumMembershipChange.java
@@ -12,7 +12,6 @@ import org.junit.runner.RunWith;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.apache.hadoop.hbase.HConstants;
- import org.apache.hadoop.hbase.HRegionInfo;
  import org.apache.hadoop.hbase.consensus.client.QuorumClient;
  import org.junit.After;
  import org.junit.Before;
@@ -29,7 +28,7 @@ import java.util.concurrent.ThreadPoolExecutor;
      TestBasicPeerFailure.class);
    private static int QUORUM_SIZE = 5;
    private static int QUORUM_MAJORITY = 3;
-   private static HRegionInfo regionInfo;
+   private static QuorumInfo quorumInfo;
    private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
    private static QuorumClient client;
    private static volatile int transactionNums = 0;
@@ -46,12 +45,12 @@ import java.util.concurrent.ThreadPoolExecutor;
      RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
      RAFT_TEST_UTIL.setUsePeristentLog(true);
      RAFT_TEST_UTIL.assertAllServersRunning();
-     regionInfo = RAFT_TEST_UTIL.initializePeers();
-     RAFT_TEST_UTIL.addQuorum(regionInfo, null);
-     RAFT_TEST_UTIL.startQuorum(regionInfo);
-     client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+     quorumInfo = RAFT_TEST_UTIL.initializePeers();
+     RAFT_TEST_UTIL.addQuorum(quorumInfo, null);
+     RAFT_TEST_UTIL.startQuorum(quorumInfo);
+     client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
 
-     loader = new ReplicationLoadForUnitTest(regionInfo, client, RAFT_TEST_UTIL,
+     loader = new ReplicationLoadForUnitTest(quorumInfo, client, RAFT_TEST_UTIL,
        QUORUM_SIZE, QUORUM_MAJORITY);
 
      transactionNums = 0;
@@ -104,7 +103,7 @@ import java.util.concurrent.ThreadPoolExecutor;
      // Get the new config
      QuorumInfo newConfig = this.createNewQuorumInfo(newPorts);
 
-     LOG.debug("Old Config " + regionInfo.getPeersWithRank());
+     LOG.debug("Old Config " + quorumInfo.getPeersWithRank());
 
      LOG.debug("New Config " + newConfig.getPeersWithRank());
 
@@ -116,7 +115,7 @@ import java.util.concurrent.ThreadPoolExecutor;
      // same time.
      if (numPeersToChange >= this.QUORUM_MAJORITY) {
       Assert.assertFalse(client.changeQuorum(newConfig));
-      newConfig = regionInfo.getQuorumInfo();
+      newConfig = quorumInfo;
      } else {
        Assert.assertTrue(client.changeQuorum(newConfig));
        // Tell the quorum client about the new config
@@ -157,7 +156,7 @@ import java.util.concurrent.ThreadPoolExecutor;
 
        // Start the raft protocol on the server
        server.getHandler().getRaftQuorumContext(
-         regionInfo.getQuorumInfo().getQuorumName()).initializeAll(
+         quorumInfo.getQuorumName()).initializeAll(
          HConstants.UNDEFINED_TERM_INDEX);
      }
    }
@@ -167,14 +166,14 @@ import java.util.concurrent.ThreadPoolExecutor;
 
      // Make a copy
 
-     QuorumInfo info = new QuorumInfo(regionInfo.getQuorumInfo());
+     QuorumInfo info = new QuorumInfo(quorumInfo);
      boolean leaderReplaced = false;
      List<HServerAddress> peerToReplaceAddr;
      peerToReplaceAddr = new ArrayList<>();
      List<Pair<HServerAddress, Integer>> newServers = new ArrayList<>();
 
      Map<HServerAddress, Integer> currentPeers =
-       info.getPeers().get(HRegionInfo.LOCAL_DC_KEY);
+       info.getPeers().get(QuorumInfo.LOCAL_DC_KEY);
 
      HServerAddress oldPeer, newPeer;
      for (int newServerPort : ports) {
@@ -202,12 +201,12 @@ import java.util.concurrent.ThreadPoolExecutor;
      }
 
      // Make sure we actually removed the required number of peers
-     Assert.assertTrue(info.getPeers().get(HRegionInfo.LOCAL_DC_KEY).size() ==
+     Assert.assertTrue(info.getPeers().get(QuorumInfo.LOCAL_DC_KEY).size() ==
        QUORUM_SIZE - ports.length);
 
      for (Pair<HServerAddress, Integer> server : newServers) {
        // Update the config
-       info.getPeers().get(HRegionInfo.LOCAL_DC_KEY).put(server.getFirst(),
+       info.getPeers().get(QuorumInfo.LOCAL_DC_KEY).put(server.getFirst(),
                server.getSecond());
      }
      info.refresh();

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicSeedCommitIndex.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicSeedCommitIndex.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicSeedCommitIndex.java
index e7c8644..82c7ed9 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicSeedCommitIndex.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestBasicSeedCommitIndex.java
@@ -1,27 +1,17 @@
 package org.apache.hadoop.hbase.consensus;
 
-import static junit.framework.Assert.fail;
-
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.List;
 
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
-import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
-import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -31,7 +21,7 @@ public class TestBasicSeedCommitIndex {
 
   private static final int QUORUM_SIZE = 5;
   private static final int QUORUM_MAJORITY = 3;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private final long seedIndex = 100;
 
@@ -42,10 +32,10 @@ public class TestBasicSeedCommitIndex {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.assertAllServersRunning();
     RAFT_TEST_UTIL.setUsePeristentLog(true);
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, null);
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, null);
     RAFT_TEST_UTIL.setSeedIndex(seedIndex);
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
 
   }
 
@@ -59,14 +49,14 @@ public class TestBasicSeedCommitIndex {
 
     // Wait for leader
 
-    RaftQuorumContext c5 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 5);
+    RaftQuorumContext c5 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 5);
     while (!c5.isLeader()) {
       Threads.sleep(1000);
     }
 
     // Wait till we purge the seed log file
     int count = 0;
-    List<RaftQuorumContext> peers = RAFT_TEST_UTIL.getQuorumContexts(regionInfo);
+    List<RaftQuorumContext> peers = RAFT_TEST_UTIL.getQuorumContexts(quorumInfo);
 
     while (count != QUORUM_SIZE) {
       Threads.sleep(1000);
@@ -76,7 +66,7 @@ public class TestBasicSeedCommitIndex {
           ++count;
         }
       }
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
     }
 
     // At this point the state should
@@ -87,16 +77,16 @@ public class TestBasicSeedCommitIndex {
     // [rank: 1] ; FOLLOWER ; { Uncommitted [101, 101] }
 
     // Let's stop the leader
-    LocalConsensusServer s5 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo,
+    LocalConsensusServer s5 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo,
       5);
 
-    RaftQuorumContext c4 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 4);
+    RaftQuorumContext c4 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 4);
 
     while (!c4.isLeader()) {
       Threads.sleep(1000);
     }
 
-    c5 = RAFT_TEST_UTIL.restartLocalConsensusServer(s5, regionInfo,
+    c5 = RAFT_TEST_UTIL.restartLocalConsensusServer(s5, quorumInfo,
       c5.getMyAddress());
 
     while (!c5.isLeader()) {
@@ -105,7 +95,7 @@ public class TestBasicSeedCommitIndex {
 
     // Wait for logs to be verified
     // Verify logs are identical across all the quorum members
-    while (!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE)) {
+    while (!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE)) {
       Threads.sleep(1000);
       System.out.println("Verifying logs ....");
       Assert

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestCommitDeadline.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestCommitDeadline.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestCommitDeadline.java
index 883a2ab..cf5015f 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestCommitDeadline.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestCommitDeadline.java
@@ -2,9 +2,9 @@ package org.apache.hadoop.hbase.consensus;
 
 import com.google.common.base.Stopwatch;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
 import org.apache.hadoop.hbase.consensus.client.QuorumThriftClientAgent;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -19,7 +19,7 @@ public class TestCommitDeadline {
   private static int NUM_REPLICAS = 3;
   private static int QUORUM_SIZE = 2;
 
-  private HRegionInfo regionInfo;
+  private QuorumInfo quorumInfo;
   private QuorumClient client;
   private QuorumThriftClientAgent leader;
 
@@ -34,14 +34,14 @@ public class TestCommitDeadline {
 
     // A successful commit should complete within the set deadline.
     Stopwatch stopwatch = new Stopwatch(); //Stopwatch.createStarted();
-    assertTrue(leader.replicateCommit(regionInfo.getEncodedName(),
+    assertTrue(leader.replicateCommit(quorumInfo.getQuorumName(),
             RAFT_TEST_UTIL.generateTransaction(1024)) > 0);
     assertTrue("The commit should complete within the deadline",
             stopwatch.elapsedTime(TimeUnit.MILLISECONDS) < deadline);
 
     // Stop the majority of the replicas. The leader should remain leader.
     for (int i = 0; i < QUORUM_SIZE; i++) {
-      RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, i + 1);
+      RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, i + 1);
     }
     leader = client.getLeader();
     assertNotNull(leader);
@@ -50,7 +50,7 @@ public class TestCommitDeadline {
     stopwatch.reset().start();
     Exception expectedException = null;
     try {
-      leader.replicateCommit(regionInfo.getEncodedName(),
+      leader.replicateCommit(quorumInfo.getQuorumName(),
               RAFT_TEST_UTIL.generateTransaction(1024));
     } catch (Exception e) {
       expectedException = e;
@@ -69,13 +69,13 @@ public class TestCommitDeadline {
     RAFT_TEST_UTIL.assertAllServersRunning();
     RAFT_TEST_UTIL.setUsePeristentLog(true);
 
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
 
-    RAFT_TEST_UTIL.addQuorum(regionInfo,
-            RAFT_TEST_UTIL.getScratchSetup(NUM_REPLICAS));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
+    RAFT_TEST_UTIL.addQuorum(quorumInfo,
+      RAFT_TEST_UTIL.getScratchSetup(NUM_REPLICAS));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
 
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestLowerRankBecomingLeader.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestLowerRankBecomingLeader.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestLowerRankBecomingLeader.java
index a72ebf9..94d3222 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestLowerRankBecomingLeader.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestLowerRankBecomingLeader.java
@@ -1,8 +1,8 @@
 package org.apache.hadoop.hbase.consensus;
 
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server
   .InstrumentedConsensusServiceImpl;
@@ -21,7 +21,7 @@ public class TestLowerRankBecomingLeader {
     TestLowerRankBecomingLeader.class);
   private static int QUORUM_SIZE = 3;
   private static int QUORUM_MAJORITY = 2;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private static QuorumClient client;
   private static volatile int transactionNum = 0;
@@ -33,12 +33,12 @@ public class TestLowerRankBecomingLeader {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
     transactionNum = 0;
-    loader = new ReplicationLoadForUnitTest(regionInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
+    loader = new ReplicationLoadForUnitTest(quorumInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
       QUORUM_MAJORITY);
   }
 
@@ -65,23 +65,23 @@ public class TestLowerRankBecomingLeader {
     // Let the traffic fly for a while
     transactionNum = loader.makeProgress(sleepTime, transactionNum);
 
-    RAFT_TEST_UTIL.simulatePacketDropForServer(regionInfo, 2,
+    RAFT_TEST_UTIL.simulatePacketDropForServer(quorumInfo, 2,
         InstrumentedConsensusServiceImpl.PacketDropStyle.ALWAYS);
 
     transactionNum = loader.makeProgress(sleepTime, transactionNum);
 
-    RAFT_TEST_UTIL.simulatePacketDropForServer(regionInfo, 2,
+    RAFT_TEST_UTIL.simulatePacketDropForServer(quorumInfo, 2,
         InstrumentedConsensusServiceImpl.PacketDropStyle.NONE);
 
     // At this point, rank 1 and rank 3 peers are up to date
 
     // Get all the quorum contexts from rank 3 to rank 2
-    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 3);
-    RaftQuorumContext c2 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 2);
+    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 3);
+    RaftQuorumContext c2 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 2);
 
     // Shutdown 1st quorum member whose rank is 3
     System.out.println("Stopping one quorum member: " + c3);
-    LocalConsensusServer s3 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 3);
+    LocalConsensusServer s3 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 3);
 
     // Let the traffic fly for a while
     if ((++failureCnt % failureInterval) == 0) {
@@ -94,7 +94,7 @@ public class TestLowerRankBecomingLeader {
     }
 
     // Restart the quorum member whose rank is 3
-    c3 = RAFT_TEST_UTIL.restartLocalConsensusServer(s3, regionInfo, c3.getMyAddress());
+    c3 = RAFT_TEST_UTIL.restartLocalConsensusServer(s3, quorumInfo, c3.getMyAddress());
     System.out.println("Restarted another quorum member: " + c3);
 
     // Let the traffic fly for a while
@@ -110,7 +110,7 @@ public class TestLowerRankBecomingLeader {
     loader.slowDownReplicationLoad();
 
     // Verify logs are identical across all the quorum members
-    while (!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE)) {
+    while (!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE)) {
       Thread.sleep(10 * 1000);
       System.out.println("Verifying logs ....");
       Assert.assertTrue("Rank 3 shall be the leader of the quorum", c3.isLeader());

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestPersistLastVotedFor.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestPersistLastVotedFor.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestPersistLastVotedFor.java
index 73683bb..347103e 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestPersistLastVotedFor.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestPersistLastVotedFor.java
@@ -1,8 +1,8 @@
 package org.apache.hadoop.hbase.consensus;
 
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
 import org.apache.hadoop.hbase.consensus.protocol.ConsensusHost;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
 import org.junit.After;
@@ -17,7 +17,7 @@ import java.io.IOException;
 public class TestPersistLastVotedFor {
   private static int QUORUM_SIZE = 3;
   private static int QUORUM_MAJORITY = 2;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private static QuorumClient client;
   private static volatile int transactionNum = 0;
@@ -29,13 +29,13 @@ public class TestPersistLastVotedFor {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
 
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
     transactionNum = 0;
-    loader = new ReplicationLoadForUnitTest(regionInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
+    loader = new ReplicationLoadForUnitTest(quorumInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
       QUORUM_MAJORITY);
   }
 
@@ -52,7 +52,7 @@ public class TestPersistLastVotedFor {
     loader.stopReplicationLoad();
 
     RaftQuorumContext leader =
-      RAFT_TEST_UTIL.getLeaderQuorumContext(regionInfo);
+      RAFT_TEST_UTIL.getLeaderQuorumContext(quorumInfo);
     // What is the current lastVotedFor
     ConsensusHost initialLastVotedFor = leader.getLastVotedFor();
 
@@ -61,7 +61,7 @@ public class TestPersistLastVotedFor {
       RAFT_TEST_UTIL.stopLocalConsensusServer(leader.getMyAddress());
 
     RaftQuorumContext newQuorumContext =
-      RAFT_TEST_UTIL.restartLocalConsensusServer(consensusServer, regionInfo,
+      RAFT_TEST_UTIL.restartLocalConsensusServer(consensusServer, quorumInfo,
       leader.getMyAddress());
     ConsensusHost lastVotedForAsReadFromDisk =
       newQuorumContext.getLastVotedFor();
@@ -73,7 +73,7 @@ public class TestPersistLastVotedFor {
     consensusServer =
       RAFT_TEST_UTIL.stopLocalConsensusServer(newQuorumContext.getMyAddress());
     RaftQuorumContext newQuorumContextAfterSecondRestart =
-      RAFT_TEST_UTIL.restartLocalConsensusServer(consensusServer, regionInfo,
+      RAFT_TEST_UTIL.restartLocalConsensusServer(consensusServer, quorumInfo,
         newQuorumContext.getMyAddress());
 
     ConsensusHost emptyLastVotedFor =

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestRaftEventListener.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestRaftEventListener.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestRaftEventListener.java
index 7da8372..414b361 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestRaftEventListener.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/TestRaftEventListener.java
@@ -1,9 +1,8 @@
 package org.apache.hadoop.hbase.consensus;
 
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
-import org.apache.hadoop.hbase.consensus.protocol.EditId;
 import org.apache.hadoop.hbase.consensus.protocol.Payload;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
 import org.apache.hadoop.hbase.consensus.server.peer.PeerServer;
@@ -12,8 +11,6 @@ import org.apache.hadoop.hbase.regionserver.RaftEventListener;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
@@ -26,7 +23,7 @@ public class TestRaftEventListener {
 
   private static int QUORUM_SIZE = 5;
   private static int QUORUM_MAJORITY = 3;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private static QuorumClient client;
   private int transactionNum = 0;
@@ -79,18 +76,18 @@ public class TestRaftEventListener {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
 
     // Register the listener for the highest rank, which is equal to QUORUM_SIZE;
     for (Map.Entry<String, PeerServer> entry :
-        RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, QUORUM_SIZE).getPeerServers().entrySet()) {
+        RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, QUORUM_SIZE).getPeerServers().entrySet()) {
       entry.getValue().registerDataStoreEventListener(listener);
     }
 
-    loader = new ReplicationLoadForUnitTest(regionInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
+    loader = new ReplicationLoadForUnitTest(quorumInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
       QUORUM_MAJORITY);
   }
 
@@ -109,16 +106,16 @@ public class TestRaftEventListener {
     transactionNum = loader.makeProgress(1000, transactionNum);
 
     // Stop the replica whose rank is 4
-    RaftQuorumContext c4 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 4);
+    RaftQuorumContext c4 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 4);
     System.out.println("Stopping one quorum member: " + c4);
-    LocalConsensusServer s4 = RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 4);
+    LocalConsensusServer s4 = RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 4);
 
     // Sleep for 1 sec
     transactionNum = loader.makeProgress(2000, transactionNum);
     assertEquals(1, unavailablePeerSet.size());
 
     // Start the replica whose rank is 4
-    RAFT_TEST_UTIL.restartLocalConsensusServer(s4, regionInfo, c4.getMyAddress());
+    RAFT_TEST_UTIL.restartLocalConsensusServer(s4, quorumInfo, c4.getMyAddress());
     System.out.println("Restarted one quorum member: " + c4);
 
     // Sleep for 5 sec

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/fsm/TestAsyncStatesInRaftStateMachine.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/fsm/TestAsyncStatesInRaftStateMachine.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/fsm/TestAsyncStatesInRaftStateMachine.java
index 17d7ace..4a73bdc 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/fsm/TestAsyncStatesInRaftStateMachine.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/fsm/TestAsyncStatesInRaftStateMachine.java
@@ -3,16 +3,14 @@ package org.apache.hadoop.hbase.consensus.fsm;
 import com.google.common.util.concurrent.SettableFuture;
 import junit.framework.Assert;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.consensus.RaftTestUtil;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.consensus.raft.states.RaftStateType;
 import org.apache.hadoop.hbase.consensus.server.LocalConsensusServer;
-import org.apache.hadoop.hbase.consensus.server.peer.AbstractPeer;
 import org.apache.hadoop.hbase.consensus.server.peer.PeerServer;
-import org.apache.hadoop.hbase.consensus.server.peer.states.PeerServerStateType;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
@@ -40,7 +38,7 @@ public class TestAsyncStatesInRaftStateMachine {
 
   private static final int QUORUM_SIZE = 5;
   private static final int QUORUM_MAJORITY = 3;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private Configuration conf;
   private QuorumClient client;
@@ -100,10 +98,10 @@ public class TestAsyncStatesInRaftStateMachine {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.assertAllServersRunning();
     RAFT_TEST_UTIL.setUsePeristentLog(true);
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, null);
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, null);
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
   }
 
   @After
@@ -129,7 +127,7 @@ public class TestAsyncStatesInRaftStateMachine {
       // the peer with the lowest timeout will try to write the
       // votedFor and should get stuck.
       RaftQuorumContext r = RAFT_TEST_UTIL.getRaftQuorumContextByRank(
-        regionInfo, 5);
+        quorumInfo, 5);
       assertEquals(RaftStateType.SEND_VOTE_REQUEST,
         r.getCurrentRaftState().getStateType());
       throw e;
@@ -143,26 +141,26 @@ public class TestAsyncStatesInRaftStateMachine {
     testReplicatingCommits(1);
 
     RaftQuorumContext leader =
-      RAFT_TEST_UTIL.getLeaderQuorumContext(regionInfo);
+      RAFT_TEST_UTIL.getLeaderQuorumContext(quorumInfo);
 
     // Stop the peer with rank = 1.
     RaftQuorumContext peer =
-      RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 1);
+      RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 1);
 
     PeerServer peerServer = leader.getPeerServers().get(peer.getMyAddress());
     LocalConsensusServer peerConsensusServer =
-      RAFT_TEST_UTIL.stopLocalConsensusServer(regionInfo, 1);
+      RAFT_TEST_UTIL.stopLocalConsensusServer(quorumInfo, 1);
 
     // Replicate some other commits, the dead server will miss out.
     testReplicatingCommits(10);
 
     // Restart that dead server.
     RAFT_TEST_UTIL.restartLocalConsensusServer(peerConsensusServer,
-      regionInfo, peer.getMyAddress());
+      quorumInfo, peer.getMyAddress());
 
     // Wait for dead server to come back
     long start = System.currentTimeMillis();
-    while (!RAFT_TEST_UTIL.verifyLogs(regionInfo.getQuorumInfo(), QUORUM_SIZE, true) &&
+    while (!RAFT_TEST_UTIL.verifyLogs(quorumInfo, QUORUM_SIZE, true) &&
       !blockOnHandleAppendResponse) {
       Thread.sleep(1000);
       // stop if we waited for more than 10 seconds
@@ -218,17 +216,17 @@ public class TestAsyncStatesInRaftStateMachine {
 
   private void testReplicatingCommits(int numCommits) {
     try {
-      RAFT_TEST_UTIL.waitForLeader(regionInfo);
+      RAFT_TEST_UTIL.waitForLeader(quorumInfo);
       RaftQuorumContext leader =
-        RAFT_TEST_UTIL.getLeaderQuorumContext(regionInfo);
+        RAFT_TEST_UTIL.getLeaderQuorumContext(quorumInfo);
       Assert.assertNotNull(leader);
 
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
       for (int i = 0; i < numCommits; i++) {
         client.replicateCommits(Arrays.asList(generateTestingWALEdit()));
 
       }
-      RAFT_TEST_UTIL.dumpStates(regionInfo);
+      RAFT_TEST_UTIL.dumpStates(quorumInfo);
     } catch (Exception e) {
       LOG.error("Errors: ", e);
       fail("Unexpected exception: " + e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/6c85d5e9/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/log/TestRemoteLogFetcher.java
----------------------------------------------------------------------
diff --git a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/log/TestRemoteLogFetcher.java b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/log/TestRemoteLogFetcher.java
index 0605222..1738a5e 100644
--- a/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/log/TestRemoteLogFetcher.java
+++ b/hbase-consensus/src/test/java/org/apache/hadoop/hbase/consensus/log/TestRemoteLogFetcher.java
@@ -1,10 +1,10 @@
 package org.apache.hadoop.hbase.consensus.log;
 
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.consensus.RaftTestUtil;
 import org.apache.hadoop.hbase.consensus.ReplicationLoadForUnitTest;
 import org.apache.hadoop.hbase.consensus.client.FetchTask;
 import org.apache.hadoop.hbase.consensus.client.QuorumClient;
+import org.apache.hadoop.hbase.consensus.quorum.QuorumInfo;
 import org.apache.hadoop.hbase.consensus.quorum.RaftQuorumContext;
 import org.apache.hadoop.hbase.util.Pair;
 import org.junit.After;
@@ -27,7 +27,7 @@ public class TestRemoteLogFetcher {
   private static final Logger LOG = LoggerFactory.getLogger(TestRemoteLogFetcher.class);
   private static int QUORUM_SIZE = 3;
   private static int QUORUM_MAJORITY = 2;
-  private static HRegionInfo regionInfo;
+  private static QuorumInfo quorumInfo;
   private static RaftTestUtil RAFT_TEST_UTIL = new RaftTestUtil();
   private static QuorumClient client;
   private static volatile int transactionNum = 0;
@@ -39,12 +39,12 @@ public class TestRemoteLogFetcher {
     RAFT_TEST_UTIL.createRaftCluster(QUORUM_SIZE);
     RAFT_TEST_UTIL.setUsePeristentLog(true);
     RAFT_TEST_UTIL.assertAllServersRunning();
-    regionInfo = RAFT_TEST_UTIL.initializePeers();
-    RAFT_TEST_UTIL.addQuorum(regionInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
-    RAFT_TEST_UTIL.startQuorum(regionInfo);
-    client = RAFT_TEST_UTIL.getQuorumClient(regionInfo.getQuorumInfo());
+    quorumInfo = RAFT_TEST_UTIL.initializePeers();
+    RAFT_TEST_UTIL.addQuorum(quorumInfo, RAFT_TEST_UTIL.getScratchSetup(QUORUM_SIZE));
+    RAFT_TEST_UTIL.startQuorum(quorumInfo);
+    client = RAFT_TEST_UTIL.getQuorumClient(quorumInfo);
     transactionNum = 0;
-    loader = new ReplicationLoadForUnitTest(regionInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
+    loader = new ReplicationLoadForUnitTest(quorumInfo, client, RAFT_TEST_UTIL, QUORUM_SIZE,
         QUORUM_MAJORITY);
   }
 
@@ -55,9 +55,9 @@ public class TestRemoteLogFetcher {
 
   @Test(timeout=60000)
   public void testLogFileStatusRetrieval() throws Exception {
-    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 3);
-    RaftQuorumContext c2 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 2);
-    RaftQuorumContext c1 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(regionInfo, 1);
+    RaftQuorumContext c3 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 3);
+    RaftQuorumContext c2 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 2);
+    RaftQuorumContext c1 = RAFT_TEST_UTIL.getRaftQuorumContextByRank(quorumInfo, 1);
 
     TransactionLogManager l3 = (TransactionLogManager)c3.getLogManager();
     // Around 60 indices per log file on peer 3


Mime
View raw message