hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject [2/2] hbase git commit: HBASE-18298 RegionServerServices Interface cleanup for CP expose.
Date Wed, 27 Sep 2017 05:32:22 GMT
HBASE-18298 RegionServerServices Interface cleanup for CP expose.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bd68551f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bd68551f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bd68551f

Branch: refs/heads/master
Commit: bd68551f26832da745d9d38ad2e259f8ca32bfff
Parents: 417dad6
Author: anoopsamjohn <anoopsamjohn@gmail.com>
Authored: Wed Sep 27 11:01:51 2017 +0530
Committer: anoopsamjohn <anoopsamjohn@gmail.com>
Committed: Wed Sep 27 11:01:51 2017 +0530

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/Abortable.java |  4 +-
 .../security/access/SecureBulkLoadEndpoint.java | 13 ++--
 .../example/ZooKeeperScanPolicyObserver.java    | 25 +++++++-
 .../hbase/mapreduce/TestImportExport.java       |  4 +-
 .../hbase/rsgroup/TestRSGroupsOfflineMode.java  |  4 +-
 .../java/org/apache/hadoop/hbase/Server.java    |  6 +-
 .../hbase/client/CoprocessorHConnection.java    |  4 +-
 .../RegionCoprocessorEnvironment.java           |  4 +-
 .../RegionServerCoprocessorEnvironment.java     |  9 ++-
 .../RegionServerFlushTableProcedureManager.java |  2 +-
 .../quotas/FileSystemUtilizationChore.java      |  2 +-
 .../regionserver/CompactedHFilesDischarger.java |  2 +-
 .../CoprocessorRegionServerServices.java        | 64 ++++++++++++++++++++
 .../regionserver/FavoredNodesForRegion.java     |  9 +--
 .../hbase/regionserver/HRegionServer.java       | 18 +++---
 .../regionserver/ImmutableOnlineRegions.java    | 60 ++++++++++++++++++
 ...IncreasingToUpperBoundRegionSplitPolicy.java |  2 +-
 .../hadoop/hbase/regionserver/LogRoller.java    |  2 +-
 .../hbase/regionserver/OnlineRegions.java       | 43 ++-----------
 .../hbase/regionserver/RSDumpServlet.java       |  2 +-
 .../hbase/regionserver/RSRpcServices.java       | 10 +--
 .../regionserver/RegionCoprocessorHost.java     |  2 +-
 .../RegionServerCoprocessorHost.java            |  2 +-
 .../regionserver/RegionServerServices.java      | 30 ++-------
 .../regionserver/StorefileRefresherChore.java   |  2 +-
 .../handler/CloseRegionHandler.java             |  4 +-
 .../regionserver/handler/OpenRegionHandler.java |  6 +-
 .../snapshot/RegionServerSnapshotManager.java   |  2 +-
 .../regionserver/ReplicationObserver.java       |  2 +-
 .../hbase/security/access/AccessController.java |  7 ++-
 .../hbase/security/token/TokenProvider.java     |  5 +-
 .../DefaultVisibilityLabelServiceImpl.java      |  5 +-
 .../hbase-webapps/regionserver/region.jsp       |  2 +-
 .../hadoop/hbase/HBaseTestingUtility.java       |  2 +-
 .../apache/hadoop/hbase/MiniHBaseCluster.java   |  2 +-
 .../hadoop/hbase/MockRegionServerServices.java  | 14 ++---
 .../hadoop/hbase/TestGlobalMemStoreSize.java    |  8 +--
 .../hadoop/hbase/backup/TestHFileArchiving.java |  4 +-
 .../TestZooKeeperTableArchiveClient.java        |  6 +-
 .../client/TestAsyncMetaRegionLocator.java      |  2 +-
 .../client/TestAsyncNonMetaRegionLocator.java   |  4 +-
 .../hbase/client/TestAsyncRegionAdminApi.java   |  6 +-
 ...estAvoidCellReferencesIntoShippedBlocks.java |  4 +-
 .../client/TestBlockEvictionFromClient.java     | 36 ++++-------
 .../hadoop/hbase/client/TestClientPushback.java |  4 +-
 .../hadoop/hbase/client/TestFromClientSide.java |  6 +-
 .../hbase/client/TestFromClientSide3.java       |  2 +-
 .../org/apache/hadoop/hbase/client/TestHCM.java |  2 +-
 .../hbase/client/TestMultiRespectsLimits.java   |  2 +-
 .../hbase/client/TestReplicaWithCluster.java    | 14 +++--
 .../hbase/coprocessor/SimpleRegionObserver.java |  7 ---
 .../TestRegionObserverScannerOpenHook.java      |  2 +-
 .../hadoop/hbase/fs/TestBlockReorder.java       |  2 +-
 .../hadoop/hbase/master/MockRegionServer.java   | 10 +--
 .../hbase/master/TestAssignmentListener.java    |  4 +-
 .../master/TestGetLastFlushedSequenceId.java    |  2 +-
 .../hadoop/hbase/master/TestMasterFailover.java |  4 +-
 .../hbase/master/TestRegionPlacement.java       |  2 +-
 .../TestFavoredStochasticLoadBalancer.java      |  2 +-
 .../balancer/TestRegionLocationFinder.java      |  8 +--
 .../balancer/TestRegionsOnMasterOptions.java    |  6 +-
 .../master/cleaner/TestSnapshotFromMaster.java  |  2 +-
 .../quotas/TestFileSystemUtilizationChore.java  | 16 ++---
 .../TestCompactionArchiveConcurrentClose.java   |  2 +-
 .../TestCompactionArchiveIOException.java       |  2 +-
 .../TestCompactionFileNotFound.java             |  2 +-
 .../TestCompactionInDeadRegionServer.java       |  4 +-
 .../hbase/regionserver/TestCompactionState.java |  2 +-
 .../regionserver/TestEncryptionKeyRotation.java |  6 +-
 .../TestEncryptionRandomKeying.java             |  2 +-
 .../regionserver/TestHRegionReplayEvents.java   |  4 +-
 .../regionserver/TestPerColumnFamilyFlush.java  |  2 +-
 .../regionserver/TestRegionFavoredNodes.java    |  4 +-
 .../regionserver/TestRegionReplicaFailover.java |  6 +-
 .../hbase/regionserver/TestRegionReplicas.java  |  8 +--
 .../regionserver/TestRegionServerAbort.java     |  2 +-
 .../regionserver/TestRegionServerMetrics.java   |  2 +-
 .../regionserver/TestRegionSplitPolicy.java     |  4 +-
 .../regionserver/TestSplitWalDataLoss.java      |  2 +-
 .../TestCompactedHFilesDischarger.java          |  2 +-
 .../compactions/TestFIFOCompactionPolicy.java   |  2 +-
 .../TestCompactionWithThroughputController.java |  2 +-
 .../TestFlushWithThroughputController.java      |  4 +-
 .../wal/AbstractTestLogRolling.java             |  4 +-
 .../regionserver/wal/TestAsyncLogRolling.java   |  2 +-
 .../hbase/regionserver/wal/TestLogRolling.java  |  4 +-
 .../TestRegionReplicaReplicationEndpoint.java   |  2 +-
 ...egionReplicaReplicationEndpointNoMaster.java |  8 +--
 .../security/access/TestAccessController.java   |  4 +-
 .../security/token/TestTokenAuthentication.java |  3 +-
 .../visibility/TestVisibilityLabels.java        |  8 +--
 .../hbase/snapshot/SnapshotTestingUtils.java    |  2 +-
 .../hbase/util/TestHBaseFsckEncryption.java     |  2 +-
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java   |  2 +-
 .../hadoop/hbase/wal/TestWALFiltering.java      |  2 +-
 .../hbase/thrift/ErrorThrowingGetObserver.java  |  2 +-
 96 files changed, 368 insertions(+), 284 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-client/src/main/java/org/apache/hadoop/hbase/Abortable.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/Abortable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/Abortable.java
