public class MockRegionServerServices extends Object implements RegionServerServices
RegionServerServices.PostOpenDeployContext, RegionServerServices.RegionStateTransitionContext| Modifier and Type | Field and Description |
|---|---|
protected static Log |
LOG |
| Constructor and Description |
|---|
MockRegionServerServices(Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
void |
addToOnlineRegions(Region r)
Add to online regions.
|
ChoreService |
getChoreService() |
double |
getCompactionPressure() |
CompactionRequestor |
getCompactionRequester() |
Configuration |
getConfiguration()
Gets the configuration object for this server.
|
ClusterConnection |
getConnection()
Returns a reference to the servers' cluster connection.
|
CoordinatedStateManager |
getCoordinatedStateManager()
Get CoordinatedStateManager instance for this server.
|
ExecutorService |
getExecutorService() |
InetSocketAddress[] |
getFavoredNodesForRegion(String encodedRegionName)
Get the favored nodes mapping for this region.
|
HFileSystem |
getFileSystem() |
FlushRequester |
getFlushRequester() |
Region |
getFromOnlineRegions(String encodedRegionName)
Return
Region instance. |
HeapMemoryManager |
getHeapMemoryManager() |
Leases |
getLeases() |
MetaTableLocator |
getMetaTableLocator()
Returns instance of
MetaTableLocator
running inside this server. |
MetricsRegionServer |
getMetrics() |
ServerNonceManager |
getNonceManager()
Only required for "old" log replay; if it's removed, remove this.
|
List<Region> |
getOnlineRegions(TableName tableName)
Get all online regions of a table in this RS.
|
Set<TableName> |
getOnlineTables() |
Map<String,Region> |
getRecoveringRegions() |
RegionServerAccounting |
getRegionServerAccounting() |
RegionServerRpcQuotaManager |
getRegionServerRpcQuotaManager() |
RegionServerSpaceQuotaManager |
getRegionServerSpaceQuotaManager() |
ConcurrentSkipListMap<byte[],Boolean> |
getRegionsInTransitionInRS()
Get the regions that are currently being opened or closed in the RS
|
RpcServerInterface |
getRpcServer()
Returns a reference to the region server's RPC server
|
ServerName |
getServerName() |
TableLockManager |
getTableLockManager() |
WAL |
getWAL(HRegionInfo regionInfo) |
ZooKeeperWatcher |
getZooKeeper()
Gets the ZooKeeper instance for this server.
|
boolean |
isAborted()
Check if the server or client was aborted.
|
boolean |
isStopped() |
boolean |
isStopping() |
void |
postOpenDeployTasks(Region r)
Tasks to perform after region open to complete deploy of region on
regionserver
|
void |
postOpenDeployTasks(RegionServerServices.PostOpenDeployContext context)
Tasks to perform after region open to complete deploy of region on
regionserver
|
boolean |
registerService(Service service)
Registers a new protocol buffer
Service subclass as a coprocessor endpoint to be
available for handling |
boolean |
removeFromOnlineRegions(Region r,
ServerName destination)
This method removes Region corresponding to hri from the Map of onlineRegions.
|
boolean |
reportRegionStateTransition(RegionServerServices.RegionStateTransitionContext context)
Notify master that a handler requests to change a region state
|
boolean |
reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code,
HRegionInfo... hris)
Notify master that a handler requests to change a region state
|
boolean |
reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code,
long openSeqNum,
HRegionInfo... hris)
Notify master that a handler requests to change a region state
|
void |
setFileSystem(FileSystem hfs) |
void |
setRpcServer(RpcServerInterface rpc) |
void |
stop(String why)
Stop this service.
|
void |
updateRegionFavoredNodesMapping(String encodedRegionName,
List<HBaseProtos.ServerName> favoredNodes)
Used to update the favored nodes mapping when required.
|
public boolean removeFromOnlineRegions(Region r, ServerName destination)
OnlineRegionsremoveFromOnlineRegions in interface OnlineRegionsr - Region to remove.destination - Destination, if any, null otherwise.public Region getFromOnlineRegions(String encodedRegionName)
OnlineRegionsRegion instance.
Only works if caller is in same context, in same JVM. Region is not
serializable.getFromOnlineRegions in interface OnlineRegionsencodedRegionName or
null if named region is not member of the online regions.public List<Region> getOnlineRegions(TableName tableName) throws IOException
OnlineRegionsgetOnlineRegions in interface OnlineRegionsIOExceptionpublic Set<TableName> getOnlineTables()
getOnlineTables in interface RegionServerServicespublic void addToOnlineRegions(Region r)
OnlineRegionsaddToOnlineRegions in interface OnlineRegionspublic void postOpenDeployTasks(Region r) throws KeeperException, IOException
RegionServerServicespostOpenDeployTasks in interface RegionServerServicesr - Region to open.KeeperExceptionIOExceptionpublic void postOpenDeployTasks(RegionServerServices.PostOpenDeployContext context) throws KeeperException, IOException
RegionServerServicespostOpenDeployTasks in interface RegionServerServicescontext - the contextKeeperExceptionIOExceptionpublic boolean isStopping()
isStopping in interface RegionServerServicespublic RpcServerInterface getRpcServer()
RegionServerServicesgetRpcServer in interface RegionServerServicespublic void setRpcServer(RpcServerInterface rpc)
public ConcurrentSkipListMap<byte[],Boolean> getRegionsInTransitionInRS()
RegionServerServicesgetRegionsInTransitionInRS in interface RegionServerServicespublic FlushRequester getFlushRequester()
getFlushRequester in interface RegionServerServicesFlushRequester or null.public CompactionRequestor getCompactionRequester()
getCompactionRequester in interface RegionServerServicesCompactionRequestor or null.public ClusterConnection getConnection()
ServergetConnection in interface Serverpublic MetaTableLocator getMetaTableLocator()
ServerMetaTableLocator
running inside this server. This MetaServerLocator is started and stopped by server, clients
shouldn't manage it's lifecycle.getMetaTableLocator in interface ServerMetaTableLocator associated with this server.public ZooKeeperWatcher getZooKeeper()
ServergetZooKeeper in interface Serverpublic CoordinatedStateManager getCoordinatedStateManager()
ServergetCoordinatedStateManager in interface Serverpublic RegionServerAccounting getRegionServerAccounting()
getRegionServerAccounting in interface RegionServerServicespublic TableLockManager getTableLockManager()
getTableLockManager in interface RegionServerServicesTableLockManagerpublic RegionServerRpcQuotaManager getRegionServerRpcQuotaManager()
getRegionServerRpcQuotaManager in interface RegionServerServicesRegionServerRpcQuotaManagerpublic ServerName getServerName()
getServerName in interface Serverpublic Configuration getConfiguration()
ServergetConfiguration in interface Serverpublic void abort(String why, Throwable e)
Abortablepublic boolean isStopped()
isStopped in interface StoppableStoppable.stop(String) has been closed.public boolean isAborted()
Abortablepublic HFileSystem getFileSystem()
getFileSystem in interface RegionServerServicespublic void setFileSystem(FileSystem hfs)
public Leases getLeases()
getLeases in interface RegionServerServicespublic WAL getWAL(HRegionInfo regionInfo) throws IOException
getWAL in interface RegionServerServicesIOExceptionpublic ExecutorService getExecutorService()
getExecutorService in interface RegionServerServicespublic ChoreService getChoreService()
getChoreService in interface ServerChoreService instance for this serverpublic void updateRegionFavoredNodesMapping(String encodedRegionName, List<HBaseProtos.ServerName> favoredNodes)
FavoredNodesForRegionupdateRegionFavoredNodesMapping in interface FavoredNodesForRegionpublic InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName)
FavoredNodesForRegiongetFavoredNodesForRegion in interface FavoredNodesForRegionpublic Map<String,Region> getRecoveringRegions()
getRecoveringRegions in interface RegionServerServicespublic ServerNonceManager getNonceManager()
RegionServerServicesgetNonceManager in interface RegionServerServicespublic boolean reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code, long openSeqNum, HRegionInfo... hris)
RegionServerServicesreportRegionStateTransition in interface RegionServerServicespublic boolean reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code, HRegionInfo... hris)
RegionServerServicesreportRegionStateTransition in interface RegionServerServicespublic boolean reportRegionStateTransition(RegionServerServices.RegionStateTransitionContext context)
RegionServerServicesreportRegionStateTransition in interface RegionServerServicespublic boolean registerService(Service service)
RegionServerServicesService subclass as a coprocessor endpoint to be
available for handlingregisterService in interface RegionServerServicesservice - the Service subclass instance to expose as a coprocessor endpointtrue if the registration was successful, falsepublic HeapMemoryManager getHeapMemoryManager()
getHeapMemoryManager in interface RegionServerServicespublic double getCompactionPressure()
getCompactionPressure in interface RegionServerServicesStore.getCompactionPressure()public MetricsRegionServer getMetrics()
getMetrics in interface RegionServerServicespublic RegionServerSpaceQuotaManager getRegionServerSpaceQuotaManager()
getRegionServerSpaceQuotaManager in interface RegionServerServicesRegionServerSpaceQuotaManager