hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject [1/3] hbase git commit: HBASE-18183 Region interface cleanup for CP expose.
Date Wed, 11 Oct 2017 11:45:11 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 2e368cf46 -> b212bf936


http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
index f777067..ca5a83b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
@@ -123,7 +123,6 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanReques
 import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsResponse;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
 
 /**
  * A mock RegionServer implementation.
@@ -264,12 +263,12 @@ ClientProtos.ClientService.BlockingInterface, RegionServerServices {
   }
 
   @Override
-  public void addRegion(Region r) {
+  public void addRegion(HRegion r) {
     // TODO Auto-generated method stub
   }
 
   @Override
-  public boolean removeRegion(Region r, ServerName destination) {
+  public boolean removeRegion(HRegion r, ServerName destination) {
     // TODO Auto-generated method stub
     return false;
   }
@@ -333,11 +332,6 @@ ClientProtos.ClientService.BlockingInterface, RegionServerServices {
   }
 
   @Override
-  public void postOpenDeployTasks(Region r) throws KeeperException, IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
   public void postOpenDeployTasks(PostOpenDeployContext context) throws KeeperException,
       IOException {
     // TODO Auto-generated method stub
@@ -592,7 +586,7 @@ ClientProtos.ClientService.BlockingInterface, RegionServerServices {
   }
 
   @Override
-  public Map<String, Region> getRecoveringRegions() {
+  public Map<String, HRegion> getRecoveringRegions() {
     // TODO Auto-generated method stub
     return null;
   }
@@ -609,17 +603,6 @@ ClientProtos.ClientService.BlockingInterface, RegionServerServices {
   }
 
   @Override
-  public boolean reportRegionStateTransition(TransitionCode code, RegionInfo... hris) {
-    return false;
-  }
-
-  @Override
-  public boolean reportRegionStateTransition(TransitionCode code, long openSeqNum,
-      RegionInfo... hris) {
-    return false;
-  }
-
-  @Override
   public boolean reportRegionStateTransition(RegionStateTransitionContext context) {
     return false;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
index c1eaef7..7220ff2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
@@ -34,7 +34,6 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.master.RegionState.State;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
-import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.testclassification.FlakeyTests;
 import org.apache.hadoop.hbase.testclassification.LargeTests;
@@ -225,9 +224,9 @@ public class TestMasterFailover {
     // region server should expire (how it can be verified?)
     MetaTableLocator.setMetaLocation(activeMaster.getZooKeeper(),
       rs.getServerName(), State.OPENING);
-    Region meta = rs.getRegion(HRegionInfo.FIRST_META_REGIONINFO.getEncodedName());
+    HRegion meta = rs.getRegion(HRegionInfo.FIRST_META_REGIONINFO.getEncodedName());
     rs.removeRegion(meta, null);
-    ((HRegion)meta).close();
+    meta.close();
 
     log("Aborting master");
     activeMaster.abort("test-kill");

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
index c0464a4..5dc55f2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
@@ -57,6 +57,7 @@ import org.apache.hadoop.hbase.favored.FavoredNodeAssignmentHelper;
 import org.apache.hadoop.hbase.favored.FavoredNodeLoadBalancer;
 import org.apache.hadoop.hbase.favored.FavoredNodesPlan;
 import org.apache.hadoop.hbase.favored.FavoredNodesPlan.Position;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
@@ -191,10 +192,10 @@ public class TestRegionPlacement {
       // kill a random non-meta server carrying at least one region
       killIndex = random.nextInt(SLAVES);
       serverToKill = TEST_UTIL.getHBaseCluster().getRegionServer(killIndex).getServerName();
-      Collection<Region> regs =
+      Collection<HRegion> regs =
           TEST_UTIL.getHBaseCluster().getRegionServer(killIndex).getOnlineRegionsLocalContext();
       isNamespaceServer = false;
-      for (Region r : regs) {
+      for (HRegion r : regs) {
         if (r.getRegionInfo().getTable().getNamespaceAsString()
             .equals(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR)) {
           isNamespaceServer = true;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java
index 2f22eeb..d6f559f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java
@@ -53,6 +53,7 @@ import org.apache.hadoop.hbase.master.LoadBalancer;
 import org.apache.hadoop.hbase.master.ServerManager;
 import org.apache.hadoop.hbase.master.assignment.RegionStates;
 import org.apache.hadoop.hbase.master.assignment.RegionStates.RegionStateNode;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -544,7 +545,7 @@ public class TestFavoredStochasticLoadBalancer extends BalancerTestBase {
 
   private void compactTable(TableName tableName) throws IOException {
     for(JVMClusterUtil.RegionServerThread t : cluster.getRegionServerThreads()) {
-      for(Region region : t.getRegionServer().getRegions(tableName)) {
+      for(HRegion region : t.getRegionServer().getRegions(tableName)) {
         region.compact(true);
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionLocationFinder.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionLocationFinder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionLocationFinder.java
index 010f57a..0b49b5e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionLocationFinder.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionLocationFinder.java
@@ -31,8 +31,8 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
-import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -62,7 +62,7 @@ public class TestRegionLocationFinder {
 
     for (int i = 0; i < ServerNum; i++) {
       HRegionServer server = cluster.getRegionServer(i);
-      for (Region region : server.getRegions(tableName)) {
+      for (HRegion region : server.getRegions(tableName)) {
         region.flush(true);
       }
     }
@@ -83,7 +83,7 @@ public class TestRegionLocationFinder {
   public void testInternalGetTopBlockLocation() throws Exception {
     for (int i = 0; i < ServerNum; i++) {
       HRegionServer server = cluster.getRegionServer(i);
-      for (Region region : server.getRegions(tableName)) {
+      for (HRegion region : server.getRegions(tableName)) {
         // get region's hdfs block distribution by region and RegionLocationFinder,
         // they should have same result
         HDFSBlocksDistribution blocksDistribution1 = region.getHDFSBlocksDistribution();
@@ -122,7 +122,7 @@ public class TestRegionLocationFinder {
   public void testGetTopBlockLocations() throws Exception {
     for (int i = 0; i < ServerNum; i++) {
       HRegionServer server = cluster.getRegionServer(i);
-      for (Region region : server.getRegions(tableName)) {
+      for (HRegion region : server.getRegions(tableName)) {
         List<ServerName> servers = finder.getTopBlockLocations(region
             .getRegionInfo());
         // test table may have empty region
@@ -147,12 +147,12 @@ public class TestRegionLocationFinder {
     finder.getCache().invalidateAll();
     for (int i = 0; i < ServerNum; i++) {
       HRegionServer server = cluster.getRegionServer(i);
-      List<Region> regions = server.getRegions(tableName);
+      List<HRegion> regions = server.getRegions(tableName);
       if (regions.size() <= 0) {
         continue;
       }
       List<RegionInfo> regionInfos = new ArrayList<>(regions.size());
-      for (Region region : regions) {
+      for (HRegion region : regions) {
         regionInfos.add(region.getRegionInfo());
       }
       finder.refreshAndWait(regionInfos);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionsOnMasterOptions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionsOnMasterOptions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionsOnMasterOptions.java
index 61ac2fa..7b75e5b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionsOnMasterOptions.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRegionsOnMasterOptions.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.LoadBalancer;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.JVMClusterUtil;
@@ -150,7 +151,7 @@ public class TestRegionsOnMasterOptions {
     try {
       Table t = TEST_UTIL.createMultiRegionTable(tn, HConstants.CATALOG_FAMILY, REGIONS);
       LOG.info("Server: " + cluster.getMaster().getServerManager().getOnlineServersList());
-      List<Region> regions = cluster.getMaster().getRegions();
+      List<HRegion> regions = cluster.getMaster().getRegions();
       int mActualCount = regions.size();
       if (masterCount == 0 || masterCount == SYSTEM_REGIONS) {
         // 0 means no regions on master.

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileSystemUtilizationChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileSystemUtilizationChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileSystemUtilizationChore.java
index 719b5e1..ebd2436 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileSystemUtilizationChore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileSystemUtilizationChore.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.regionserver.Store;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
@@ -63,7 +64,7 @@ public class TestFileSystemUtilizationChore {
         .reportRegionSizesForQuotas((Map<RegionInfo,Long>) any(Map.class));
 
     final Region region = mockRegionWithSize(regionSizes);
-    when(rs.getRegions()).thenReturn(Arrays.asList(region));
+    Mockito.doReturn(Arrays.asList(region)).when(rs).getRegions();
     chore.chore();
   }
 
@@ -80,7 +81,7 @@ public class TestFileSystemUtilizationChore {
         .reportRegionSizesForQuotas((Map<RegionInfo,Long>) any(Map.class));
 
     final Region region = mockRegionWithSize(regionSizes);
-    when(rs.getRegions()).thenReturn(Arrays.asList(region));
+    Mockito.doReturn(Arrays.asList(region)).when(rs).getRegions();
     chore.chore();
   }
 
@@ -106,7 +107,7 @@ public class TestFileSystemUtilizationChore {
     final Region r1 = mockRegionWithSize(r1Sizes);
     final Region r2 = mockRegionWithSize(r2Sizes);
     final Region r3 = mockRegionWithSize(r3Sizes);
-    when(rs.getRegions()).thenReturn(Arrays.asList(r1, r2, r3));
+    Mockito.doReturn(Arrays.asList(r1, r2, r3)).when(rs).getRegions();
     chore.chore();
   }
 
@@ -172,7 +173,7 @@ public class TestFileSystemUtilizationChore {
     final Region r1 = mockRegionWithSize(Arrays.asList(1024L, 2048L));
     final Region r2 = mockRegionWithSize(Arrays.asList(1024L * 1024L));
     final Region r3 = mockRegionWithSize(Arrays.asList(10L * 1024L * 1024L));
-    when(rs.getRegions()).thenReturn(Arrays.asList(r1, r2, r3, lr1, lr2));
+    Mockito.doReturn(Arrays.asList(r1, r2, r3, lr1, lr2)).when(rs).getRegions();
 
     chore.chore();
   }
@@ -205,7 +206,7 @@ public class TestFileSystemUtilizationChore {
     final Region r2 = mockRegionWithSize(Arrays.asList(1024L * 1024L));
     final Region r3 = mockRegionWithSize(Arrays.asList(10L * 1024L * 1024L));
     // lr2 is no longer online, so it should be ignored
-    when(rs.getRegions()).thenReturn(Arrays.asList(r1, r2, r3, lr1));
+    Mockito.doReturn(Arrays.asList(r1, r2, r3, lr1)).when(rs).getRegions();
 
     chore.chore();
   }
@@ -228,7 +229,7 @@ public class TestFileSystemUtilizationChore {
 
     final Region r1 = mockRegionWithSize(r1Sizes);
     final Region r2 = mockSplitParentRegionWithSize(r2Sizes);
-    when(rs.getRegions()).thenReturn(Arrays.asList(r1, r2));
+    Mockito.doReturn(Arrays.asList(r1, r2)).when(rs).getRegions();
     chore.chore();
   }
 
@@ -250,7 +251,7 @@ public class TestFileSystemUtilizationChore {
 
     final Region r1 = mockRegionWithSize(r1Sizes);
     final Region r2 = mockRegionReplicaWithSize(r2Sizes);
-    when(rs.getRegions()).thenReturn(Arrays.asList(r1, r2));
+    Mockito.doReturn(Arrays.asList(r1, r2)).when(rs).getRegions();
     chore.chore();
   }
 
@@ -277,7 +278,7 @@ public class TestFileSystemUtilizationChore {
 
     final Region r1 = mockRegionWithHFileLinks(r1StoreFileSizes, r1HFileSizes);
     final Region r2 = mockRegionWithHFileLinks(r2StoreFileSizes, r2HFileSizes);
-    when(rs.getRegions()).thenReturn(Arrays.asList(r1, r2));
+    Mockito.doReturn(Arrays.asList(r1, r2)).when(rs).getRegions();
     chore.chore();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/RegionAsTable.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/RegionAsTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/RegionAsTable.java
index 8f34b19..3865cb3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/RegionAsTable.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/RegionAsTable.java
@@ -270,12 +270,12 @@ public class RegionAsTable implements Table {
 
   @Override
   public Result append(Append append) throws IOException {
-    return this.region.append(append, HConstants.NO_NONCE, HConstants.NO_NONCE);
+    return this.region.append(append);
   }
 
   @Override
   public Result increment(Increment increment) throws IOException {
-    return this.region.increment(increment, HConstants.NO_NONCE, HConstants.NO_NONCE);
+    return this.region.increment(increment);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
index 674c3e8..3aed91c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
@@ -287,7 +287,7 @@ public class TestAtomicOperation {
           inc.addColumn(fam1, qual2, amount*2);
           inc.addColumn(fam2, qual3, amount*3);
           inc.setDurability(Durability.ASYNC_WAL);
-          Result result = region.increment(inc, HConstants.NO_NONCE, HConstants.NO_NONCE);
+          Result result = region.increment(inc);
           if (result != null) {
             assertEquals(Bytes.toLong(result.getValue(fam1, qual1))*2,
               Bytes.toLong(result.getValue(fam1, qual2)));
@@ -555,13 +555,13 @@ public class TestAtomicOperation {
   }
 
   public static class AtomicOperation extends Thread {
-    protected final Region region;
+    protected final HRegion region;
     protected final int numOps;
     protected final AtomicLong timeStamps;
     protected final AtomicInteger failures;
     protected final Random r = new Random();
 
-    public AtomicOperation(Region region, int numOps, AtomicLong timeStamps,
+    public AtomicOperation(HRegion region, int numOps, AtomicLong timeStamps,
         AtomicInteger failures) {
       this.region = region;
       this.numOps = numOps;
@@ -633,7 +633,7 @@ public class TestAtomicOperation {
       put.addColumn(Bytes.toBytes(family), Bytes.toBytes("q1"), Bytes.toBytes("50"));
       puts[0] = put;
       testStep = TestStep.PUT_STARTED;
-      region.batchMutate(puts, HConstants.NO_NONCE, HConstants.NO_NONCE);
+      region.batchMutate(puts);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java
index 59c256a..5c4fb60 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java
@@ -63,7 +63,7 @@ public class TestBlocksRead  {
       BloomType.ROW, BloomType.NONE };
 
   private static BlockCache blockCache;
-  Region region = null;
+  HRegion region = null;
   private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private final String DIR = TEST_UTIL.getDataTestDir("TestBlocksRead").toString();
   private Configuration conf = TEST_UTIL.getConfiguration();
@@ -88,7 +88,7 @@ public class TestBlocksRead  {
    * @throws IOException
    * @return created and initialized region.
    */
