diff --git a/CHANGES.txt b/CHANGES.txt index fec6e0c54cb..34764f82c12 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -165,6 +165,8 @@ Release 0.91.0 - Unreleased filters (Doug Meil) HBASE-3785 book.xml - moving WAL into architecture section, plus adding more description on what it does (Doug Meil) + HBASE-3699 Make RegionServerServices and MasterServices extend Server + (Erik Onnen) TASKS HBASE-3559 Move report of split to master OFF the heartbeat channel diff --git a/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java b/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java index 2b876901c0c..07d0bbccaef 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java +++ b/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.master; import java.io.IOException; +import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableNotDisabledException; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.catalog.CatalogTracker; @@ -30,7 +31,7 @@ import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; /** * Services Master supplies */ -public interface MasterServices { +public interface MasterServices extends Server { /** * @return Master's instance of the {@link AssignmentManager} */ @@ -59,14 +60,4 @@ public interface MasterServices { */ public void checkTableModifiable(final byte [] tableName) throws IOException; - /** - * @return Implementation of {@link org.apache.hadoop.hbase.catalog.CatalogTracker} or null. - */ - public CatalogTracker getCatalogTracker(); - - /* - * @return Implementation of {@link ZooKeeperWatcher} or null. - */ - public ZooKeeperWatcher getZooKeeperWatcher(); - } diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 85b414497f7..3f93b75b875 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -147,7 +147,7 @@ import com.google.common.collect.Lists; * the HMaster. There are many HRegionServers in a single HBase deployment. */ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler, - Runnable, RegionServerServices, Server { + Runnable, RegionServerServices { public static final Log LOG = LogFactory.getLog(HRegionServer.class); // Set when a report to the master comes back with a message asking us to @@ -2805,11 +2805,6 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler, return this.compactSplitThread; } - @Override - public ZooKeeperWatcher getZooKeeperWatcher() { - return this.zooKeeper; - } - // // Main program and support routines // diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java b/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java index 3c90ed153c4..c4c6612cf16 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/OnlineRegions.java @@ -19,11 +19,13 @@ */ package org.apache.hadoop.hbase.regionserver; +import org.apache.hadoop.hbase.Server; + /** * Interface to Map of online regions. In the Map, the key is the region's * encoded name and the value is an {@link HRegion} instance. */ -interface OnlineRegions { +interface OnlineRegions extends Server { /** * Add to online regions. * @param r diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java b/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java index 4051e0b160d..6282b9e74f0 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java @@ -40,16 +40,6 @@ public interface RegionServerServices extends OnlineRegions { /** @return the HLog */ public HLog getWAL(); - /** - * @return Implementation of {@link CatalogTracker} or null. - */ - public CatalogTracker getCatalogTracker(); - - /* - * @return Implementation of {@link ZooKeeperWatcher} or null. - */ - public ZooKeeperWatcher getZooKeeperWatcher(); - /** * @return Implementation of {@link CompactionRequestor} or null. */ diff --git a/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java b/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java index 3f332ff1a3d..57d85d88a42 100644 --- a/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java +++ b/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java @@ -85,30 +85,27 @@ public class TestCatalogJanitor { @Override public String getServerName() { - // TODO Auto-generated method stub return null; } @Override public ZooKeeperWatcher getZooKeeper() { - // TODO Auto-generated method stub return null; } @Override public void abort(String why, Throwable e) { - // TODO Auto-generated method stub + //no-op } @Override public boolean isStopped() { - // TODO Auto-generated method stub return false; } @Override public void stop(String why) { - // TODO Auto-generated method stub + //no-op } } @@ -125,18 +122,16 @@ public class TestCatalogJanitor { @Override public void checkTableModifiable(byte[] tableName) throws IOException { - // TODO Auto-generated method stub + //no-op } @Override public AssignmentManager getAssignmentManager() { - // TODO Auto-generated method stub return null; } @Override public ExecutorService getExecutorService() { - // TODO Auto-generated method stub return null; } @@ -147,12 +142,11 @@ public class TestCatalogJanitor { @Override public ServerManager getServerManager() { - // TODO Auto-generated method stub return null; } @Override - public ZooKeeperWatcher getZooKeeperWatcher() { + public ZooKeeperWatcher getZooKeeper() { return null; } @@ -160,6 +154,31 @@ public class TestCatalogJanitor { public CatalogTracker getCatalogTracker() { return null; } + + @Override + public Configuration getConfiguration() { + return null; + } + + @Override + public String getServerName() { + return null; + } + + @Override + public void abort(String why, Throwable e) { + //no-op + } + + @Override + public void stop(String why) { + //no-op + } + + @Override + public boolean isStopped() { + return false; + } } @Test diff --git a/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java b/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java index c2437bd416b..bc0a327d313 100644 --- a/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java +++ b/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java @@ -179,13 +179,38 @@ public class TestOpenRegionHandler { } @Override - public ZooKeeperWatcher getZooKeeperWatcher() { + public ZooKeeperWatcher getZooKeeper() { return null; } public RegionServerAccounting getRegionServerAccounting() { return null; } + + @Override + public String getServerName() { + return null; + } + + @Override + public Configuration getConfiguration() { + return null; + } + + @Override + public void abort(String why, Throwable e) { + //no-op + } + + @Override + public void stop(String why) { + //no-op + } + + @Override + public boolean isStopped() { + return false; + } }; /**