org.apache.hadoop.hbase.regionserver
Interface RegionServerServices

All Superinterfaces:
PriorityFunction
All Known Implementing Classes:
HRegionServer

@InterfaceAudience.Private
public interface RegionServerServices
extends PriorityFunction

Services provided by HRegionServer


Method Summary
 void addToOnlineRegions(HRegion r)
          Add to online regions.
 CatalogTracker getCatalogTracker()
           
 double getCompactionPressure()
           
 CompactionRequestor getCompactionRequester()
           
 ExecutorService getExecutorService()
           
 InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName)
          Get the favored nodes mapping for this region.
 org.apache.hadoop.fs.FileSystem getFileSystem()
           
 FlushRequester getFlushRequester()
           
 HRegion getFromOnlineRegions(String encodedRegionName)
          Return HRegion instance.
 HeapMemoryManager getHeapMemoryManager()
           
 Leases getLeases()
           
 ServerNonceManager getNonceManager()
          Only required for "old" log replay; if it's removed, remove this.
 List<HRegion> getOnlineRegions(TableName tableName)
          Get all online regions of a table in this RS.
 Map<String,HRegion> getRecoveringRegions()
           
 RegionServerAccounting getRegionServerAccounting()
           
 ConcurrentMap<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
 TableLockManager getTableLockManager()
           
 HLog getWAL(HRegionInfo regionInfo)
           
 boolean isStopping()
           
 void postOpenDeployTasks(HRegion r, CatalogTracker ct)
          Tasks to perform after region open to complete deploy of region on regionserver
 boolean registerService(com.google.protobuf.Service service)
          Registers a new protocol buffer Service subclass as a coprocessor endpoint to be available for handling
 boolean removeFromOnlineRegions(HRegion r, ServerName destination)
          This method removes HRegion corresponding to hri from the Map of onlineRegions.
 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 updateRegionFavoredNodesMapping(String encodedRegionName, List<HBaseProtos.ServerName> favoredNodes)
          Used to update the favored nodes mapping when required.
 
Methods inherited from interface org.apache.hadoop.hbase.Server
getConfiguration, getServerName, getZooKeeper
 
Methods inherited from interface org.apache.hadoop.hbase.Abortable
abort, isAborted
 
Methods inherited from interface org.apache.hadoop.hbase.Stoppable
isStopped, stop
 
Methods inherited from interface org.apache.hadoop.hbase.ipc.PriorityFunction
getPriority
 

Method Detail

isStopping

boolean isStopping()
Returns:
True if this regionserver is stopping.

getWAL

HLog getWAL(HRegionInfo regionInfo)
            throws IOException
Returns:
the HLog for a particular region. Pass null for getting the default (common) WAL
Throws:
IOException

getCompactionRequester

CompactionRequestor getCompactionRequester()
Returns:
Implementation of CompactionRequestor or null.

getFlushRequester

FlushRequester getFlushRequester()
Returns:
Implementation of FlushRequester or null.

getRegionServerAccounting

RegionServerAccounting getRegionServerAccounting()
Returns:
the RegionServerAccounting for this Region Server

getTableLockManager

TableLockManager getTableLockManager()
Returns:
RegionServer's instance of TableLockManager

postOpenDeployTasks

void postOpenDeployTasks(HRegion r,
                         CatalogTracker ct)
                         throws org.apache.zookeeper.KeeperException,
                                IOException
Tasks to perform after region open to complete deploy of region on regionserver

Parameters:
r - Region to open.
ct - Instance of CatalogTracker
Throws:
org.apache.zookeeper.KeeperException
IOException

reportRegionStateTransition

boolean reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code,
                                    long openSeqNum,
                                    HRegionInfo... hris)
Notify master that a handler requests to change a region state


reportRegionStateTransition

boolean reportRegionStateTransition(RegionServerStatusProtos.RegionStateTransition.TransitionCode code,
                                    HRegionInfo... hris)
Notify master that a handler requests to change a region state


getRpcServer

RpcServerInterface getRpcServer()
Returns a reference to the region server's RPC server


getRegionsInTransitionInRS

ConcurrentMap<byte[],Boolean> getRegionsInTransitionInRS()
Get the regions that are currently being opened or closed in the RS

Returns:
map of regions in transition in this RS

getFileSystem

org.apache.hadoop.fs.FileSystem getFileSystem()
Returns:
Return the FileSystem object used by the regionserver

getLeases

Leases getLeases()
Returns:
The RegionServer's "Leases" service

getExecutorService

ExecutorService getExecutorService()
Returns:
hbase executor service

getCatalogTracker

CatalogTracker getCatalogTracker()
Returns:
The RegionServer's CatalogTracker

getRecoveringRegions

Map<String,HRegion> getRecoveringRegions()
Returns:
set of recovering regions on the hosting region server

getNonceManager

ServerNonceManager getNonceManager()
Only required for "old" log replay; if it's removed, remove this.

Returns:
The RegionServer's NonceManager

registerService

boolean registerService(com.google.protobuf.Service service)
Registers a new protocol buffer Service subclass as a coprocessor endpoint to be available for handling

Parameters:
instance - the Service subclass instance to expose as a coprocessor endpoint
Returns:
true if the registration was successful, false

getHeapMemoryManager

HeapMemoryManager getHeapMemoryManager()
Returns:
heap memory manager instance

getCompactionPressure

double getCompactionPressure()
Returns:
the max compaction pressure of all stores on this regionserver. The value should be greater than or equal to 0.0, and any value greater than 1.0 means we enter the emergency state that some stores have too many store files.
See Also:
Store.getCompactionPressure()

addToOnlineRegions

void addToOnlineRegions(HRegion r)
Add to online regions.

Parameters:
r -

removeFromOnlineRegions

boolean removeFromOnlineRegions(HRegion r,
                                ServerName destination)
This method removes HRegion corresponding to hri from the Map of onlineRegions.

Parameters:
r - Region to remove.
destination - Destination, if any, null otherwise.
Returns:
True if we removed a region from online list.

getFromOnlineRegions

HRegion getFromOnlineRegions(String encodedRegionName)
Return HRegion instance. Only works if caller is in same context, in same JVM. HRegion is not serializable.

Parameters:
encodedRegionName -
Returns:
HRegion for the passed encoded encodedRegionName or null if named region is not member of the online regions.

getOnlineRegions

List<HRegion> getOnlineRegions(TableName tableName)
                               throws IOException
Get all online regions of a table in this RS.

Parameters:
tableName -
Returns:
List of HRegion
Throws:
IOException

updateRegionFavoredNodesMapping

void updateRegionFavoredNodesMapping(String encodedRegionName,
                                     List<HBaseProtos.ServerName> favoredNodes)
Used to update the favored nodes mapping when required.

Parameters:
encodedRegionName -
favoredNodes -

getFavoredNodesForRegion

InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName)
Get the favored nodes mapping for this region. Used when the HDFS create API is invoked to pass in favored nodes hints for new region files.

Parameters:
encodedRegionName -
Returns:
array containing the favored nodes' InetSocketAddresses


Copyright © 2015 The Apache Software Foundation. All rights reserved.