index c2785a0..8233071 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/Abortable.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/Abortable.java
@@ -19,7 +19,6 @@
 package org.apache.hadoop.hbase;
 
 import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.yetus.audience.InterfaceStability;
 
 /**
  * Interface to support the aborting of a given server or client.
@@ -29,8 +28,7 @@ import org.apache.yetus.audience.InterfaceStability;
  * <p>
  * Implemented by the Master, RegionServer, and TableServers (client).
  */
-@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
-@InterfaceStability.Evolving
+@InterfaceAudience.Private
 public interface Abortable {
   /**
    * Abort the server or client.

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-endpoint/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-endpoint/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java b/hbase-endpoint/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
index 2a4b4f3..3f8b3bb 100644
--- a/hbase-endpoint/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
+++ b/hbase-endpoint/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
@@ -42,6 +42,7 @@ import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.Re
 import org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos.SecureBulkLoadHFilesRequest;
 import org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos.SecureBulkLoadHFilesResponse;
 import org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos.SecureBulkLoadService;
+import org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.hadoop.hbase.regionserver.SecureBulkLoadManager;
 
 import com.google.protobuf.RpcCallback;
@@ -62,10 +63,13 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
   private static final Log LOG = LogFactory.getLog(SecureBulkLoadEndpoint.class);
 
   private RegionCoprocessorEnvironment env;
+  private RegionServerServices rsServices;
 
   @Override
   public void start(CoprocessorEnvironment env) {
     this.env = (RegionCoprocessorEnvironment)env;
+    assert this.env.getCoprocessorRegionServerServices() instanceof RegionServerServices;
+    rsServices = (RegionServerServices) this.env.getCoprocessorRegionServerServices();
     LOG.warn("SecureBulkLoadEndpoint is deprecated. It will be removed in future releases.");
     LOG.warn("Secure bulk load has been integrated into HBase core.");
   }
@@ -78,8 +82,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
   public void prepareBulkLoad(RpcController controller, PrepareBulkLoadRequest request,
       RpcCallback<PrepareBulkLoadResponse> done) {
     try {
-      SecureBulkLoadManager secureBulkLoadManager =
-          this.env.getRegionServerServices().getSecureBulkLoadManager();
+      SecureBulkLoadManager secureBulkLoadManager = this.rsServices.getSecureBulkLoadManager();
 
       String bulkToken = secureBulkLoadManager.prepareBulkLoad(this.env.getRegion(),
           convert(request));
@@ -106,8 +109,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
   public void cleanupBulkLoad(RpcController controller, CleanupBulkLoadRequest request,
       RpcCallback<CleanupBulkLoadResponse> done) {
     try {
-      SecureBulkLoadManager secureBulkLoadManager =
-          this.env.getRegionServerServices().getSecureBulkLoadManager();
+      SecureBulkLoadManager secureBulkLoadManager = this.rsServices.getSecureBulkLoadManager();
       secureBulkLoadManager.cleanupBulkLoad(this.env.getRegion(), convert(request));
       done.run(CleanupBulkLoadResponse.newBuilder().build());
     } catch (IOException e) {
@@ -138,8 +140,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
     boolean loaded = false;
     Map<byte[], List<Path>> map = null;
     try {
-      SecureBulkLoadManager secureBulkLoadManager =
-          this.env.getRegionServerServices().getSecureBulkLoadManager();
+      SecureBulkLoadManager secureBulkLoadManager = this.rsServices.getSecureBulkLoadManager();
       BulkLoadHFileRequest bulkLoadHFileRequest = ConvertSecureBulkLoadHFilesRequest(request);
       map = secureBulkLoadManager.secureBulkLoadHFiles(this.env.getRegion(),
           convert(bulkLoadHFileRequest));

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ZooKeeperScanPolicyObserver.java
----------------------------------------------------------------------
diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ZooKeeperScanPolicyObserver.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ZooKeeperScanPolicyObserver.java
index a730403..7b8fdf3 100644
--- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ZooKeeperScanPolicyObserver.java
+++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/ZooKeeperScanPolicyObserver.java
@@ -65,10 +65,17 @@ import org.apache.zookeeper.ZooKeeper;
  * listeners registered with ZooKeeperWatcher cannot be removed.
  */
 public class ZooKeeperScanPolicyObserver implements RegionObserver {
+  // The zk ensemble info is put in hbase config xml with given custom key.
+  public static final String ZK_ENSEMBLE_KEY = "ZooKeeperScanPolicyObserver.zookeeper.ensemble";
+  public static final String ZK_SESSION_TIMEOUT_KEY =
+      "ZooKeeperScanPolicyObserver.zookeeper.session.timeout";
+  public static final int ZK_SESSION_TIMEOUT_DEFAULT = 30 * 1000; // 30 secs
   public static final String node = "/backup/example/lastbackup";
   public static final String zkkey = "ZK";
   private static final Log LOG = LogFactory.getLog(ZooKeeperScanPolicyObserver.class);
 
+  private ZooKeeper zk = null;
+
   /**
    * Internal watcher that keep "data" up to date asynchronously.
    */
@@ -165,8 +172,22 @@ public class ZooKeeperScanPolicyObserver implements RegionObserver {
     if (!re.getSharedData().containsKey(zkkey)) {
       // there is a short race here
       // in the worst case we create a watcher that will be notified once
-      re.getSharedData().putIfAbsent(zkkey, new ZKWatcher(
-          re.getRegionServerServices().getZooKeeper().getRecoverableZooKeeper().getZooKeeper()));
+      String ensemble = re.getConfiguration().get(ZK_ENSEMBLE_KEY);
+      int sessionTimeout = re.getConfiguration().getInt(ZK_SESSION_TIMEOUT_KEY,
+          ZK_SESSION_TIMEOUT_DEFAULT);
+      this.zk = new ZooKeeper(ensemble, sessionTimeout, null);
+      re.getSharedData().putIfAbsent(zkkey, new ZKWatcher(zk));
+    }
+  }
+
+  @Override
+  public void stop(CoprocessorEnvironment env) throws IOException {
+    if (this.zk != null) {
+      try {
+        this.zk.close();
+      } catch (InterruptedException e) {
+        LOG.error("Excepion while closing the ZK connection!", e);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java
index 97665b1..b581e04 100644
--- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java
+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java
@@ -740,7 +740,7 @@ public class TestImportExport {
 
       // Register the wal listener for the import table
       HRegionInfo region = UTIL.getHBaseCluster().getRegionServerThreads().get(0).getRegionServer()
-          .getOnlineRegions(importTable.getName()).get(0).getRegionInfo();
+          .getRegions(importTable.getName()).get(0).getRegionInfo();
       TableWALActionListener walListener = new TableWALActionListener(region);
       WAL wal = UTIL.getMiniHBaseCluster().getRegionServer(0).getWAL(region);
       wal.registerWALActionsListener(walListener);
@@ -759,7 +759,7 @@ public class TestImportExport {
       importTableName = name.getMethodName() + "import2";
       importTable = UTIL.createTable(TableName.valueOf(importTableName), FAMILYA, 3);
       region = UTIL.getHBaseCluster().getRegionServerThreads().get(0).getRegionServer()
-          .getOnlineRegions(importTable.getName()).get(0).getRegionInfo();
+          .getRegions(importTable.getName()).get(0).getRegionInfo();
       wal = UTIL.getMiniHBaseCluster().getRegionServer(0).getWAL(region);
       walListener = new TableWALActionListener(region);
       wal.registerWALActionsListener(walListener);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java
----------------------------------------------------------------------
diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java
index 691f8d3..f3040af 100644
--- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java
+++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java
@@ -176,10 +176,10 @@ public class TestRSGroupsOfflineMode {
     TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate<Exception>() {
       @Override
       public boolean evaluate() throws Exception {
-        return failoverRS.getOnlineRegions(failoverTable).size() >= 1;
+        return failoverRS.getRegions(failoverTable).size() >= 1;
       }
     });
-    Assert.assertEquals(0, failoverRS.getOnlineRegions(RSGroupInfoManager.RSGROUP_TABLE_NAME).size());
+    Assert.assertEquals(0, failoverRS.getRegions(RSGroupInfoManager.RSGROUP_TABLE_NAME).size());
 
     // Need this for minicluster to shutdown cleanly.
     master.stopMaster();

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java
index d6492eb..f9cb3be 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java
@@ -19,19 +19,17 @@
 package org.apache.hadoop.hbase;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.yetus.audience.InterfaceStability;
 import org.apache.hadoop.hbase.client.ClusterConnection;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.zookeeper.MetaTableLocator;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * Defines the set of shared functions implemented by HBase servers (Masters
  * and RegionServers).
  */
-@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
-@InterfaceStability.Evolving
+@InterfaceAudience.Private
 public interface Server extends Abortable, Stoppable {
   /**
    * Gets the configuration object for this server.

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/client/CoprocessorHConnection.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/CoprocessorHConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/CoprocessorHConnection.java
index 519d5f0..c87c56e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/CoprocessorHConnection.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/CoprocessorHConnection.java
@@ -25,8 +25,8 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.yetus.audience.InterfaceStability;
 import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
+import org.apache.hadoop.hbase.regionserver.CoprocessorRegionServerServices;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
-import org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.hadoop.hbase.security.UserProvider;
 
 /**
@@ -54,7 +54,7 @@ public class CoprocessorHConnection extends ConnectionImplementation {
     // this bit is a little hacky - just trying to get it going for the moment
     if (env instanceof RegionCoprocessorEnvironment) {
       RegionCoprocessorEnvironment e = (RegionCoprocessorEnvironment) env;
-      RegionServerServices services = e.getRegionServerServices();
+      CoprocessorRegionServerServices services = e.getCoprocessorRegionServerServices();
       if (services instanceof HRegionServer) {
         return new CoprocessorHConnection((HRegionServer) services);
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java
index 2a3d62c..dceb3d4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java
@@ -25,8 +25,8 @@ import org.apache.hadoop.hbase.CoprocessorEnvironment;
 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
 import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.metrics.MetricRegistry;
+import org.apache.hadoop.hbase.regionserver.CoprocessorRegionServerServices;
 import org.apache.hadoop.hbase.regionserver.Region;
-import org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.yetus.audience.InterfaceStability;
 
@@ -40,7 +40,7 @@ public interface RegionCoprocessorEnvironment extends CoprocessorEnvironment {
   RegionInfo getRegionInfo();
 
   /** @return reference to the region server services */
-  RegionServerServices getRegionServerServices();
+  CoprocessorRegionServerServices getCoprocessorRegionServerServices();
 
   /** @return shared data between all instances of this coprocessor */
   ConcurrentMap<String, Object> getSharedData();

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerCoprocessorEnvironment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerCoprocessorEnvironment.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerCoprocessorEnvironment.java
index f42556a..da3189f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerCoprocessorEnvironment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerCoprocessorEnvironment.java
@@ -19,16 +19,21 @@
 package org.apache.hadoop.hbase.coprocessor;
 
 import org.apache.hadoop.hbase.CoprocessorEnvironment;
+import org.apache.hadoop.hbase.HBaseInterfaceAudience;
 import org.apache.hadoop.hbase.metrics.MetricRegistry;
-import org.apache.hadoop.hbase.regionserver.RegionServerServices;
+import org.apache.hadoop.hbase.regionserver.CoprocessorRegionServerServices;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
 
+@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
+@InterfaceStability.Evolving
 public interface RegionServerCoprocessorEnvironment extends CoprocessorEnvironment {
   /**
    * Gets the region server services.
    *
    * @return the region server services
    */
-  RegionServerServices getRegionServerServices();
+  CoprocessorRegionServerServices getCoprocessorRegionServerServices();
 
   /**
    * Returns a MetricRegistry that can be used to track metrics at the region server level.

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
index 4747e5c..49192e1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
@@ -175,7 +175,7 @@ public class RegionServerFlushTableProcedureManager extends RegionServerProcedur
    * @throws IOException
    */
   private List<Region> getRegionsToFlush(String table) throws IOException {
-    return rss.getOnlineRegions(TableName.valueOf(table));
+    return rss.getRegions(TableName.valueOf(table));
   }
 
   public class FlushTableSubprocedureBuilder implements SubprocedureFactory {

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.java
index c5f1db5..89d7e14 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.java
@@ -77,7 +77,7 @@ public class FileSystemUtilizationChore extends ScheduledChore {
       return;
     }
     final Map<HRegionInfo,Long> onlineRegionSizes = new HashMap<>();
-    final Set<Region> onlineRegions = new HashSet<>(rs.getOnlineRegions());
+    final Set<Region> onlineRegions = new HashSet<>(rs.getRegions());
     // Process the regions from the last run if we have any. If we are somehow having difficulty
     // processing the Regions, we want to avoid creating a backlog in memory of Region objs.
     Iterator<Region> oldRegionsToProcess = getLeftoverRegions();

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactedHFilesDischarger.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactedHFilesDischarger.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactedHFilesDischarger.java
index cdeaf2c..021bb56 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactedHFilesDischarger.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactedHFilesDischarger.java
@@ -89,7 +89,7 @@ public class CompactedHFilesDischarger extends ScheduledChore {
     // Noop if rss is null. This will never happen in a normal condition except for cases
     // when the test case is not spinning up a cluster
     if (regionServerServices == null) return;
-    List<Region> onlineRegions = regionServerServices.getOnlineRegions();
+    List<Region> onlineRegions = regionServerServices.getRegions();
     if (onlineRegions == null) return;
     for (Region region : onlineRegions) {
       if (LOG.isTraceEnabled()) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CoprocessorRegionServerServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CoprocessorRegionServerServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CoprocessorRegionServerServices.java
new file mode 100644
index 0000000..3d70793
--- /dev/null
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CoprocessorRegionServerServices.java
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import java.util.Set;
+
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.hbase.HBaseInterfaceAudience;
+import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
+
+/**
+ * Services exposed to CPs by {@link HRegionServer}
+ */
+@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
+@InterfaceStability.Evolving
+public interface CoprocessorRegionServerServices extends ImmutableOnlineRegions {
+
+  /**
+   * @return True if this regionserver is stopping.
+   */
+  boolean isStopping();
+
+  /**
+   * @return Return the FileSystem object used by the regionserver
+   */
+  FileSystem getFileSystem();
+
+  /**
+   * @return all the online tables in this RS
+   */
+  Set<TableName> getOnlineTables();
+
+  /**
+   * Returns a reference to the servers' connection.
+   *
+   * Important note: this method returns a reference to Connection which is managed
+   * by Server itself, so callers must NOT attempt to close connection obtained.
+   */
+  Connection getConnection();
+
+  /**
+   * @return The unique server name for this server.
+   */
+  ServerName getServerName();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/FavoredNodesForRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/FavoredNodesForRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/FavoredNodesForRegion.java
index 72e0383..e34a9d0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/FavoredNodesForRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/FavoredNodesForRegion.java
@@ -19,19 +19,16 @@
 package org.apache.hadoop.hbase.regionserver;
 
 import java.net.InetSocketAddress;
-import java.util.List; 
+import java.util.List;
 
-import org.apache.hadoop.hbase.HBaseInterfaceAudience;
-import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.yetus.audience.InterfaceStability;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * Abstraction that allows different modules in RegionServer to update/get
  * the favored nodes information for regions. 
  */
-@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
-@InterfaceStability.Evolving
+@InterfaceAudience.Private
 public interface FavoredNodesForRegion {
   /**
    * Used to update the favored nodes mapping when required.

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 394826c..62080d7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -2757,7 +2757,7 @@ public class HRegionServer extends HasThread implements
   }
 
   @Override
-  public void addToOnlineRegions(Region region) {
+  public void addRegion(Region region) {
     this.onlineRegions.put(region.getRegionInfo().getEncodedName(), region);
     configurationManager.registerObserver(region);
   }
@@ -3003,7 +3003,7 @@ public class HRegionServer extends HasThread implements
    * @return Online regions from <code>tableName</code>
    */
   @Override
-  public List<Region> getOnlineRegions(TableName tableName) {
+  public List<Region> getRegions(TableName tableName) {
      List<Region> tableRegions = new ArrayList<>();
      synchronized (this.onlineRegions) {
        for (Region region: this.onlineRegions.values()) {
@@ -3017,7 +3017,7 @@ public class HRegionServer extends HasThread implements
    }
 
   @Override
-  public List<Region> getOnlineRegions() {
+  public List<Region> getRegions() {
     List<Region> allRegions = new ArrayList<>();
     synchronized (this.onlineRegions) {
       // Return a clone copy of the onlineRegions
@@ -3103,7 +3103,7 @@ public class HRegionServer extends HasThread implements
   protected boolean closeRegion(String encodedName, final boolean abort, final ServerName sn)
       throws NotServingRegionException {
     //Check for permissions to close.
-    Region actualRegion = this.getFromOnlineRegions(encodedName);
+    Region actualRegion = this.getRegion(encodedName);
     // Can be null if we're calling close on a region that's not online
     if ((actualRegion != null) && (actualRegion.getCoprocessorHost() != null)) {
       try {
@@ -3128,7 +3128,7 @@ public class HRegionServer extends HasThread implements
         return closeRegion(encodedName, abort, sn);
       }
       // Let's get the region from the online region list again
-      actualRegion = this.getFromOnlineRegions(encodedName);
+      actualRegion = this.getRegion(encodedName);
       if (actualRegion == null) { // If already online, we still need to close it.
         LOG.info("The opening previously in progress has been cancelled by a CLOSE request.");
         // The master deletes the znode when it receives this exception.
@@ -3170,7 +3170,7 @@ public class HRegionServer extends HasThread implements
  protected boolean closeAndOfflineRegionForSplitOrMerge(
      final List<String> regionEncodedName) throws IOException {
    for (int i = 0; i < regionEncodedName.size(); ++i) {
-     Region regionToClose = this.getFromOnlineRegions(regionEncodedName.get(i));
+     Region regionToClose = this.getRegion(regionEncodedName.get(i));
      if (regionToClose != null) {
        Map<byte[], List<HStoreFile>> hstoreFiles = null;
        Exception exceptionToThrow = null;
@@ -3211,7 +3211,7 @@ public class HRegionServer extends HasThread implements
          MetaTableAccessor.putToMetaTable(getConnection(), finalBarrier);
        }
        // Offline the region
-       this.removeFromOnlineRegions(regionToClose, null);
+       this.removeRegion(regionToClose, null);
      }
    }
    return true;
@@ -3232,13 +3232,13 @@ public class HRegionServer extends HasThread implements
   }
 
   @Override
-  public Region getFromOnlineRegions(final String encodedRegionName) {
+  public Region getRegion(final String encodedRegionName) {
     return this.onlineRegions.get(encodedRegionName);
   }
 
 
   @Override
-  public boolean removeFromOnlineRegions(final Region r, ServerName destination) {
+  public boolean removeRegion(final Region r, ServerName destination) {
     Region toReturn = this.onlineRegions.remove(r.getRegionInfo().getEncodedName());
     if (destination != null) {
       long closeSeqNum = r.getMaxFlushedSeqId();

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableOnlineRegions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableOnlineRegions.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableOnlineRegions.java
new file mode 100644
index 0000000..3b84665
--- /dev/null
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableOnlineRegions.java
@@ -0,0 +1,60 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.hadoop.hbase.HBaseInterfaceAudience;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.yetus.audience.InterfaceStability;
+
+/**
+ * Interface to Map of online regions.  In the  Map, the key is the region's
+ * encoded name and the value is an {@link Region} instance.
+ */
+@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
+@InterfaceStability.Evolving
+public interface ImmutableOnlineRegions {
+
+  /**
+   * Return {@link Region} instance.
+   * Only works if caller is in same context, in same JVM. Region is not
+   * serializable.
+   * @param encodedRegionName
+   * @return Region for the passed encoded <code>encodedRegionName</code> or
+   * null if named region is not member of the online regions.
+   */
+  Region getRegion(String encodedRegionName);
+
+   /**
+    * Get all online regions of a table in this RS.
+    * @param tableName
+    * @return List of Region
+    * @throws java.io.IOException
+    */
+   List<Region> getRegions(TableName tableName) throws IOException;
+
+   /**
+    * Get all online regions in this RS.
+    * @return List of online Region
+    */
+   List<Region> getRegions();
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java
index 2184863..17abb77 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/IncreasingToUpperBoundRegionSplitPolicy.java
@@ -110,7 +110,7 @@ public class IncreasingToUpperBoundRegionSplitPolicy extends ConstantSizeRegionS
     TableName tablename = region.getTableDescriptor().getTableName();
     int tableRegionsCount = 0;
     try {
-      List<Region> hri = rss.getOnlineRegions(tablename);
+      List<Region> hri = rss.getRegions(tablename);
       tableRegionsCount = hri == null || hri.isEmpty() ? 0 : hri.size();
     } catch (IOException e) {
       LOG.debug("Failed getOnlineRegions " + tablename, e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
index b32e877..30f9a51 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
@@ -204,7 +204,7 @@ public class LogRoller extends HasThread implements Closeable {
    */
   private void scheduleFlush(final byte [] encodedRegionName) {
     boolean scheduled = false;
-    Region r = this.services.getFromOnlineRegions(Bytes.toString(encodedRegionName));
+    Region r = this.services.getRegion(Bytes.toString(encodedRegionName));
     FlushRequester requester = null;
     if (r != null) {
       requester = this.services.getFlushRequester();

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java
index 40a3088..d389bdf 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java
@@ -18,28 +18,21 @@
  */
 package org.apache.hadoop.hbase.regionserver;
 
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.yetus.audience.InterfaceStability;
-import org.apache.hadoop.hbase.HBaseInterfaceAudience;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.Server;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * Interface to Map of online regions.  In the  Map, the key is the region's
  * encoded name and the value is an {@link Region} instance.
  */
-@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
-@InterfaceStability.Evolving
-public interface OnlineRegions extends Server {
+@InterfaceAudience.Private
+public interface OnlineRegions extends ImmutableOnlineRegions {
+
   /**
    * Add to online regions.
    * @param r
    */
-  void addToOnlineRegions(final Region r);
+  void addRegion(final Region r);
 
   /**
    * This method removes Region corresponding to hri from the Map of onlineRegions.
@@ -48,29 +41,5 @@ public interface OnlineRegions extends Server {
    * @param destination Destination, if any, null otherwise.
    * @return True if we removed a region from online list.
    */
-  boolean removeFromOnlineRegions(final Region r, ServerName destination);
-
-  /**
-   * Return {@link Region} instance.
-   * Only works if caller is in same context, in same JVM. Region is not
-   * serializable.
-   * @param encodedRegionName
-   * @return Region for the passed encoded <code>encodedRegionName</code> or
-   * null if named region is not member of the online regions.
-   */
-  Region getFromOnlineRegions(String encodedRegionName);
-
-   /**
-    * Get all online regions of a table in this RS.
-    * @param tableName
-    * @return List of Region
-    * @throws java.io.IOException
-    */
-   List<Region> getOnlineRegions(TableName tableName) throws IOException;
-
-   /**
-    * Get all online regions in this RS.
-    * @return List of online Region
-    */
-   List<Region> getOnlineRegions();
+  boolean removeRegion(final Region r, ServerName destination);
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
index 1991df0..8690b70 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
@@ -106,7 +106,7 @@ public class RSDumpServlet extends StateDumpServlet {
 
   public static void dumpRowLock(HRegionServer hrs, PrintWriter out) {
     StringBuilder sb = new StringBuilder();
-    for (Region region : hrs.getOnlineRegions()) {
+    for (Region region : hrs.getRegions()) {
       HRegion hRegion = (HRegion)region;
       if (hRegion.getLockedRows().size() > 0) {
         for (HRegion.RowLockContext rowLockContext : hRegion.getLockedRows().values()) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index ebcdbb4..e71c1eb 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -1712,9 +1712,9 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
     List<Region> regions;
     if (request.hasTableName()) {
       TableName tableName = ProtobufUtil.toTableName(request.getTableName());
-      regions = regionServer.getOnlineRegions(tableName);
+      regions = regionServer.getRegions(tableName);
     } else {
-      regions = regionServer.getOnlineRegions();
+      regions = regionServer.getRegions();
     }
     List<RegionLoad> rLoads = new ArrayList<>(regions.size());
     RegionLoad.Builder regionLoadBuilder = ClusterStatusProtos.RegionLoad.newBuilder();
@@ -1902,7 +1902,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
       try {
         String encodedName = region.getEncodedName();
         byte[] encodedNameBytes = region.getEncodedNameAsBytes();
-        final Region onlineRegion = regionServer.getFromOnlineRegions(encodedName);
+        final Region onlineRegion = regionServer.getRegion(encodedName);
         if (onlineRegion != null) {
           // The region is already online. This should not happen any more.
           String error = "Received OPEN for the region:"
@@ -1919,7 +1919,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
           encodedNameBytes, Boolean.TRUE);
 
         if (Boolean.FALSE.equals(previous)) {
-          if (regionServer.getFromOnlineRegions(encodedName) != null) {
+          if (regionServer.getRegion(encodedName) != null) {
             // There is a close in progress. This should not happen any more.
             String error = "Received OPEN for the region:"
               + region.getRegionNameAsString() + ", which we are already trying to CLOSE";
@@ -2027,7 +2027,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
       checkOpen();
       String encodedName = region.getEncodedName();
       byte[] encodedNameBytes = region.getEncodedNameAsBytes();
-      final Region onlineRegion = regionServer.getFromOnlineRegions(encodedName);
+      final Region onlineRegion = regionServer.getRegion(encodedName);
 
       if (onlineRegion != null) {
         LOG.info("Region already online. Skipping warming up " + region);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
index fe0f30e..19491b4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
@@ -138,7 +138,7 @@ public class RegionCoprocessorHost
 
     /** @return reference to the region server services */
     @Override
-    public RegionServerServices getRegionServerServices() {
+    public CoprocessorRegionServerServices getCoprocessorRegionServerServices() {
       return rsServices;
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java
index 2c80d54..5cb87b5 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java
@@ -309,7 +309,7 @@ public class RegionServerCoprocessorHost extends
     }
 
     @Override
-    public RegionServerServices getRegionServerServices() {
+    public CoprocessorRegionServerServices getCoprocessorRegionServerServices() {
       return regionServerServices;
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
index 209fce8..1d31d5a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
@@ -21,24 +21,21 @@ package org.apache.hadoop.hbase.regionserver;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.hbase.Abortable;
-import org.apache.hadoop.hbase.HBaseInterfaceAudience;
 import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.yetus.audience.InterfaceStability;
+import org.apache.hadoop.hbase.Server;
 import org.apache.hadoop.hbase.client.locking.EntityLock;
 import org.apache.hadoop.hbase.executor.ExecutorService;
 import org.apache.hadoop.hbase.ipc.RpcServerInterface;
-import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
 import org.apache.hadoop.hbase.quotas.RegionServerRpcQuotaManager;
 import org.apache.hadoop.hbase.quotas.RegionServerSpaceQuotaManager;
 import org.apache.hadoop.hbase.regionserver.throttle.ThroughputController;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
 import org.apache.hadoop.hbase.wal.WAL;
+import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.zookeeper.KeeperException;
 
 import com.google.protobuf.Service;
@@ -46,13 +43,9 @@ import com.google.protobuf.Service;
 /**
  * Services provided by {@link HRegionServer}
  */
-@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
-@InterfaceStability.Evolving
-public interface RegionServerServices extends OnlineRegions, FavoredNodesForRegion {
-  /**
-   * @return True if this regionserver is stopping.
-   */
-  boolean isStopping();
+@InterfaceAudience.Private
+public interface RegionServerServices
+    extends Server, OnlineRegions, FavoredNodesForRegion, CoprocessorRegionServerServices {
 
   /** @return the WAL for a particular region. Pass null for getting the
    * default (common) WAL */
@@ -189,11 +182,6 @@ public interface RegionServerServices extends OnlineRegions, FavoredNodesForRegi
   ConcurrentMap<byte[], Boolean> getRegionsInTransitionInRS();
 
   /**
-   * @return Return the FileSystem object used by the regionserver
-   */
-  FileSystem getFileSystem();
-
-  /**
    * @return The RegionServer's "Leases" service
    */
   Leases getLeases();
@@ -215,12 +203,6 @@ public interface RegionServerServices extends OnlineRegions, FavoredNodesForRegi
   public ServerNonceManager getNonceManager();
 
   /**
-   * @return all the online tables in this RS
-   */
-  Set<TableName> getOnlineTables();
-
-
-  /**
    * Registers a new protocol buffer {@link Service} subclass as a coprocessor endpoint to be
    * available for handling
    * @param service the {@code Service} subclass instance to expose as a coprocessor endpoint

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StorefileRefresherChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StorefileRefresherChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StorefileRefresherChore.java
index 997275a..ec66d55 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StorefileRefresherChore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StorefileRefresherChore.java
@@ -122,7 +122,7 @@ public class StorefileRefresherChore extends ScheduledChore {
     Iterator<String> lastRefreshTimesIter = lastRefreshTimes.keySet().iterator();
     while (lastRefreshTimesIter.hasNext()) {
       String encodedName = lastRefreshTimesIter.next();
-      if (regionServer.getFromOnlineRegions(encodedName) == null) {
+      if (regionServer.getRegion(encodedName) == null) {
         lastRefreshTimesIter.remove();
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
index 8debfff..5f3e472 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
@@ -90,7 +90,7 @@ public class CloseRegionHandler extends EventHandler {
       LOG.debug("Processing close of " + name);
       String encodedRegionName = regionInfo.getEncodedName();
       // Check that this region is being served here
-      HRegion region = (HRegion)rsServices.getFromOnlineRegions(encodedRegionName);
+      HRegion region = (HRegion)rsServices.getRegion(encodedRegionName);
       if (region == null) {
         LOG.warn("Received CLOSE for region " + name + " but currently not serving - ignoring");
         // TODO: do better than a simple warning
@@ -115,7 +115,7 @@ public class CloseRegionHandler extends EventHandler {
         throw new RuntimeException(ioe);
       }
 
-      this.rsServices.removeFromOnlineRegions(region, destination);
+      this.rsServices.removeRegion(region, destination);
       rsServices.reportRegionStateTransition(TransitionCode.CLOSED, regionInfo);
 
       // Done!  Region is closed on this RS

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
index 4427cff..4729c22 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
@@ -88,7 +88,7 @@ public class OpenRegionHandler extends EventHandler {
       // 2) The region is now marked as online while we're suppose to open. This would be a bug.
 
       // Check that this region is not already online
-      if (this.rsServices.getFromOnlineRegions(encodedName) != null) {
+      if (this.rsServices.getRegion(encodedName) != null) {
         LOG.error("Region " + encodedName +
             " was already online when we started processing the opening. " +
             "Marking this new attempt as failed");
@@ -119,7 +119,7 @@ public class OpenRegionHandler extends EventHandler {
       }
 
       // Successful region open, and add it to OnlineRegions
-      this.rsServices.addToOnlineRegions(region);
+      this.rsServices.addRegion(region);
       openSuccessful = true;
 
       // Done!  Successful region open
@@ -313,7 +313,7 @@ public class OpenRegionHandler extends EventHandler {
 
   void cleanupFailedOpen(final HRegion region) throws IOException {
     if (region != null) {
-      this.rsServices.removeFromOnlineRegions(region, null);
+      this.rsServices.removeRegion(region, null);
       region.close();
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java
index e43559f..775d63f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java
@@ -223,7 +223,7 @@ public class RegionServerSnapshotManager extends RegionServerProcedureManager {
    * @throws IOException
    */
   private List<Region> getRegionsToSnapshot(SnapshotDescription snapshot) throws IOException {
-    List<Region> onlineRegions = rss.getOnlineRegions(TableName.valueOf(snapshot.getTable()));
+    List<Region> onlineRegions = rss.getRegions(TableName.valueOf(snapshot.getTable()));
     Iterator<Region> iterator = onlineRegions.iterator();
     // remove the non-default regions
     while (iterator.hasNext()) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationObserver.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationObserver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationObserver.java
index d0d6181..fdb951b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationObserver.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationObserver.java
@@ -55,7 +55,7 @@ public class ReplicationObserver implements RegionObserver {
           + "data replication.");
       return;
     }
-    HRegionServer rs = (HRegionServer) env.getRegionServerServices();
+    HRegionServer rs = (HRegionServer) env.getCoprocessorRegionServerServices();
     Replication rep = (Replication) rs.getReplicationSourceService();
     rep.addHFileRefsToQueue(env.getRegionInfo().getTable(), family, pairs);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
index 5302baf..7081ea1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
@@ -104,6 +104,7 @@ import org.apache.hadoop.hbase.regionserver.InternalScanner;
 import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress;
 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.regionserver.ScanType;
 import org.apache.hadoop.hbase.regionserver.ScannerContext;
 import org.apache.hadoop.hbase.regionserver.Store;
@@ -949,12 +950,14 @@ public class AccessController implements MasterObserver, RegionObserver, RegionS
       zk = mEnv.getMasterServices().getZooKeeper();
     } else if (env instanceof RegionServerCoprocessorEnvironment) {
       RegionServerCoprocessorEnvironment rsEnv = (RegionServerCoprocessorEnvironment) env;
-      zk = rsEnv.getRegionServerServices().getZooKeeper();
+      assert rsEnv.getCoprocessorRegionServerServices() instanceof RegionServerServices;
+      zk = ((RegionServerServices) rsEnv.getCoprocessorRegionServerServices()).getZooKeeper();
     } else if (env instanceof RegionCoprocessorEnvironment) {
       // if running at region
       regionEnv = (RegionCoprocessorEnvironment) env;
       conf.addBytesMap(regionEnv.getRegion().getTableDescriptor().getValues());
-      zk = regionEnv.getRegionServerServices().getZooKeeper();
+      assert regionEnv.getCoprocessorRegionServerServices() instanceof RegionServerServices;
+      zk = ((RegionServerServices) regionEnv.getCoprocessorRegionServerServices()).getZooKeeper();
       compatibleEarlyTermination = conf.getBoolean(AccessControlConstants.CF_ATTRIBUTE_EARLY_OUT,
         AccessControlConstants.DEFAULT_ATTRIBUTE_EARLY_OUT);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
index 9d46085..50b8765 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils;
 import org.apache.hadoop.hbase.ipc.RpcServer;
 import org.apache.hadoop.hbase.ipc.RpcServerInterface;
 import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos;
+import org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.hadoop.hbase.security.AccessDeniedException;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.security.UserGroupInformation;
@@ -61,7 +62,9 @@ public class TokenProvider implements AuthenticationProtos.AuthenticationService
     if (env instanceof RegionCoprocessorEnvironment) {
       RegionCoprocessorEnvironment regionEnv =
           (RegionCoprocessorEnvironment)env;
-      RpcServerInterface server = regionEnv.getRegionServerServices().getRpcServer();
+      assert regionEnv.getCoprocessorRegionServerServices() instanceof RegionServerServices;
+      RpcServerInterface server = ((RegionServerServices) regionEnv
+          .getCoprocessorRegionServerServices()).getRpcServer();
       SecretManager<?> mgr = ((RpcServer)server).getSecretManager();
       if (mgr instanceof AuthenticationTokenSecretManager) {
         secretManager = (AuthenticationTokenSecretManager)mgr;

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
index 8e19a64..26620c1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
@@ -62,6 +62,7 @@ import org.apache.hadoop.hbase.io.util.StreamUtils;
 import org.apache.hadoop.hbase.regionserver.OperationStatus;
 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.security.Superusers;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -111,7 +112,9 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService
 
   @Override
   public void init(RegionCoprocessorEnvironment e) throws IOException {
-    ZooKeeperWatcher zk = e.getRegionServerServices().getZooKeeper();
+    assert e.getCoprocessorRegionServerServices() instanceof RegionServerServices;
+    ZooKeeperWatcher zk = ((RegionServerServices) e.getCoprocessorRegionServerServices())
+        .getZooKeeper();
     try {
       labelsCache = VisibilityLabelsCache.createAndGet(zk, this.conf);
     } catch (IOException ioe) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
index 4b25635..5c84e98 100644
--- a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
@@ -36,7 +36,7 @@
   HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
   Configuration conf = rs.getConfiguration();
 
-  Region region = rs.getFromOnlineRegions(regionName);
+  Region region = rs.getRegion(regionName);
   String displayName = HRegionInfo.getRegionNameAsStringForDisplay(region.getRegionInfo(),
     rs.getConfiguration());
 %>

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index 71f6338..6e30246 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -4442,7 +4442,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
   public int getNumHFilesForRS(final HRegionServer rs, final TableName tableName,
                                final byte[] family) {
     int numHFiles = 0;
-    for (Region region : rs.getOnlineRegions(tableName)) {
+    for (Region region : rs.getRegions(tableName)) {
       numHFiles += region.getStore(family).getStorefilesCount();
     }
     return numHFiles;

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index df3a13b..59a66ec 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -801,7 +801,7 @@ public class MiniHBaseCluster extends HBaseCluster {
     ArrayList<HRegion> ret = new ArrayList<>();
     for (JVMClusterUtil.RegionServerThread rst : getRegionServerThreads()) {
       HRegionServer hrs = rst.getRegionServer();
-      for (Region region : hrs.getOnlineRegions(tableName)) {
+      for (Region region : hrs.getRegions(tableName)) {
         if (region.getTableDescriptor().getTableName().equals(tableName)) {
           ret.add((HRegion)region);
         }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
index 76580f1..ef398ff 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java
@@ -94,17 +94,17 @@ public class MockRegionServerServices implements RegionServerServices {
   }
 
   @Override
-  public boolean removeFromOnlineRegions(Region r, ServerName destination) {
+  public boolean removeRegion(Region r, ServerName destination) {
     return this.regions.remove(r.getRegionInfo().getEncodedName()) != null;
   }
 
   @Override
-  public Region getFromOnlineRegions(String encodedRegionName) {
+  public Region getRegion(String encodedRegionName) {
     return this.regions.get(encodedRegionName);
   }
 
   @Override
-  public List<Region> getOnlineRegions(TableName tableName) throws IOException {
+  public List<Region> getRegions(TableName tableName) throws IOException {
     return null;
   }
 
@@ -114,24 +114,24 @@ public class MockRegionServerServices implements RegionServerServices {
   }
 
   @Override
-  public List<Region> getOnlineRegions() {
+  public List<Region> getRegions() {
     return null;
   }
 
   @Override
-  public void addToOnlineRegions(Region r) {
+  public void addRegion(Region r) {
     this.regions.put(r.getRegionInfo().getEncodedName(), r);
   }
 
   @Override
   public void postOpenDeployTasks(Region r) throws KeeperException, IOException {
-    addToOnlineRegions(r);
+    addRegion(r);
   }
 
   @Override
   public void postOpenDeployTasks(PostOpenDeployContext context) throws KeeperException,
       IOException {
-    addToOnlineRegions(context.getRegion());
+    addRegion(context.getRegion());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
index 8d19c1b..e8ae7d1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
@@ -93,9 +93,7 @@ public class TestGlobalMemStoreSize {
       long globalMemStoreSize = 0;
       for (HRegionInfo regionInfo :
           ProtobufUtil.getOnlineRegions(null, server.getRSRpcServices())) {
-        globalMemStoreSize +=
-          server.getFromOnlineRegions(regionInfo.getEncodedName()).
-          getMemstoreSize();
+        globalMemStoreSize += server.getRegion(regionInfo.getEncodedName()).getMemstoreSize();
       }
       assertEquals(server.getRegionServerAccounting().getGlobalMemstoreDataSize(),
         globalMemStoreSize);
@@ -109,7 +107,7 @@ public class TestGlobalMemStoreSize {
 
       for (HRegionInfo regionInfo :
           ProtobufUtil.getOnlineRegions(null, server.getRSRpcServices())) {
-        Region r = server.getFromOnlineRegions(regionInfo.getEncodedName());
+        Region r = server.getRegion(regionInfo.getEncodedName());
         flush(r, server);
       }
       LOG.info("Post flush on " + server.getServerName());
@@ -125,7 +123,7 @@ public class TestGlobalMemStoreSize {
         // our test was running....
         for (HRegionInfo regionInfo :
             ProtobufUtil.getOnlineRegions(null, server.getRSRpcServices())) {
-          Region r = server.getFromOnlineRegions(regionInfo.getEncodedName());
+          Region r = server.getRegion(regionInfo.getEncodedName());
           long l = r.getMemstoreSize();
           if (l > 0) {
             // Only meta could have edits at this stage.  Give it another flush

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
index 9ed63f7..327fc89 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
@@ -241,7 +241,7 @@ public class TestHFileArchiving {
     UTIL.loadRegion(region, TEST_FAM);
 
     // get the hfiles in the region
-    List<Region> regions = hrs.getOnlineRegions(tableName);
+    List<Region> regions = hrs.getRegions(tableName);
     assertEquals("More that 1 region for test table.", 1, regions.size());
 
     region = regions.get(0);
@@ -320,7 +320,7 @@ public class TestHFileArchiving {
     UTIL.loadRegion(region, TEST_FAM);
 
     // get the hfiles in the region
-    List<Region> regions = hrs.getOnlineRegions(tableName);
+    List<Region> regions = hrs.getRegions(tableName);
     assertEquals("More that 1 region for test table.", 1, regions.size());
 
     region = regions.get(0);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
index 50112fb..f7bedef 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
@@ -180,7 +180,7 @@ public class TestZooKeeperTableArchiveClient {
     HRegion region = UTIL.createTestRegion(STRING_TABLE_NAME, hcd);
     List<Region> regions = new ArrayList<>();
     regions.add(region);
-    when(rss.getOnlineRegions()).thenReturn(regions);
+    when(rss.getRegions()).thenReturn(regions);
     final CompactedHFilesDischarger compactionCleaner =
         new CompactedHFilesDischarger(100, stop, rss, false);
     loadFlushAndCompact(region, TEST_FAM);
@@ -233,7 +233,7 @@ public class TestZooKeeperTableArchiveClient {
     HRegion region = UTIL.createTestRegion(STRING_TABLE_NAME, hcd);
     List<Region> regions = new ArrayList<>();
     regions.add(region);
-    when(rss.getOnlineRegions()).thenReturn(regions);
+    when(rss.getRegions()).thenReturn(regions);
     final CompactedHFilesDischarger compactionCleaner =
         new CompactedHFilesDischarger(100, stop, rss, false);
     loadFlushAndCompact(region, TEST_FAM);
@@ -243,7 +243,7 @@ public class TestZooKeeperTableArchiveClient {
     HRegion otherRegion = UTIL.createTestRegion(otherTable, hcd);
     regions = new ArrayList<>();
     regions.add(otherRegion);
-    when(rss.getOnlineRegions()).thenReturn(regions);
+    when(rss.getRegions()).thenReturn(regions);
     final CompactedHFilesDischarger compactionCleaner1 = new CompactedHFilesDischarger(100, stop,
         rss, false);
     loadFlushAndCompact(otherRegion, TEST_FAM);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java
index c56305a..53148bb 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java
@@ -64,7 +64,7 @@ public class TestAsyncMetaRegionLocator {
   private Optional<ServerName> getRSCarryingMeta() {
     return TEST_UTIL.getHBaseCluster().getRegionServerThreads().stream()
         .map(t -> t.getRegionServer())
-        .filter(rs -> !rs.getOnlineRegions(TableName.META_TABLE_NAME).isEmpty()).findAny()
+        .filter(rs -> !rs.getRegions(TableName.META_TABLE_NAME).isEmpty()).findAny()
         .map(rs -> rs.getServerName());
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java
index 80ed02e..c70ad26 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java
@@ -176,7 +176,7 @@ public class TestAsyncNonMetaRegionLocator {
     ServerName[] serverNames = new ServerName[startKeys.length];
     TEST_UTIL.getHBaseCluster().getRegionServerThreads().stream().map(t -> t.getRegionServer())
         .forEach(rs -> {
-          rs.getOnlineRegions(TABLE_NAME).forEach(r -> {
+          rs.getRegions(TABLE_NAME).forEach(r -> {
             serverNames[Arrays.binarySearch(startKeys, r.getRegionInfo().getStartKey(),
               Bytes::compareTo)] = rs.getServerName();
           });
@@ -270,7 +270,7 @@ public class TestAsyncNonMetaRegionLocator {
         LOCATOR.getRegionLocation(TABLE_NAME, row, RegionLocateType.AFTER, false).get();
     ServerName afterServerName =
         TEST_UTIL.getHBaseCluster().getRegionServerThreads().stream().map(t -> t.getRegionServer())
-            .filter(rs -> rs.getOnlineRegions(TABLE_NAME).stream()
+            .filter(rs -> rs.getRegions(TABLE_NAME).stream()
                 .anyMatch(r -> Bytes.equals(splitKey, r.getRegionInfo().getStartKey())))
             .findAny().get().getServerName();
     assertLocEquals(splitKey, EMPTY_END_ROW, afterServerName, afterLoc);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
index 5ec9ed8..6292b10 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
@@ -301,7 +301,7 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
             ServerName serverName = rs.getServerName();
             try {
               Assert.assertEquals(admin.getOnlineRegions(serverName).get().size(), rs
-                  .getOnlineRegions().size());
+                  .getRegions().size());
             } catch (Exception e) {
               fail("admin.getOnlineRegions() method throws a exception: " + e.getMessage());
             }
@@ -527,7 +527,7 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
         TEST_UTIL.getHBaseCluster().getLiveRegionServerThreads().stream()
             .map(rsThread -> rsThread.getRegionServer()).collect(Collectors.toList());
     List<Region> regions = new ArrayList<>();
-    rsList.forEach(rs -> regions.addAll(rs.getOnlineRegions(tableName)));
+    rsList.forEach(rs -> regions.addAll(rs.getRegions(tableName)));
     Assert.assertEquals(regions.size(), 1);
     int countBefore = countStoreFilesInFamilies(regions, families);
     Assert.assertTrue(countBefore > 0);
@@ -568,7 +568,7 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
     TEST_UTIL
         .getHBaseCluster()
         .getLiveRegionServerThreads()
-        .forEach(rsThread -> regions.addAll(rsThread.getRegionServer().getOnlineRegions(tableName)));
+        .forEach(rsThread -> regions.addAll(rsThread.getRegionServer().getRegions(tableName)));
     Assert.assertEquals(regions.size(), 1);
 
     int countBefore = countStoreFilesInFamilies(regions, families);

http://git-wip-us.apache.org/repos/asf/hbase/blob/bd68551f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
index 061d097..b389d9e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java
@@ -133,7 +133,7 @@ public class TestAvoidCellReferencesIntoShippedBlocks {
       RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName);
       String regionName = locator.getAllRegionLocations().get(0).getRegionInfo().getEncodedName();
       Region region =
-          TEST_UTIL.getRSForFirstRegionInTable(tableName).getFromOnlineRegions(regionName);
+          TEST_UTIL.getRSForFirstRegionInTable(tableName).getRegion(regionName);
       Store store = region.getStores().iterator().next();
       CacheConfig cacheConf = store.getCacheConfig();
       cacheConf.setCacheDataOnWrite(true);
@@ -307,7 +307,7 @@ public class TestAvoidCellReferencesIntoShippedBlocks {
       RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName);
       String regionName = locator.getAllRegionLocations().get(0).getRegionInfo().getEncodedName();
       Region region =
-          TEST_UTIL.getRSForFirstRegionInTable(tableName).getFromOnlineRegions(regionName);
+          TEST_UTIL.getRSForFirstRegionInTable(tableName).getRegion(regionName);
       Store store = region.getStores().iterator().next();
       CacheConfig cacheConf = store.getCacheConfig();
       cacheConf.setCacheDataOnWrite(true);


Mime
View raw message