Package org.apache.hadoop.hbase
Class HBaseServerBase<R extends HBaseRpcServicesBase<?>>
java.lang.Object
java.lang.Thread
org.apache.hadoop.hbase.HBaseServerBase<R>
- All Implemented Interfaces:
Runnable
,Abortable
,ConnectionRegistryEndpoint
,ConfigurationObserver
,Server
,Stoppable
- Direct Known Subclasses:
HMaster
,HRegionServer
@Private
public abstract class HBaseServerBase<R extends HBaseRpcServicesBase<?>>
extends Thread
implements Server, ConfigurationObserver, ConnectionRegistryEndpoint
Base class for hbase services, such as master or region server.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AtomicBoolean
protected AsyncClusterConnection
The asynchronous cluster connection to be shared by services.protected final ChoreService
ChoreService used to schedule tasks that we want to run periodicallyprotected final ClusterStatusTracker
protected final org.apache.hadoop.conf.Configuration
protected final ConfigurationManager
Configuration manager is used to register/deregister and notify the configuration observers when the regionserver is notified that there was a change in the on disk configs.protected final CoordinatedStateManager
protected HFileSystem
protected org.apache.hadoop.fs.Path
protected final NettyEventLoopGroupConfig
protected final ExecutorService
protected InfoServer
private boolean
private static final org.slf4j.Logger
protected final MetaRegionLocationCache
Cache for the meta region replica's locations.protected final int
protected final NamedQueueRecorder
Provide online slow log responses from ringbufferprotected final R
protected ServerName
The server name the Master sees us as.protected final Sleeper
protected final long
This servers startcode.protected boolean
protected TableDescriptors
Go here to get table descriptors.protected final UserProvider
protected final String
hostname specified by hostname configprotected HFileSystem
protected org.apache.hadoop.fs.Path
protected final ZKWatcher
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
protected abstract boolean
protected abstract boolean
protected final void
protected final void
protected final void
protected abstract boolean
protected abstract void
configureInfoServer
(InfoServer infoServer) createConnection
(org.apache.hadoop.conf.Configuration conf) protected abstract NamedQueueRecorder
protected abstract R
Returns a reference to the servers' async cluster connection.Returns TheChoreService
instance for this serverorg.apache.hadoop.conf.Configuration
Gets the configuration object for this server.Get CoordinatedStateManager instance for this server.protected abstract CoprocessorHost<?,
?> org.apache.hadoop.fs.Path
Returns Return the rootDir.protected abstract Class<? extends javax.servlet.http.HttpServlet>
org.apache.hadoop.fs.FileSystem
Returns Return the FileSystem object used (can return null!).int
get NamedQueue Provider to add different logs to ringbufferprotected abstract String
Returns The unique server name for this server.long
Returns time stamp in millis of when this server was startedReturns Return table descriptors implementation.protected abstract String
getUseThisHostnameInstead
(org.apache.hadoop.conf.Configuration conf) org.apache.hadoop.fs.FileSystem
Returns Return the walFs.org.apache.hadoop.fs.Path
Returns Return the walRootDir.Gets the ZooKeeper instance for this server.protected final void
protected final void
initializeMemStoreChunkCreator
(HeapMemoryManager hMemManager) protected final void
In order to register ShutdownHook, this method is called when HMaster and HRegionServer are started.boolean
Check if the server or client was aborted.boolean
Returns True if the cluster is up.boolean
boolean
Returns True ifStoppable.stop(String)
has been closed.protected abstract void
login
(UserProvider user, String host) private void
private void
private void
Puts up the webui.protected final boolean
Sets the abort state if not already set.protected final void
Setup our cluster connection if not already initialized.private void
protected final void
shutdownChore
(ScheduledChore chore) protected abstract void
protected final void
protected final void
protected final void
toString()
void
Reload the configuration from disk.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.conf.ConfigurationObserver
onConfigurationChange
Methods inherited from interface org.apache.hadoop.hbase.client.ConnectionRegistryEndpoint
getActiveMaster, getBackupMasters, getBootstrapNodes, getClusterId, getMetaLocations
Methods inherited from interface org.apache.hadoop.hbase.Server
getAsyncConnection, getConnection, isStopping
-
Field Details
-
LOG
-
conf
-
abortRequested
-
stopped
-
isShutdownHookInstalled
-
startcode
This servers startcode. -
userProvider
-
zooKeeper
-
serverName
The server name the Master sees us as. Its made from the hostname the master passes us, port, and server startcode. Gets set after registration against Master. -
rpcServices
-
useThisHostnameInstead
hostname specified by hostname config -
namedQueueRecorder
Provide online slow log responses from ringbuffer -
configurationManager
Configuration manager is used to register/deregister and notify the configuration observers when the regionserver is notified that there was a change in the on disk configs. -
choreService
ChoreService used to schedule tasks that we want to run periodically -
executorService
-
clusterStatusTracker
-
csm
-
infoServer
-
dataFs
-
walFs
-
dataRootDir
-
walRootDir
-
msgInterval
-
sleeper
-
tableDescriptors
Go here to get table descriptors. -
asyncClusterConnection
The asynchronous cluster connection to be shared by services. -
metaRegionLocationCache
Cache for the meta region replica's locations. Also tracks their changes to avoid stale cache entries. Used for serving ClientMetaService. -
eventLoopGroupConfig
-
-
Constructor Details
-
HBaseServerBase
- Throws:
IOException
-
-
Method Details
-
setupSignalHandlers
-
setupClusterConnection
Setup our cluster connection if not already initialized.- Throws:
IOException
-
initializeFileSystem
- Throws:
IOException
-
putUpWebUI
Puts up the webui.- Throws:
IOException
-
setAbortRequested
Sets the abort state if not already set.- Returns:
- True if abortRequested set to True successfully, false if an abort is already in progress.
-
isStopped
Description copied from interface:Stoppable
Returns True ifStoppable.stop(String)
has been closed. -
isAborted
Description copied from interface:Abortable
Check if the server or client was aborted. -
getConfiguration
Description copied from interface:Server
Gets the configuration object for this server.- Specified by:
getConfiguration
in interfaceServer
-
getAsyncClusterConnection
Description copied from interface:Server
Returns a reference to the servers' async cluster connection. Important note: this method returns a reference to Connection which is managed by Server itself, so callers must NOT attempt to close connection obtained.- Specified by:
getAsyncClusterConnection
in interfaceServer
-
getZooKeeper
Description copied from interface:Server
Gets the ZooKeeper instance for this server.- Specified by:
getZooKeeper
in interfaceServer
-
shutdownChore
-
initializeMemStoreChunkCreator
-
stopChores
-
stopChoreService
-
stopExecutorService
-
closeClusterConnection
-
stopInfoServer
-
closeZooKeeper
-
closeTableDescriptors
-
installShutdownHook
In order to register ShutdownHook, this method is called when HMaster and HRegionServer are started. For details, please refer to HBASE-26951 -
isShutdownHookInstalled
-
getServerName
Description copied from interface:Server
Returns The unique server name for this server.- Specified by:
getServerName
in interfaceServer
-
getChoreService
Description copied from interface:Server
Returns TheChoreService
instance for this server- Specified by:
getChoreService
in interfaceServer
-
getTableDescriptors
Returns Return table descriptors implementation. -
getExecutorService
-
getAccessChecker
-
getZKPermissionWatcher
-
getCoordinatedStateManager
Description copied from interface:Server
Get CoordinatedStateManager instance for this server.- Specified by:
getCoordinatedStateManager
in interfaceServer
-
createConnection
- Specified by:
createConnection
in interfaceServer
- Throws:
IOException
-
getDataRootDir
Returns Return the rootDir. -
getFileSystem
Description copied from interface:Server
Returns Return the FileSystem object used (can return null!).- Specified by:
getFileSystem
in interfaceServer
-
getWALRootDir
Returns Return the walRootDir. -
getWALFileSystem
Returns Return the walFs. -
isClusterUp
Returns True if the cluster is up. -
getStartcode
Returns time stamp in millis of when this server was started -
getInfoServer
-
getMsgInterval
-
getNamedQueueRecorder
get NamedQueue Provider to add different logs to ringbuffer -
getRpcServer
-
getEventLoopGroupConfig
-
getRpcServices
-
getMetaRegionLocationCache
-
getConfigurationManager
-
updateConfiguration
Reload the configuration from disk.- Throws:
IOException
-
preUpdateConfiguration
- Throws:
IOException
-
postUpdateConfiguration
- Throws:
IOException
-
toString
-
getCoprocessorHost
-
canCreateBaseZNode
-
getProcessName
-
createRpcServices
- Throws:
IOException
-
getUseThisHostnameInstead
protected abstract String getUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
login
- Throws:
IOException
-
createNamedQueueRecord
-
configureInfoServer
-
getDumpServlet
-
canUpdateTableDescriptor
-
cacheTableDescriptor
-
clusterMode
-