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. |
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() |
RegionServerQuotaManager |
getRegionServerQuotaManager() |
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)
OnlineRegions
removeFromOnlineRegions
in interface OnlineRegions
r
- Region to remove.destination
- Destination, if any, null otherwise.public Region getFromOnlineRegions(String encodedRegionName)
OnlineRegions
Region
instance.
Only works if caller is in same context, in same JVM. Region is not
serializable.getFromOnlineRegions
in interface OnlineRegions
encodedRegionName
or
null if named region is not member of the online regions.public List<Region> getOnlineRegions(TableName tableName) throws IOException
OnlineRegions
getOnlineRegions
in interface OnlineRegions
IOException
public Set<TableName> getOnlineTables()
getOnlineTables
in interface RegionServerServices
public void addToOnlineRegions(Region r)
OnlineRegions
addToOnlineRegions
in interface OnlineRegions
public void postOpenDeployTasks(Region r) throws KeeperException, IOException
RegionServerServices
postOpenDeployTasks
in interface RegionServerServices
r
- Region to open.KeeperException
IOException
public void postOpenDeployTasks(RegionServerServices.PostOpenDeployContext context) throws KeeperException, IOException
RegionServerServices
postOpenDeployTasks
in interface RegionServerServices
context
- the contextKeeperException
IOException
public boolean isStopping()
isStopping
in interface RegionServerServices
public RpcServerInterface getRpcServer()
RegionServerServices
getRpcServer
in interface RegionServerServices
public void setRpcServer(RpcServerInterface rpc)
public ConcurrentSkipListMap<byte[],Boolean> getRegionsInTransitionInRS()
RegionServerServices
getRegionsInTransitionInRS
in interface RegionServerServices
public FlushRequester getFlushRequester()
getFlushRequester
in interface RegionServerServices
FlushRequester
or null.public CompactionRequestor getCompactionRequester()
getCompactionRequester
in interface RegionServerServices
CompactionRequestor
or null.public ClusterConnection getConnection()
Server
getConnection
in interface Server
public MetaTableLocator getMetaTableLocator()
Server
MetaTableLocator
running inside this server. This MetaServerLocator is started and stopped by server, clients
shouldn't manage it's lifecycle.getMetaTableLocator
in interface Server
MetaTableLocator
associated with this server.public ZooKeeperWatcher getZooKeeper()
Server
getZooKeeper
in interface Server
public CoordinatedStateManager getCoordinatedStateManager()
Server
getCoordinatedStateManager
in interface Server
public RegionServerAccounting getRegionServerAccounting()
getRegionServerAccounting
in interface RegionServerServices
public TableLockManager getTableLockManager()
getTableLockManager
in interface RegionServerServices
TableLockManager
public RegionServerQuotaManager getRegionServerQuotaManager()
getRegionServerQuotaManager
in interface RegionServerServices
RegionServerQuotaManager
public ServerName getServerName()
getServerName
in interface Server
public Configuration getConfiguration()
Server
getConfiguration
in interface Server
public void abort(String why, Throwable e)
Abortable
public boolean isStopped()
isStopped
in interface Stoppable
Stoppable.stop(String)
has been closed.public boolean isAborted()
Abortable
public HFileSystem getFileSystem()
getFileSystem
in interface RegionServerServices
public void setFileSystem(FileSystem hfs)
public Leases getLeases()
getLeases
in interface RegionServerServices
public WAL getWAL(HRegionInfo regionInfo) throws IOException
getWAL
in interface RegionServerServices
IOException
public ExecutorService getExecutorService()
getExecutorService
in interface RegionServerServices
public ChoreService getChoreService()
getChoreService
in interface Server
ChoreService
instance for this serverpublic void updateRegionFavoredNodesMapping(String encodedRegionName, List<HBaseProtos.ServerName> favoredNodes)
FavoredNodesForRegion
updateRegionFavoredNodesMapping
in interface FavoredNodesForRegion
public InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName)
FavoredNodesForRegion
getFavoredNodesForRegion
in interface FavoredNodesForRegion
public Map<String,Region> getRecoveringRegions()
getRecoveringRegions
in interface RegionServerServices
public ServerNonceManager getNonceManager()
RegionServerServices
getNonceManager
in interface RegionServerServices
public boolean reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code, long openSeqNum, HRegionInfo... hris)
RegionServerServices
reportRegionStateTransition
in interface RegionServerServices
public boolean reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code, HRegionInfo... hris)
RegionServerServices
reportRegionStateTransition
in interface RegionServerServices
public boolean reportRegionStateTransition(RegionServerServices.RegionStateTransitionContext context)
RegionServerServices
reportRegionStateTransition
in interface RegionServerServices
public boolean registerService(Service service)
RegionServerServices
Service
subclass as a coprocessor endpoint to be
available for handlingregisterService
in interface RegionServerServices
service
- the Service
subclass instance to expose as a coprocessor endpointtrue
if the registration was successful, false
public HeapMemoryManager getHeapMemoryManager()
getHeapMemoryManager
in interface RegionServerServices
public double getCompactionPressure()
getCompactionPressure
in interface RegionServerServices
Store.getCompactionPressure()