@InterfaceAudience.LimitedPrivate(value="Tools") public class HRegionServer extends HBaseServerBase<RSRpcServices> implements RegionServerServices, LastSequenceId
Thread.State, Thread.UncaughtExceptionHandlerRegionServerServices.PostOpenDeployContext, RegionServerServices.RegionStateTransitionContext| Modifier and Type | Field and Description |
|---|---|
static String |
REGIONSERVER
region server process name
|
static boolean |
TEST_SKIP_REPORTING_TRANSITION
For testing only! Set to true to skip notifying region assignment to master .
|
abortRequested, asyncClusterConnection, choreService, clusterStatusTracker, conf, configurationManager, csm, dataFs, dataRootDir, eventLoopGroupConfig, executorService, infoServer, metaRegionLocationCache, msgInterval, namedQueueRecorder, rpcServices, serverName, sleeper, startcode, stopped, tableDescriptors, userProvider, useThisHostnameInstead, walFs, walRootDir, zooKeeperMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
HRegionServer(org.apache.hadoop.conf.Configuration conf)
Starts a HRegionServer at the default location.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String reason,
Throwable cause)
Cause the server to exit without closing the regions it is serving, the log it is using and
without notifying the master.
|
void |
addRegion(HRegion region)
Add to online regions.
|
protected boolean |
cacheTableDescriptor() |
protected boolean |
canCreateBaseZNode() |
protected boolean |
canUpdateTableDescriptor() |
protected boolean |
closeRegion(String encodedName,
boolean abort,
ServerName destination)
Close asynchronously a region, can be called from the master or internally by the regionserver
when stopping.
|
protected boolean |
clusterMode() |
protected void |
configureInfoServer(InfoServer infoServer) |
protected NamedQueueRecorder |
createNamedQueueRecord() |
org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad |
createRegionLoad(String encodedRegionName) |
protected ServerName |
createRegionServerStatusStub(boolean refresh)
Get the current master from ZooKeeper and open the RPC connection to it.
|
protected RSRpcServices |
createRpcServices() |
void |
dumpRowLocks(PrintWriter out)
Used by
RSDumpServlet to generate debugging information. |
void |
finishRegionProcedure(long procId)
|
Optional<ServerName> |
getActiveMaster()
Get active master address.
|
List<ServerName> |
getBackupMasters()
Get backup masters address.
|
Optional<BlockCache> |
getBlockCache()
May be null if this is a master which not carry table.
|
Iterator<ServerName> |
getBootstrapNodes()
Get a iterator of the available bootstrap nodes.
|
BrokenStoreFileCleaner |
getBrokenStoreFileCleaner() |
String |
getClusterId()
Get cluster id.
|
CompactedHFilesDischarger |
getCompactedHFilesDischarger() |
double |
getCompactionPressure() |
CompactionRequester |
getCompactionRequestor() |
CompactSplit |
getCompactSplitThread() |
protected Class<? extends javax.servlet.http.HttpServlet> |
getDumpServlet() |
InetSocketAddress[] |
getFavoredNodesForRegion(String encodedRegionName)
Return the favored nodes for a region given its encoded name.
|
double |
getFlushPressure() |
FlushRequester |
getFlushRequester() |
ThroughputController |
getFlushThroughputController() |
HeapMemoryManager |
getHeapMemoryManager() |
org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionStoreSequenceIds |
getLastSequenceId(byte[] encodedRegionName) |
LeaseManager |
getLeaseManager() |
MasterAddressTracker |
getMasterAddressTracker() |
MemStoreFlusher |
getMemStoreFlusher() |
List<HRegionLocation> |
getMetaLocations()
Get the location of meta regions.
|
MetricsRegionServer |
getMetrics() |
Optional<MobFileCache> |
getMobFileCache()
May be null if this is a master which not carry table.
|
org.apache.hadoop.hbase.regionserver.HRegionServer.MovedRegionInfo |
getMovedRegion(String encodedRegionName) |
ServerNonceManager |
getNonceManager()
Only required for "old" log replay; if it's removed, remove this.
|
int |
getNumberOfOnlineRegions() |
HRegion |
getOnlineRegion(byte[] regionName) |
protected Map<String,HRegion> |
getOnlineRegions() |
Collection<HRegion> |
getOnlineRegionsLocalContext()
For tests, web ui and metrics.
|
Set<TableName> |
getOnlineTables()
Gets the online tables in this RS.
|
protected String |
getProcessName() |
protected HRegion |
getRegion(byte[] regionName)
Protected Utility method for safely obtaining an HRegion handle.
|
HRegion |
getRegion(String encodedRegionName)
Return
Region instance. |
HRegion |
getRegionByEncodedName(String encodedRegionName) |
RegionReplicationBufferManager |
getRegionReplicationBufferManager() |
List<HRegion> |
getRegions()
Get all online regions in this RS.
|
List<HRegion> |
getRegions(TableName tableName)
Gets the online regions of the specified table.
|
RegionServerAccounting |
getRegionServerAccounting() |
RegionServerCoprocessorHost |
getRegionServerCoprocessorHost() |
String[] |
getRegionServerCoprocessors() |
RegionServerRpcQuotaManager |
getRegionServerRpcQuotaManager() |
RegionServerSpaceQuotaManager |
getRegionServerSpaceQuotaManager() |
ConcurrentMap<byte[],Boolean> |
getRegionsInTransitionInRS()
Get the regions that are currently being opened or closed in the RS
|
ReplicationSinkService |
getReplicationSinkService() |
ReplicationSourceService |
getReplicationSourceService() |
long |
getRetryPauseTime()
Return pause time configured in
HConstants.HBASE_RPC_SHORTOPERATION_RETRY_PAUSE_TIME} |
RSRpcServices |
getRSRpcServices() |
SecureBulkLoadManager |
getSecureBulkLoadManager() |
protected String |
getUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf) |
WAL |
getWAL(RegionInfo regionInfo) |
Map<String,ReplicationStatus> |
getWalGroupsReplicationStatus() |
LogRoller |
getWalRoller() |
List<WAL> |
getWALs() |
protected void |
handleReportForDutyResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse c)
Run init.
|
boolean |
isClusterUp() |
boolean |
isOnline()
Report the status of the server.
|
protected void |
kill() |
protected void |
login(UserProvider user,
String host) |
static void |
main(String[] args) |
int |
movedRegionCacheExpiredTime() |
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration newConf) |
void |
postOpenDeployTasks(RegionServerServices.PostOpenDeployContext context)
Tasks to perform after region open to complete deploy of region on regionserver
|
EntityLock |
regionLock(List<RegionInfo> regionInfo,
String description,
Abortable abort)
Master based locks on namespaces/tables/regions.
|
boolean |
registerService(org.apache.hbase.thirdparty.com.google.protobuf.Service instance)
Registers a new protocol buffer
Service subclass as a coprocessor endpoint to be
available for handling |
void |
remoteProcedureComplete(long procId,
Throwable error) |
boolean |
removeRegion(HRegion r,
ServerName destination)
Removes the given Region from the list of onlineRegions.
|
boolean |
reportFileArchivalForQuotas(TableName tableName,
Collection<Map.Entry<String,Long>> archivedFiles)
Reports a collection of files, and their sizes, that belonged to the given
table were
just moved to the archive directory. |
boolean |
reportRegionSizesForQuotas(RegionSizeStore regionSizeStore)
Reports the given map of Regions and their size on the filesystem to the active Master.
|
boolean |
reportRegionStateTransition(RegionServerServices.RegionStateTransitionContext context)
Notify master that a handler requests to change a region state
|
void |
run()
The HRegionServer sticks in this loop until closed.
|
void |
stop(String msg) |
void |
stop(String msg,
boolean force,
User user)
Stops the regionserver.
|
protected void |
stopChores() |
protected void |
stopServiceThreads()
Wait on all threads to finish.
|
protected void |
tryRegionServerReport(long reportStartTime,
long reportEndTime) |
void |
unassign(byte[] regionName)
Unassign the given region from the current regionserver and assign it randomly.
|
void |
updateRegionFavoredNodesMapping(String encodedRegionName,
List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> favoredNodes)
Used to update the favored nodes mapping when required.
|
void |
waitForServerOnline() |
boolean |
walRollRequestFinished()
For testing
|
closeClusterConnection, closeTableDescriptors, closeZooKeeper, createConnection, getAccessChecker, getAsyncClusterConnection, getChoreService, getConfiguration, getCoordinatedStateManager, getDataRootDir, getEventLoopGroupConfig, getExecutorService, getFileSystem, getInfoServer, getMetaRegionLocationCache, getMsgInterval, getNamedQueueRecorder, getRpcServer, getRpcServices, getServerName, getStartcode, getTableDescriptors, getWALFileSystem, getWALRootDir, getZKPermissionWatcher, getZooKeeper, initializeFileSystem, initializeMemStoreChunkCreator, installShutdownHook, isAborted, isShutdownHookInstalled, isStopped, setAbortRequested, setupClusterConnection, shutdownChore, stopChoreService, stopExecutorService, stopInfoServer, toString, updateConfigurationactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yieldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAccessChecker, getExecutorService, getRpcServer, getTableDescriptors, getZKPermissionWatchercreateConnection, getAsyncClusterConnection, getAsyncConnection, getChoreService, getConfiguration, getConnection, getCoordinatedStateManager, getFileSystem, getServerName, getZooKeeper, isStopping@InterfaceAudience.Private public static boolean TEST_SKIP_REPORTING_TRANSITION
public static final String REGIONSERVER
public HRegionServer(org.apache.hadoop.conf.Configuration conf)
throws IOException
startServices().IOExceptionprotected String getUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf) throws IOException
getUseThisHostnameInstead in class HBaseServerBase<RSRpcServices>IOExceptionprotected void login(UserProvider user, String host) throws IOException
login in class HBaseServerBase<RSRpcServices>IOExceptionprotected String getProcessName()
getProcessName in class HBaseServerBase<RSRpcServices>protected boolean canCreateBaseZNode()
canCreateBaseZNode in class HBaseServerBase<RSRpcServices>protected boolean canUpdateTableDescriptor()
canUpdateTableDescriptor in class HBaseServerBase<RSRpcServices>protected boolean cacheTableDescriptor()
cacheTableDescriptor in class HBaseServerBase<RSRpcServices>protected RSRpcServices createRpcServices() throws IOException
createRpcServices in class HBaseServerBase<RSRpcServices>IOExceptionprotected void configureInfoServer(InfoServer infoServer)
configureInfoServer in class HBaseServerBase<RSRpcServices>protected Class<? extends javax.servlet.http.HttpServlet> getDumpServlet()
getDumpServlet in class HBaseServerBase<RSRpcServices>public void dumpRowLocks(PrintWriter out)
RSDumpServlet to generate debugging information.public boolean registerService(org.apache.hbase.thirdparty.com.google.protobuf.Service instance)
RegionServerServicesService subclass as a coprocessor endpoint to be
available for handlingregisterService in interface RegionServerServicesinstance - the Service subclass instance to expose as a coprocessor endpointtrue if the registration was successful, falsepublic String getClusterId()
ConnectionRegistryEndpointgetClusterId in interface ConnectionRegistryEndpointpublic boolean isClusterUp()
isClusterUp in interface RegionServerServicesisClusterUp in class HBaseServerBase<RSRpcServices>public void run()
@InterfaceAudience.Private
protected void tryRegionServerReport(long reportStartTime,
long reportEndTime)
throws IOException
IOExceptionpublic boolean reportRegionSizesForQuotas(RegionSizeStore regionSizeStore)
reportRegionSizesForQuotas in interface RegionServerServicesregionSizeStore - The store containing region sizesprotected void handleReportForDutyResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse c) throws IOException
c - Extra configuration.IOExceptionpublic RegionServerAccounting getRegionServerAccounting()
getRegionServerAccounting in interface RegionServerServicespublic org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionLoad createRegionLoad(String encodedRegionName) throws IOException
IOExceptionpublic boolean isOnline()
public MasterAddressTracker getMasterAddressTracker()
public List<WAL> getWALs()
getWALs in interface RegionServerServicespublic WAL getWAL(RegionInfo regionInfo) throws IOException
getWAL in interface RegionServerServicesIOExceptionpublic LogRoller getWalRoller()
public void stop(String msg, boolean force, User user)
msg - Status messageforce - True if this is a regionserver abortuser - The user executing the stop request, or null if no user is associatedpublic void waitForServerOnline()
public void postOpenDeployTasks(RegionServerServices.PostOpenDeployContext context) throws IOException
RegionServerServicespostOpenDeployTasks in interface RegionServerServicescontext - the contextIOExceptionpublic boolean reportRegionStateTransition(RegionServerServices.RegionStateTransitionContext context)
RegionServerServicesreportRegionStateTransition in interface RegionServerServices@InterfaceAudience.Private public RSRpcServices getRSRpcServices()
public void abort(String reason, Throwable cause)
@InterfaceAudience.Private protected void kill()
protected void stopServiceThreads()
public ReplicationSourceService getReplicationSourceService()
getReplicationSourceService in interface RegionServerServicespublic ReplicationSinkService getReplicationSinkService()
@InterfaceAudience.Private protected ServerName createRegionServerStatusStub(boolean refresh)
refresh - If true then master address will be read from ZK, otherwise use cached datapublic org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionStoreSequenceIds getLastSequenceId(byte[] encodedRegionName)
getLastSequenceId in interface LastSequenceIdencodedRegionName - Encoded region namepublic int getNumberOfOnlineRegions()
public Collection<HRegion> getOnlineRegionsLocalContext()
public void addRegion(HRegion region)
MutableOnlineRegionsaddRegion in interface MutableOnlineRegionspublic FlushRequester getFlushRequester()
getFlushRequester in interface RegionServerServicespublic CompactionRequester getCompactionRequestor()
getCompactionRequestor in interface RegionServerServicesCompactionRequester or null. Usually it will not be null
unless during intialization.public LeaseManager getLeaseManager()
getLeaseManager in interface RegionServerServicespublic RegionServerCoprocessorHost getRegionServerCoprocessorHost()
public ConcurrentMap<byte[],Boolean> getRegionsInTransitionInRS()
RegionServerServicesgetRegionsInTransitionInRS in interface RegionServerServicespublic RegionServerRpcQuotaManager getRegionServerRpcQuotaManager()
getRegionServerRpcQuotaManager in interface RegionServerServicesRegionServerRpcQuotaManagerpublic Map<String,ReplicationStatus> getWalGroupsReplicationStatus()
public static void main(String[] args)
HRegionServerCommandLinepublic List<HRegion> getRegions(TableName tableName)
hbase:meta. Only returns online regions.
If a region on this table has been closed during a disable, etc., it will not be included in
the returned list. So, the returned list may not necessarily be ALL regions in this table, its
all the ONLINE regions in the table.getRegions in interface OnlineRegionsgetRegions in interface RegionServerServicestableName - table to limit the scope of the querytableNamepublic List<HRegion> getRegions()
OnlineRegionsgetRegions in interface OnlineRegionsgetRegions in interface RegionServerServicespublic Set<TableName> getOnlineTables()
public String[] getRegionServerCoprocessors()
protected boolean closeRegion(String encodedName, boolean abort, ServerName destination) throws NotServingRegionException
If an opening was in progress, this method will cancel it, but will not start a new close. The coprocessors are not called in this case. A NotServingRegionException exception is thrown.
If a close was in progress, this new request will be ignored, and an exception thrown.
encodedName - Region to closeabort - True if we are abortingdestination - Where the Region is being moved too... maybe null if unknown.NotServingRegionException - if the region is not onlinepublic HRegion getOnlineRegion(byte[] regionName)
regionName or null if named region is not
member of the online regions.public HRegion getRegion(String encodedRegionName)
OnlineRegionsRegion instance. Only works if caller is in same context, in same JVM. Region is
not serializable. n * @return Region for the passed encoded encodedRegionName or
null if named region is not member of the online regions.getRegion in interface OnlineRegionsgetRegion in interface RegionServerServicespublic boolean removeRegion(HRegion r, ServerName destination)
MutableOnlineRegionsremoveRegion in interface MutableOnlineRegionsr - Region to remove.destination - Destination, if any, null otherwise.protected HRegion getRegion(byte[] regionName) throws NotServingRegionException
regionName - Name of online HRegion to returnHRegion for regionNameNotServingRegionExceptionpublic HRegion getRegionByEncodedName(String encodedRegionName) throws NotServingRegionException
NotServingRegionExceptionpublic void updateRegionFavoredNodesMapping(String encodedRegionName, List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> favoredNodes)
FavoredNodesForRegionupdateRegionFavoredNodesMapping in interface FavoredNodesForRegionpublic InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName)
regionFavoredNodesMap on why we convert to InetSocketAddress[] here.getFavoredNodesForRegion in interface FavoredNodesForRegionencodedRegionName - the encoded region name.public ServerNonceManager getNonceManager()
RegionServerServicesgetNonceManager in interface RegionServerServices@InterfaceAudience.Private public org.apache.hadoop.hbase.regionserver.HRegionServer.MovedRegionInfo getMovedRegion(String encodedRegionName)
@InterfaceAudience.Private public int movedRegionCacheExpiredTime()
public CompactSplit getCompactSplitThread()
CompactSplit for the serverspublic Optional<BlockCache> getBlockCache()
getBlockCache in interface RegionServerServicespublic Optional<MobFileCache> getMobFileCache()
getMobFileCache in interface RegionServerServicespublic double getCompactionPressure()
getCompactionPressure in interface RegionServerServicesStore.getCompactionPressure()public HeapMemoryManager getHeapMemoryManager()
getHeapMemoryManager in interface RegionServerServicespublic MemStoreFlusher getMemStoreFlusher()
@InterfaceAudience.Private public boolean walRollRequestFinished()
public ThroughputController getFlushThroughputController()
getFlushThroughputController in interface RegionServerServicespublic double getFlushPressure()
getFlushPressure in interface RegionServerServicespublic void onConfigurationChange(org.apache.hadoop.conf.Configuration newConf)
onConfigurationChange in interface ConfigurationObserverpublic MetricsRegionServer getMetrics()
getMetrics in interface RegionServerServicespublic SecureBulkLoadManager getSecureBulkLoadManager()
getSecureBulkLoadManager in interface RegionServerServicesSecureBulkLoadManagerpublic EntityLock regionLock(List<RegionInfo> regionInfo, String description, Abortable abort)
RegionServerServicesregionLock in interface RegionServerServicespublic void unassign(byte[] regionName)
throws IOException
RegionServerServicesSee HBASE-17712 for more details.
unassign in interface RegionServerServicesIOExceptionpublic RegionServerSpaceQuotaManager getRegionServerSpaceQuotaManager()
getRegionServerSpaceQuotaManager in interface RegionServerServicesRegionServerSpaceQuotaManagerpublic boolean reportFileArchivalForQuotas(TableName tableName, Collection<Map.Entry<String,Long>> archivedFiles)
RegionServerServicestable were
just moved to the archive directory.reportFileArchivalForQuotas in interface RegionServerServicestableName - The name of the table that files previously belonged toarchivedFiles - Files and their sizes that were moved to archivetrue if the files were successfully reported, false otherwise.public void remoteProcedureComplete(long procId,
Throwable error)
public void finishRegionProcedure(long procId)
procId - the id of the open/close region procedure@InterfaceAudience.Private public CompactedHFilesDischarger getCompactedHFilesDischarger()
@InterfaceAudience.Private public long getRetryPauseTime()
HConstants.HBASE_RPC_SHORTOPERATION_RETRY_PAUSE_TIME}public Optional<ServerName> getActiveMaster()
ConnectionRegistryEndpointgetActiveMaster in interface ConnectionRegistryEndpointpublic List<ServerName> getBackupMasters()
ConnectionRegistryEndpointgetBackupMasters in interface ConnectionRegistryEndpointpublic Iterator<ServerName> getBootstrapNodes()
ConnectionRegistryEndpointgetBootstrapNodes in interface ConnectionRegistryEndpointpublic List<HRegionLocation> getMetaLocations()
ConnectionRegistryEndpointgetMetaLocations in interface ConnectionRegistryEndpointprotected NamedQueueRecorder createNamedQueueRecord()
createNamedQueueRecord in class HBaseServerBase<RSRpcServices>protected boolean clusterMode()
clusterMode in class HBaseServerBase<RSRpcServices>@InterfaceAudience.Private public BrokenStoreFileCleaner getBrokenStoreFileCleaner()
protected void stopChores()
stopChores in class HBaseServerBase<RSRpcServices>public RegionReplicationBufferManager getRegionReplicationBufferManager()
getRegionReplicationBufferManager in interface RegionServerServicesCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.