HBASE-3699 Make RegionServerServices and MasterServices extend Server

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1092583 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-04-15 04:28:40 +00:00
parent 0641df92c5
commit 840e08634b
7 changed files with 63 additions and 39 deletions

View File

@ -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

View File

@ -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();
}

View File

@ -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
//

View File

@ -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

View File

@ -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.
*/

View File

@ -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

View File

@ -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;
}
};
/**