-  private Region initHRegion(byte[] tableName, String callingMethod,
+  private HRegion initHRegion(byte[] tableName, String callingMethod,
       Configuration conf, String family) throws IOException {
     HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
     HColumnDescriptor familyDesc;
@@ -102,7 +102,7 @@ public class TestBlocksRead  {
 
     HRegionInfo info = new HRegionInfo(htd.getTableName(), null, null, false);
     Path path = new Path(DIR + callingMethod);
-    Region r = HBaseTestingUtility.createRegionAndWAL(info, path, conf, htd);
+    HRegion r = HBaseTestingUtility.createRegionAndWAL(info, path, conf, htd);
     blockCache = new CacheConfig(conf).getBlockCache();
     return r;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
index c28e48b..06cbf7a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
@@ -89,7 +89,7 @@ public class TestBlocksScanned extends HBaseTestCase {
   }
 
   private void _testBlocksScanned(HTableDescriptor table) throws Exception {
-    Region r = createNewHRegion(table, START_KEY, END_KEY, TEST_UTIL.getConfiguration());
+    HRegion r = createNewHRegion(table, START_KEY, END_KEY, TEST_UTIL.getConfiguration());
     addContent(r, FAMILY, COL);
     r.flush(true);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
index 5cfa17d..4a26f76 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
@@ -76,7 +76,7 @@ public class TestColumnSeeking {
     htd.addFamily(hcd);
     HRegionInfo info = new HRegionInfo(table, null, null, false);
     // Set this so that the archiver writes to the temp dir as well.
-    Region region = TEST_UTIL.createLocalHRegion(info, htd);
+    HRegion region = TEST_UTIL.createLocalHRegion(info, htd);
     try {
       List<String> rows = generateRandomWords(10, "row");
       List<String> allColumns = generateRandomWords(10, "column");
@@ -188,7 +188,7 @@ public class TestColumnSeeking {
     htd.addFamily(hcd);
 
     HRegionInfo info = new HRegionInfo(table, null, null, false);
-    Region region = TEST_UTIL.createLocalHRegion(info, htd);
+    HRegion region = TEST_UTIL.createLocalHRegion(info, htd);
 
     List<String> rows = generateRandomWords(10, "row");
     List<String> allColumns = generateRandomWords(100, "column");

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
index d54b58d..95dec3d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
@@ -51,6 +51,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
+import org.mockito.Mockito;
 
 /**
  * Tests a race condition between archiving of compacted files in CompactedHFilesDischarger chore
@@ -90,9 +91,9 @@ public class TestCompactionArchiveConcurrentClose {
     HRegionInfo info = new HRegionInfo(tableName, null, null, false);
     HRegion region = initHRegion(htd, info);
     RegionServerServices rss = mock(RegionServerServices.class);
-    List<Region> regions = new ArrayList<>();
+    List<HRegion> regions = new ArrayList<>();
     regions.add(region);
-    when(rss.getRegions()).thenReturn(regions);
+    Mockito.doReturn(regions).when(rss).getRegions();
 
     // Create the cleaner object
     CompactedHFilesDischarger cleaner =

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
index 8afe85e..0a47762 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
@@ -27,7 +27,6 @@ import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.collect.ImmutableList;
 
@@ -58,6 +57,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
+import org.mockito.Mockito;
 
 /**
  * Tests that archiving compacted files behaves correctly when encountering exceptions.
@@ -99,9 +99,9 @@ public class TestCompactionArchiveIOException {
     HRegionInfo info = new HRegionInfo(tableName, null, null, false);
     final HRegion region = initHRegion(htd, info);
     RegionServerServices rss = mock(RegionServerServices.class);
-    List<Region> regions = new ArrayList<>();
+    List<HRegion> regions = new ArrayList<>();
     regions.add(region);
-    when(rss.getRegions()).thenReturn(regions);
+    Mockito.doReturn(regions).when(rss).getRegions();
 
     // Create the cleaner object
     final CompactedHFilesDischarger cleaner =

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
index ac52ea4..b30a884 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
@@ -138,7 +138,7 @@ public class TestCompactionState {
       ht = TEST_UTIL.createTable(table, families);
       loadData(ht, families, 3000, flushes);
       HRegionServer rs = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0);
-      List<Region> regions = rs.getRegions(table);
+      List<HRegion> regions = rs.getRegions(table);
       int countBefore = countStoreFilesInFamilies(regions, families);
       int countBeforeSingleFamily = countStoreFilesInFamily(regions, family);
       assertTrue(countBefore > 0); // there should be some data files
@@ -206,13 +206,13 @@ public class TestCompactionState {
   }
 
   private static int countStoreFilesInFamily(
-      List<Region> regions, final byte[] family) {
+      List<HRegion> regions, final byte[] family) {
     return countStoreFilesInFamilies(regions, new byte[][]{family});
   }
 
-  private static int countStoreFilesInFamilies(List<Region> regions, final byte[][] families) {
+  private static int countStoreFilesInFamilies(List<HRegion> regions, final byte[][] families) {
     int count = 0;
-    for (Region region: regions) {
+    for (HRegion region: regions) {
       count += region.getStoreFileList(families).size();
     }
     return count;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
index 6b01256..9c87ebe 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
@@ -83,7 +83,7 @@ public class TestGetClosestAtOrBefore  {
     TableDescriptorBuilder metaBuilder = UTIL.getMetaTableDescriptorBuilder()
             .setMemStoreFlushSize(64 * 1024 * 1024);
 
-    Region mr = HBaseTestingUtility.createRegionAndWAL(HRegionInfo.FIRST_META_REGIONINFO,
+    HRegion mr = HBaseTestingUtility.createRegionAndWAL(HRegionInfo.FIRST_META_REGIONINFO,
         rootdir, this.conf, metaBuilder.build());
     try {
     // Write rows for three tables 'A', 'B', and 'C'.
@@ -195,7 +195,7 @@ public class TestGetClosestAtOrBefore  {
    */
   @Test
   public void testGetClosestRowBefore3() throws IOException{
-    Region region = null;
+    HRegion region = null;
     byte [] c0 = UTIL.COLUMNS[0];
     byte [] c1 = UTIL.COLUMNS[1];
     try {
@@ -306,7 +306,7 @@ public class TestGetClosestAtOrBefore  {
   /** For HBASE-694 */
   @Test
   public void testGetClosestRowBefore2() throws IOException{
-    Region region = null;
+    HRegion region = null;
     byte [] c0 = UTIL.COLUMNS[0];
     try {
       TableName tn = TableName.valueOf(testName.getMethodName());

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index a7793f6..24e42bb 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -5884,7 +5884,7 @@ public class TestHRegion {
     when(rss.getWAL((HRegionInfo) any())).thenReturn(wal);
 
     // add the region to recovering regions
-    HashMap<String, Region> recoveringRegions = Maps.newHashMap();
+    HashMap<String, HRegion> recoveringRegions = Maps.newHashMap();
     recoveringRegions.put(region.getRegionInfo().getEncodedName(), null);
     when(rss.getRecoveringRegions()).thenReturn(recoveringRegions);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
index 2b52e33..3665ed8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
@@ -87,7 +87,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
-
+import org.mockito.Mockito;
 import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;
 import org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
@@ -180,9 +180,9 @@ public class TestHRegionReplayEvents {
     when(rss.getExecutorService()).thenReturn(es);
     primaryRegion = HRegion.createHRegion(primaryHri, rootDir, CONF, htd, walPrimary);
     primaryRegion.close();
-    List<Region> regions = new ArrayList<>();
+    List<HRegion> regions = new ArrayList<>();
     regions.add(primaryRegion);
-    when(rss.getRegions()).thenReturn(regions);
+    Mockito.doReturn(regions).when(rss).getRegions();
 
     primaryRegion = HRegion.openHRegion(rootDir, primaryHri, htd, walPrimary, CONF, rss, null);
     secondaryRegion = HRegion.openHRegion(secondaryHri, htd, null, CONF, rss, null);
@@ -1393,9 +1393,9 @@ public class TestHRegionReplayEvents {
 
     // Test case 3: compact primary files
     primaryRegion.compactStores();
-    List<Region> regions = new ArrayList<>();
+    List<HRegion> regions = new ArrayList<>();
     regions.add(primaryRegion);
-    when(rss.getRegions()).thenReturn(regions);
+    Mockito.doReturn(regions).when(rss).getRegions();
     CompactedHFilesDischarger cleaner = new CompactedHFilesDischarger(100, null, rss, false);
     cleaner.chore();
     secondaryRegion.refreshStoreFiles();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
index ba0d309..d4f1dfb 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java
@@ -804,12 +804,12 @@ public class TestHeapMemoryManager {
     }
 
     @Override
-    public void requestFlush(Region region, boolean forceFlushAllStores) {
+    public void requestFlush(HRegion region, boolean forceFlushAllStores) {
       this.listener.flushRequested(flushType, region);
     }
 
     @Override
-    public void requestDelayedFlush(Region region, long delay, boolean forceFlushAllStores) {
+    public void requestDelayedFlush(HRegion region, long delay, boolean forceFlushAllStores) {
 
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
index 7edcf54..aabfa16 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
@@ -196,7 +196,7 @@ public class TestKeepDeletes {
     // KEEP_DELETED_CELLS is NOT enabled
     HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 0, 3,
         HConstants.FOREVER, KeepDeletedCells.FALSE);
-    Region region = hbu.createLocalHRegion(htd, null, null);
+    HRegion region = hbu.createLocalHRegion(htd, null, null);
 
     long ts = EnvironmentEdgeManager.currentTime();
     Put p = new Put(T1, ts);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
index 323564e..f443705 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
@@ -388,17 +388,17 @@ public class TestMajorCompaction {
     return count;
   }
 
-  private void createStoreFile(final Region region) throws IOException {
+  private void createStoreFile(final HRegion region) throws IOException {
     createStoreFile(region, Bytes.toString(COLUMN_FAMILY));
   }
 
-  private void createStoreFile(final Region region, String family) throws IOException {
+  private void createStoreFile(final HRegion region, String family) throws IOException {
     Table loader = new RegionAsTable(region);
     HBaseTestCase.addContent(loader, family);
     region.flush(true);
   }
 
-  private void createSmallerStoreFile(final Region region) throws IOException {
+  private void createSmallerStoreFile(final HRegion region) throws IOException {
     Table loader = new RegionAsTable(region);
     HBaseTestCase.addContent(loader, Bytes.toString(COLUMN_FAMILY), ("" +
         "bbb").getBytes(), null);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
index e8d60e6..4ffe5d2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
@@ -68,7 +68,7 @@ public class TestMinVersions {
   public void testGetClosestBefore() throws Exception {
     HTableDescriptor htd =
         hbu.createTableDescriptor(name.getMethodName(), 1, 1000, 1, KeepDeletedCells.FALSE);
-    Region region = hbu.createLocalHRegion(htd, null, null);
+    HRegion region = hbu.createLocalHRegion(htd, null, null);
     try {
 
       // 2s in the past
@@ -118,7 +118,7 @@ public class TestMinVersions {
     // keep 3 versions minimum
     HTableDescriptor htd =
         hbu.createTableDescriptor(name.getMethodName(), 3, 1000, 1, KeepDeletedCells.FALSE);
-    Region region = hbu.createLocalHRegion(htd, null, null);
+    HRegion region = hbu.createLocalHRegion(htd, null, null);
     // 2s in the past
     long ts = EnvironmentEdgeManager.currentTime() - 2000;
 
@@ -173,7 +173,7 @@ public class TestMinVersions {
   public void testDelete() throws Exception {
     HTableDescriptor htd =
         hbu.createTableDescriptor(name.getMethodName(), 3, 1000, 1, KeepDeletedCells.FALSE);
-    Region region = hbu.createLocalHRegion(htd, null, null);
+    HRegion region = hbu.createLocalHRegion(htd, null, null);
 
     // 2s in the past
     long ts = EnvironmentEdgeManager.currentTime() - 2000;
@@ -232,7 +232,7 @@ public class TestMinVersions {
   public void testMemStore() throws Exception {
     HTableDescriptor htd =
         hbu.createTableDescriptor(name.getMethodName(), 2, 1000, 1, KeepDeletedCells.FALSE);
-    Region region = hbu.createLocalHRegion(htd, null, null);
+    HRegion region = hbu.createLocalHRegion(htd, null, null);
 
     // 2s in the past
     long ts = EnvironmentEdgeManager.currentTime() - 2000;
@@ -308,7 +308,7 @@ public class TestMinVersions {
     // 1 version minimum, 1000 versions maximum, ttl = 1s
     HTableDescriptor htd =
         hbu.createTableDescriptor(name.getMethodName(), 2, 1000, 1, KeepDeletedCells.FALSE);
-    Region region = hbu.createLocalHRegion(htd, null, null);
+    HRegion region = hbu.createLocalHRegion(htd, null, null);
     try {
 
       // 2s in the past
@@ -400,7 +400,7 @@ public class TestMinVersions {
   public void testFilters() throws Exception {
     HTableDescriptor htd =
         hbu.createTableDescriptor(name.getMethodName(), 2, 1000, 1, KeepDeletedCells.FALSE);
-    Region region = hbu.createLocalHRegion(htd, null, null);
+    HRegion region = hbu.createLocalHRegion(htd, null, null);
     final byte [] c1 = COLUMNS[1];
 
     // 2s in the past

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
index d22046c..f1a66e7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
@@ -145,7 +145,7 @@ public class TestMultiColumnScanner {
 
   @Test
   public void testMultiColumnScanner() throws IOException {
-    Region region = TEST_UTIL.createTestRegion(TABLE_NAME,
+    HRegion region = TEST_UTIL.createTestRegion(TABLE_NAME,
         new HColumnDescriptor(FAMILY)
             .setCompressionType(comprAlgo)
             .setBloomFilterType(bloomType)

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
index e4f7663..49a61c5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
@@ -130,7 +130,7 @@ public class TestPerColumnFamilyFlush {
     conf.setLong(FlushLargeStoresPolicy.HREGION_COLUMNFAMILY_FLUSH_SIZE_LOWER_BOUND_MIN,
         40 * 1024);
     // Intialize the region
-    Region region = initHRegion("testSelectiveFlushWithDataCompaction", conf);
+    HRegion region = initHRegion("testSelectiveFlushWithDataCompaction", conf);
     // Add 1200 entries for CF1, 100 for CF2 and 50 for CF3
     for (int i = 1; i <= 1200; i++) {
       region.put(createPut(1, i));
@@ -324,12 +324,12 @@ public class TestPerColumnFamilyFlush {
   }
 
   // Find the (first) region which has the specified name.
-  private static Pair<Region, HRegionServer> getRegionWithName(TableName tableName) {
+  private static Pair<HRegion, HRegionServer> getRegionWithName(TableName tableName) {
     MiniHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster();
     List<JVMClusterUtil.RegionServerThread> rsts = cluster.getRegionServerThreads();
     for (int i = 0; i < cluster.getRegionServerThreads().size(); i++) {
       HRegionServer hrs = rsts.get(i).getRegionServer();
-      for (Region region : hrs.getRegions(tableName)) {
+      for (HRegion region : hrs.getRegions(tableName)) {
         return Pair.newPair(region, hrs);
       }
     }
@@ -367,8 +367,8 @@ public class TestPerColumnFamilyFlush {
       }
       Thread.sleep(1000);
 
-      Pair<Region, HRegionServer> desiredRegionAndServer = getRegionWithName(TABLENAME);
-      Region desiredRegion = desiredRegionAndServer.getFirst();
+      Pair<HRegion, HRegionServer> desiredRegionAndServer = getRegionWithName(TABLENAME);
+      HRegion desiredRegion = desiredRegionAndServer.getFirst();
       assertTrue("Could not find a region which hosts the new region.", desiredRegion != null);
 
       // Flush the region selectively.
@@ -476,8 +476,8 @@ public class TestPerColumnFamilyFlush {
       try (Admin admin = TEST_UTIL.getConnection().getAdmin()) {
         admin.flush(TableName.NAMESPACE_TABLE_NAME);
       }
-      Pair<Region, HRegionServer> desiredRegionAndServer = getRegionWithName(tableName);
-      final Region desiredRegion = desiredRegionAndServer.getFirst();
+      Pair<HRegion, HRegionServer> desiredRegionAndServer = getRegionWithName(tableName);
+      final HRegion desiredRegion = desiredRegionAndServer.getFirst();
       assertTrue("Could not find a region which hosts the new region.", desiredRegion != null);
       LOG.info("Writing to region=" + desiredRegion);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java
index b2b03ff..b98ac2a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java
@@ -114,8 +114,8 @@ public class TestRegionFavoredNodes {
     // them as favored nodes through the region.
     for (int i = 0; i < REGION_SERVERS; i++) {
       HRegionServer server = TEST_UTIL.getHBaseCluster().getRegionServer(i);
-      List<Region> regions = server.getRegions(TABLE_NAME);
-      for (Region region : regions) {
+      List<HRegion> regions = server.getRegions(TABLE_NAME);
+      for (HRegion region : regions) {
         List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName>favoredNodes =
             new ArrayList<>(3);
         String encodedRegionName = region.getRegionInfo().getEncodedName();
@@ -142,8 +142,8 @@ public class TestRegionFavoredNodes {
     // they are consistent with the favored nodes for that region.
     for (int i = 0; i < REGION_SERVERS; i++) {
       HRegionServer server = TEST_UTIL.getHBaseCluster().getRegionServer(i);
-      List<Region> regions = server.getRegions(TABLE_NAME);
-      for (Region region : regions) {
+      List<HRegion> regions = server.getRegions(TABLE_NAME);
+      for (HRegion region : regions) {
         List<String> files = region.getStoreFileList(new byte[][]{COLUMN_FAMILY});
         for (String file : files) {
           FileStatus status = TEST_UTIL.getDFSCluster().getFileSystem().

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java
index 5d2b9c1..1a5a91d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java
@@ -156,7 +156,7 @@ public class TestRegionReplicas {
       // assert that we can read back from primary
       Assert.assertEquals(1000, HTU.countRows(table));
       // flush so that region replica can read
-      Region region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
+      HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
       region.flush(true);
 
       openRegion(HTU, getRS(), hriSecondary);
@@ -180,7 +180,7 @@ public class TestRegionReplicas {
       // assert that we can read back from primary
       Assert.assertEquals(1000, HTU.countRows(table));
       // flush so that region replica can read
-      Region region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
+      HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
       region.flush(true);
 
       openRegion(HTU, getRS(), hriSecondary);
@@ -250,7 +250,7 @@ public class TestRegionReplicas {
       Assert.assertEquals(1000, HTU.countRows(table));
       // flush so that region replica can read
       LOG.info("Flushing primary region");
-      Region region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
+      HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
       region.flush(true);
       HRegion primaryRegion = (HRegion) region;
 
@@ -442,11 +442,11 @@ public class TestRegionReplicas {
       LOG.info("Loading data to primary region");
       for (int i = 0; i < 3; ++i) {
         HTU.loadNumericRows(table, f, i * 1000, (i + 1) * 1000);
-        Region region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
+        HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName());
         region.flush(true);
       }
 
-      Region primaryRegion = getRS().getRegion(hriPrimary.getEncodedName());
+      HRegion primaryRegion = getRS().getRegion(hriPrimary.getEncodedName());
       Assert.assertEquals(3, primaryRegion.getStore(f).getStorefilesCount());
 
       // Refresh store files on the secondary

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java
index 5897fe7..45536f2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java
@@ -18,10 +18,8 @@
 package org.apache.hadoop.hbase.regionserver;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -31,7 +29,6 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.RegionReplicaUtil;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
@@ -39,7 +36,6 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.RegionSplitter;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -116,9 +112,9 @@ public class TestRegionReplicasWithModifyTable {
     try {
       tableName = TableName.valueOf(name.getMethodName());
       enableReplicationByModification(tableName, false, 0, 3, 0);
-      List<Region> onlineRegions = getRS().getRegions(tableName);
-      List<Region> onlineRegions2 = getSecondaryRS().getRegions(tableName);
-      List<Region> onlineRegions3 = getTertiaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions = getRS().getRegions(tableName);
+      List<HRegion> onlineRegions2 = getSecondaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions3 = getTertiaryRS().getRegions(tableName);
       int totalRegions = onlineRegions.size() + onlineRegions2.size() + onlineRegions3.size();
       assertEquals("the number of regions should be more than 1", totalRegions, 3);
     } finally {
@@ -137,9 +133,9 @@ public class TestRegionReplicasWithModifyTable {
     try {
       tableName = TableName.valueOf(name.getMethodName());
       enableReplicationByModification(tableName, false, 0, 3, 10);
-      List<Region> onlineRegions = getRS().getRegions(tableName);
-      List<Region> onlineRegions2 = getSecondaryRS().getRegions(tableName);
-      List<Region> onlineRegions3 = getTertiaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions = getRS().getRegions(tableName);
+      List<HRegion> onlineRegions2 = getSecondaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions3 = getTertiaryRS().getRegions(tableName);
       int totalRegions = onlineRegions.size() + onlineRegions2.size() + onlineRegions3.size();
       assertEquals("the number of regions should be equal to 30", totalRegions, 30);
     } finally {
@@ -153,9 +149,9 @@ public class TestRegionReplicasWithModifyTable {
     try {
       tableName = TableName.valueOf(name.getMethodName());
       enableReplicationByModification(tableName, true, 2, 3, 0);
-      List<Region> onlineRegions = getRS().getRegions(tableName);
-      List<Region> onlineRegions2 = getSecondaryRS().getRegions(tableName);
-      List<Region> onlineRegions3 = getTertiaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions = getRS().getRegions(tableName);
+      List<HRegion> onlineRegions2 = getSecondaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions3 = getTertiaryRS().getRegions(tableName);
       int totalRegions = onlineRegions.size() + onlineRegions2.size() + onlineRegions3.size();
       assertEquals("the number of regions should be 3", totalRegions, 3);
     } finally {
@@ -169,9 +165,9 @@ public class TestRegionReplicasWithModifyTable {
     try {
       tableName = TableName.valueOf(name.getMethodName());
       enableReplicationByModification(tableName, true, 3, 2, 0);
-      List<Region> onlineRegions = getRS().getRegions(tableName);
-      List<Region> onlineRegions2 = getSecondaryRS().getRegions(tableName);
-      List<Region> onlineRegions3 = getTertiaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions = getRS().getRegions(tableName);
+      List<HRegion> onlineRegions2 = getSecondaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions3 = getTertiaryRS().getRegions(tableName);
       int totalRegions = onlineRegions.size() + onlineRegions2.size() + onlineRegions3.size();
       assertEquals("the number of regions should be reduced to 2", totalRegions, 2);
     } finally {
@@ -186,9 +182,9 @@ public class TestRegionReplicasWithModifyTable {
     try {
       tableName = TableName.valueOf(name.getMethodName());
       enableReplicationByModification(tableName, true, 3, 2, 20);
-      List<Region> onlineRegions = getRS().getRegions(tableName);
-      List<Region> onlineRegions2 = getSecondaryRS().getRegions(tableName);
-      List<Region> onlineRegions3 = getTertiaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions = getRS().getRegions(tableName);
+      List<HRegion> onlineRegions2 = getSecondaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions3 = getTertiaryRS().getRegions(tableName);
       int totalRegions = onlineRegions.size() + onlineRegions2.size() + onlineRegions3.size();
       assertEquals("the number of regions should be reduced to 40", totalRegions, 40);
     } finally {
@@ -203,9 +199,9 @@ public class TestRegionReplicasWithModifyTable {
     try {
       tableName = TableName.valueOf(name.getMethodName());
       enableReplicationByModification(tableName, true, 2, 3, 15);
-      List<Region> onlineRegions = getRS().getRegions(tableName);
-      List<Region> onlineRegions2 = getSecondaryRS().getRegions(tableName);
-      List<Region> onlineRegions3 = getTertiaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions = getRS().getRegions(tableName);
+      List<HRegion> onlineRegions2 = getSecondaryRS().getRegions(tableName);
+      List<HRegion> onlineRegions3 = getTertiaryRS().getRegions(tableName);
       int totalRegions = onlineRegions.size() + onlineRegions2.size() + onlineRegions3.size();
       assertEquals("the number of regions should be equal to 45", totalRegions, 3 * 15);
     } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
index 6d8744b..80d170a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
@@ -496,7 +496,7 @@ public class TestRegionServerMetrics {
     byte[] val = Bytes.toBytes("mobdata");
     try {
       Table table = TEST_UTIL.createTable(htd, new byte[0][0], conf);
-      Region region = rs.getRegions(tableName).get(0);
+      HRegion region = rs.getRegions(tableName).get(0);
       for (int insertCount = 0; insertCount < numHfiles; insertCount++) {
         Put p = new Put(Bytes.toBytes(insertCount));
         p.addColumn(cf, qualifier, val);
@@ -515,7 +515,7 @@ public class TestRegionServerMetrics {
 
       setMobThreshold(region, cf, 100);
       // metrics are reset by the region initialization
-      ((HRegion) region).initialize();
+      region.initialize();
       region.compact(true);
       metricsRegionServer.getRegionServerWrapper().forceRecompute();
       assertCounter("cellsCountCompactedFromMob", numHfiles);
@@ -539,7 +539,7 @@ public class TestRegionServerMetrics {
       ((HRegion) region).close();
 
       // metrics are reset by the region initialization
-      ((HRegion) region).initialize();
+      region.initialize();
       region.compact(true);
       metricsRegionServer.getRegionServerWrapper().forceRecompute();
       // metrics are reset by the region initialization

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
index 3b66a1d..ffda964 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
@@ -129,7 +129,7 @@ public class TestRegionServerNoMaster {
   /** Flush the given region in the mini cluster. Since no master, we cannot use HBaseAdmin.flush() */
   public static void flushRegion(HBaseTestingUtility HTU, HRegionInfo regionInfo) throws IOException {
     for (RegionServerThread rst : HTU.getMiniHBaseCluster().getRegionServerThreads()) {
-      Region region = rst.getRegionServer().getRegionByEncodedName(regionInfo.getEncodedName());
+      HRegion region = rst.getRegionServer().getRegionByEncodedName(regionInfo.getEncodedName());
       if (region != null) {
         region.flush(true);
         return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
index 2b79152..8713999 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
@@ -104,8 +104,8 @@ public class TestRegionSplitPolicy {
     // Now make it so the mock region has a RegionServerService that will
     // return 'online regions'.
     RegionServerServices rss = Mockito.mock(RegionServerServices.class);
-    final List<Region> regions = new ArrayList<>();
-    Mockito.when(rss.getRegions(TABLENAME)).thenReturn(regions);
+    final List<HRegion> regions = new ArrayList<>();
+    Mockito.doReturn(regions).when(rss).getRegions(TABLENAME);
     Mockito.when(mockRegion.getRegionServerServices()).thenReturn(rss);
     // Set max size for this 'table'.
     long maxSplitSize = 1024L;
@@ -163,8 +163,8 @@ public class TestRegionSplitPolicy {
     conf.setFloat("hbase.busy.policy.blockedRequests", 0.1f);
 
     RegionServerServices rss  = Mockito.mock(RegionServerServices.class);
-    final List<Region> regions = new ArrayList<>();
-    Mockito.when(rss.getRegions(TABLENAME)).thenReturn(regions);
+    final List<HRegion> regions = new ArrayList<>();
+    Mockito.doReturn(regions).when(rss).getRegions(TABLENAME);
     Mockito.when(mockRegion.getRegionServerServices()).thenReturn(rss);
     Mockito.when(mockRegion.getBlockedRequestsCount()).thenReturn(0L);
     Mockito.when(mockRegion.getWriteRequestsCount()).thenReturn(0L);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
index 3a952ee..570422e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
@@ -73,7 +73,7 @@ public class TestResettingCounters {
         throw new IOException("Failed delete of " + path);
       }
     }
-    Region region = HBaseTestingUtility.createRegionAndWAL(hri, path, conf, htd);
+    HRegion region = HBaseTestingUtility.createRegionAndWAL(hri, path, conf, htd);
     try {
       Increment odd = new Increment(rows[0]);
       odd.setDurability(Durability.SKIP_WAL);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
index dbf3be0..63e549e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
@@ -321,7 +321,7 @@ public class TestReversibleScanners {
     HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()))
         .addFamily(new HColumnDescriptor(FAMILYNAME))
         .addFamily(new HColumnDescriptor(FAMILYNAME2));
-    Region region = TEST_UTIL.createLocalHRegion(htd, null, null);
+    HRegion region = TEST_UTIL.createLocalHRegion(htd, null, null);
     loadDataToRegion(region, FAMILYNAME2);
 
     // verify row count with forward scan
@@ -641,7 +641,7 @@ public class TestReversibleScanners {
     return nextReadableNum;
   }
 
-  private static void loadDataToRegion(Region region, byte[] additionalFamily)
+  private static void loadDataToRegion(HRegion region, byte[] additionalFamily)
       throws IOException {
     for (int i = 0; i < ROWSIZE; i++) {
       Put put = new Put(ROWS[i]);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java
index 4d3a1c3..f9d0d1a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java
@@ -85,7 +85,7 @@ public class TestRowTooBig {
     final HRegionInfo hri =
       new HRegionInfo(htd.getTableName(), HConstants.EMPTY_END_ROW,
         HConstants.EMPTY_END_ROW);
-    Region region =
+    HRegion region =
         HBaseTestingUtility.createRegionAndWAL(hri, rootRegionDir, HTU.getConfiguration(), htd);
     try {
       // Add 5 cells to memstore
@@ -132,7 +132,7 @@ public class TestRowTooBig {
     final HRegionInfo hri =
       new HRegionInfo(htd.getTableName(), HConstants.EMPTY_END_ROW,
         HConstants.EMPTY_END_ROW);
-    Region region =
+    HRegion region =
         HBaseTestingUtility.createRegionAndWAL(hri, rootRegionDir, HTU.getConfiguration(), htd);
     try {
       // Add to memstore

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
index 72267be..e01b59d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
@@ -75,7 +75,7 @@ public class TestScanWithBloomError {
   private static final String QUALIFIER_PREFIX = "qual";
   private static final byte[] ROW_BYTES = Bytes.toBytes(ROW);
   private static NavigableSet<Integer> allColIds = new TreeSet<>();
-  private Region region;
+  private HRegion region;
   private BloomType bloomType;
   private FileSystem fs;
   private Configuration conf;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
index 67f6f34..03860f2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
@@ -107,7 +107,7 @@ public class TestSeekOptimizations {
   private static final int[] MAX_VERSIONS_VALUES = new int[] { 1, 2 };
 
   // Instance variables
-  private Region region;
+  private HRegion region;
   private Put put;
   private Delete del;
   private Random rand;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
index fecfd94..40abf79 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java
@@ -44,7 +44,7 @@ import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.monitoring.MonitoredTask;
 import org.apache.hadoop.hbase.regionserver.HRegion.PrepareFlushResult;
-import org.apache.hadoop.hbase.regionserver.Region.FlushResult;
+import org.apache.hadoop.hbase.regionserver.HRegion.FlushResult;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
@@ -120,7 +120,7 @@ public class TestSplitWalDataLoss {
       Matchers.<Collection<HStore>> any());
     // Find region key; don't pick up key for hbase:meta by mistake.
     String key = null;
-    for (Map.Entry<String, Region> entry: rs.onlineRegions.entrySet()) {
+    for (Map.Entry<String, HRegion> entry: rs.onlineRegions.entrySet()) {
       if (entry.getValue().getRegionInfo().getTable().equals(this.tableName)) {
         key = entry.getKey();
         break;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
index 5ac7efb..04dcb14 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
@@ -99,7 +99,7 @@ public class TestStoreFileRefresherChore {
     }
   }
 
-  private Region initHRegion(HTableDescriptor htd, byte[] startKey, byte[] stopKey, int replicaId)
+  private HRegion initHRegion(HTableDescriptor htd, byte[] startKey, byte[] stopKey, int replicaId)
       throws IOException {
     Configuration conf = TEST_UTIL.getConfiguration();
     Path tableDir = FSUtils.getTableDir(testDir, htd.getTableName());
@@ -171,14 +171,14 @@ public class TestStoreFileRefresherChore {
     byte[] qf = Bytes.toBytes("cq");
 
     HRegionServer regionServer = mock(HRegionServer.class);
-    List<Region> regions = new ArrayList<>();
+    List<HRegion> regions = new ArrayList<>();
     when(regionServer.getOnlineRegionsLocalContext()).thenReturn(regions);
     when(regionServer.getConfiguration()).thenReturn(TEST_UTIL.getConfiguration());
 
     HTableDescriptor htd = getTableDesc(TableName.valueOf(name.getMethodName()), families);
     htd.setRegionReplication(2);
-    Region primary = initHRegion(htd, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, 0);
-    Region replica1 = initHRegion(htd, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, 1);
+    HRegion primary = initHRegion(htd, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, 0);
+    HRegion replica1 = initHRegion(htd, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, 1);
     regions.add(primary);
     regions.add(replica1);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java
index 4d0a168..a012d09 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java
@@ -141,7 +141,7 @@ public class TestWalAndCompactingMemStoreFlush {
         String.valueOf(MemoryCompactionPolicy.EAGER));
 
     // Intialize the region
-    Region region = initHRegion("testSelectiveFlushWithEager", conf);
+    HRegion region = initHRegion("testSelectiveFlushWithEager", conf);
     verifyInMemoryFlushSize(region);
     // Add 1200 entries for CF1, 100 for CF2 and 50 for CF3
     for (int i = 1; i <= 1200; i++) {
@@ -382,7 +382,7 @@ public class TestWalAndCompactingMemStoreFlush {
         String.valueOf(MemoryCompactionPolicy.BASIC));
 
     // Initialize the region
-    Region region = initHRegion("testSelectiveFlushWithIndexCompaction", conf);
+    HRegion region = initHRegion("testSelectiveFlushWithIndexCompaction", conf);
     verifyInMemoryFlushSize(region);
     /*------------------------------------------------------------------------------*/
     /* PHASE I - insertions */

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
index 5afa52f..773a786 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -44,7 +43,6 @@ import org.apache.hadoop.hbase.regionserver.CompactedHFilesDischarger;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HStore;
 import org.apache.hadoop.hbase.regionserver.HStoreFile;
-import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.regionserver.RegionScanner;
 import org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
@@ -54,6 +52,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.mockito.Mockito;
 
 @Category({ MediumTests.class, RegionServerTests.class })
 public class TestCompactedHFilesDischarger {
@@ -76,9 +75,9 @@ public class TestCompactedHFilesDischarger {
     Path path = testUtil.getDataTestDir(getClass().getSimpleName());
     region = HBaseTestingUtility.createRegionAndWAL(info, path, testUtil.getConfiguration(), htd);
     rss = mock(RegionServerServices.class);
-    List<Region> regions = new ArrayList<>(1);
+    List<HRegion> regions = new ArrayList<>(1);
     regions.add(region);
-    when(rss.getRegions()).thenReturn(regions);
+    Mockito.doReturn(regions).when(rss).getRegions();
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
index ca6c86b..3c1228e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
@@ -165,7 +165,7 @@ public class TestFlushWithThroughputController {
     HRegionServer regionServer = hbtu.getRSForFirstRegionInTable(tableName);
     PressureAwareFlushThroughputController throughputController =
         (PressureAwareFlushThroughputController) regionServer.getFlushThroughputController();
-    for (Region region : regionServer.getRegions()) {
+    for (HRegion region : regionServer.getRegions()) {
       region.flush(true);
     }
     assertEquals(0.0, regionServer.getFlushPressure(), EPSILON);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
index 8ff1823..68d71b0 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.regionserver.Store;
@@ -195,7 +196,7 @@ public abstract class AbstractTestLogRolling  {
     assertLogFileSize(log);
 
     // flush all regions
-    for (Region r : server.getOnlineRegionsLocalContext()) {
+    for (HRegion r : server.getOnlineRegionsLocalContext()) {
       r.flush(true);
     }
 
@@ -248,7 +249,7 @@ public abstract class AbstractTestLogRolling  {
       table = createTestTable(getName());
 
       server = TEST_UTIL.getRSForFirstRegionInTable(table.getName());
-      Region region = server.getRegions(table.getName()).get(0);
+      HRegion region = server.getRegions(table.getName()).get(0);
       final WAL log = server.getWAL(region.getRegionInfo());
       Store s = region.getStore(HConstants.CATALOG_FAMILY);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java
index 096d3ca..63c904d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java
@@ -350,7 +350,7 @@ public abstract class AbstractTestWALReplay {
     Region region2 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd);
     HBaseTestingUtility.closeRegionAndWAL(region2);
     WAL wal = createWAL(this.conf, hbaseRootDir, logName);
-    Region region = HRegion.openHRegion(hri, htd, wal, this.conf);
+    HRegion region = HRegion.openHRegion(hri, htd, wal, this.conf);
 
     byte [] family = htd.getFamilies().iterator().next().getName();
     Path f =  new Path(basedir, "hfile");
@@ -1117,7 +1117,7 @@ public abstract class AbstractTestWALReplay {
     private HRegion r;
 
     @Override
-    public void requestFlush(Region region, boolean force) {
+    public void requestFlush(HRegion region, boolean force) {
       try {
         r.flush(force);
       } catch (IOException e) {
@@ -1126,7 +1126,7 @@ public abstract class AbstractTestWALReplay {
     }
 
     @Override
-    public void requestDelayedFlush(Region region, long when, boolean forceFlushAllStores) {
+    public void requestDelayedFlush(HRegion region, long when, boolean forceFlushAllStores) {
       // TODO Auto-generated method stub
 
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
index 17416ba..654330c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
@@ -41,7 +41,6 @@ import org.apache.hadoop.hbase.regionserver.ChunkCreator;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.MemStoreLABImpl;
 import org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl;
-import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -183,7 +182,7 @@ public class TestFSHLog extends AbstractTestFSWAL {
         @Override
         public void run() {
           try {
-            Region.FlushResult flushResult = region.flush(true);
+            HRegion.FlushResult flushResult = region.flush(true);
             LOG.info("Flush result:" +  flushResult.getResult());
             LOG.info("Flush succeeded:" +  flushResult.isFlushSucceeded());
             flushFinished.countDown();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
index 295ac2f..088ad48 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
@@ -47,6 +47,7 @@ import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.fs.HFileSystem;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.testclassification.VerySlowRegionServerTests;
@@ -345,7 +346,7 @@ public class TestLogRolling extends AbstractTestLogRolling {
       assertTrue(loggedRows.contains("row1005"));
 
       // flush all regions
-      for (Region r : server.getOnlineRegionsLocalContext()) {
+      for (HRegion r : server.getOnlineRegionsLocalContext()) {
         try {
           r.flush(true);
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java
index 8068130..910449b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java
@@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.client.RegionLocator;
 import org.apache.hadoop.hbase.client.RpcRetryingCallerImpl;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.client.replication.ReplicationAdmin;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.wal.WAL.Entry;
@@ -247,8 +248,8 @@ public class TestRegionReplicaReplicationEndpoint {
 
     for (int i=0; i < NB_SERVERS; i++) {
       HRegionServer rs = HTU.getMiniHBaseCluster().getRegionServer(i);
-      List<Region> onlineRegions = rs.getRegions(tableName);
-      for (Region region : onlineRegions) {
+      List<HRegion> onlineRegions = rs.getRegions(tableName);
+      for (HRegion region : onlineRegions) {
         regions[region.getRegionInfo().getReplicaId()] = region;
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java
index 29bce1a..4992135 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java
@@ -307,7 +307,7 @@ public abstract class TestVisibilityLabels {
         List<RegionServerThread> regionServerThreads = TEST_UTIL.getHBaseCluster()
             .getRegionServerThreads();
         for (RegionServerThread rsThread : regionServerThreads) {
-          List<Region> onlineRegions = rsThread.getRegionServer().getRegions(
+          List<HRegion> onlineRegions = rsThread.getRegionServer().getRegions(
               LABELS_TABLE_NAME);
           if (onlineRegions.size() > 0) {
             rsThread.getRegionServer().abort("Aborting ");
@@ -341,7 +341,7 @@ public abstract class TestVisibilityLabels {
     for (RegionServerThread rsThread : regionServerThreads) {
       while (true) {
         if (!rsThread.getRegionServer().isAborted()) {
-          List<Region> onlineRegions = rsThread.getRegionServer().getRegions(
+          List<HRegion> onlineRegions = rsThread.getRegionServer().getRegions(
               LABELS_TABLE_NAME);
           if (onlineRegions.size() > 0) {
             break;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b212bf93/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
index c0cb9e7..cf17e52 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
@@ -61,6 +61,7 @@ import org.apache.hadoop.hbase.io.HFileLink;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.MasterFileSystem;
 import org.apache.hadoop.hbase.mob.MobUtils;
+import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.Region;
@@ -759,8 +760,8 @@ public final class SnapshotTestingUtils {
                                             final TableName tableName)
       throws IOException, InterruptedException {
     HRegionServer rs = util.getRSForFirstRegionInTable(tableName);
-    List<Region> onlineRegions = rs.getRegions(tableName);
-    for (Region region : onlineRegions) {
+    List<HRegion> onlineRegions = rs.getRegions(tableName);
+    for (HRegion region : onlineRegions) {
       region.waitForFlushesAndCompactions();
     }
     // Wait up to 60 seconds for a table to be available.


Mime
View raw message