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
FieldsModifier and TypeFieldDescriptionprotected final AtomicBooleanprotected AsyncClusterConnectionThe asynchronous cluster connection to be shared by services.protected final ChoreServiceChoreService used to schedule tasks that we want to run periodicallyprotected final ClusterStatusTrackerprotected final org.apache.hadoop.conf.Configurationprotected final ConfigurationManagerConfiguration 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 CoordinatedStateManagerprotected HFileSystemprotected org.apache.hadoop.fs.Pathprotected final NettyEventLoopGroupConfigprotected final ExecutorServiceprotected InfoServerprivate booleanprivate static final org.slf4j.Loggerprotected final MetaRegionLocationCacheCache for the meta region replica's locations.protected final intprotected final NamedQueueRecorderProvide online slow log responses from ringbufferprotected final Rprotected ServerNameThe server name the Master sees us as.protected final Sleeperprotected final longThis servers startcode.protected booleanprotected TableDescriptorsGo here to get table descriptors.protected final UserProviderprotected final Stringhostname specified by hostname configprotected HFileSystemprotected org.apache.hadoop.fs.Pathprotected final ZKWatcherFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanprotected abstract booleanprotected abstract booleanprotected final voidprotected final voidprotected final voidprotected abstract booleanprotected abstract voidconfigureInfoServer(InfoServer infoServer) createConnection(org.apache.hadoop.conf.Configuration conf) protected abstract NamedQueueRecorderprotected abstract RReturns a reference to the servers' async cluster connection.Returns TheChoreServiceinstance for this serverorg.apache.hadoop.conf.ConfigurationGets the configuration object for this server.Get CoordinatedStateManager instance for this server.protected abstract CoprocessorHost<?,?> org.apache.hadoop.fs.PathReturns Return the rootDir.protected abstract Class<? extends javax.servlet.http.HttpServlet>org.apache.hadoop.fs.FileSystemReturns Return the FileSystem object used (can return null!).intget NamedQueue Provider to add different logs to ringbufferprotected abstract StringReturns The unique server name for this server.longReturns time stamp in millis of when this server was startedReturns Return table descriptors implementation.protected abstract StringgetUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf) org.apache.hadoop.fs.FileSystemReturns Return the walFs.org.apache.hadoop.fs.PathReturns Return the walRootDir.Gets the ZooKeeper instance for this server.protected final voidprotected final voidinitializeMemStoreChunkCreator(HeapMemoryManager hMemManager) protected final voidIn order to register ShutdownHook, this method is called when HMaster and HRegionServer are started.booleanCheck if the server or client was aborted.booleanReturns True if the cluster is up.booleanbooleanReturns True ifStoppable.stop(String)has been closed.protected abstract voidlogin(UserProvider user, String host) private voidprivate voidprivate voidPuts up the webui.protected final booleanSets the abort state if not already set.protected final voidSetup our cluster connection if not already initialized.private voidprotected final voidshutdownChore(ScheduledChore chore) protected abstract voidprotected final voidprotected final voidprotected final voidtoString()voidReload 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, yieldMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.conf.ConfigurationObserver
onConfigurationChangeMethods inherited from interface org.apache.hadoop.hbase.client.ConnectionRegistryEndpoint
getActiveMaster, getBackupMasters, getBootstrapNodes, getClusterId, getMetaLocationsMethods 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:StoppableReturns True ifStoppable.stop(String)has been closed. -
isAborted
Description copied from interface:AbortableCheck if the server or client was aborted. -
getConfiguration
Description copied from interface:ServerGets the configuration object for this server.- Specified by:
getConfigurationin interfaceServer
-
getAsyncClusterConnection
Description copied from interface:ServerReturns 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:
getAsyncClusterConnectionin interfaceServer
-
getZooKeeper
Description copied from interface:ServerGets the ZooKeeper instance for this server.- Specified by:
getZooKeeperin 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:ServerReturns The unique server name for this server.- Specified by:
getServerNamein interfaceServer
-
getChoreService
Description copied from interface:ServerReturns TheChoreServiceinstance for this server- Specified by:
getChoreServicein interfaceServer
-
getTableDescriptors
Returns Return table descriptors implementation. -
getExecutorService
-
getAccessChecker
-
getZKPermissionWatcher
-
getCoordinatedStateManager
Description copied from interface:ServerGet CoordinatedStateManager instance for this server.- Specified by:
getCoordinatedStateManagerin interfaceServer
-
createConnection
- Specified by:
createConnectionin interfaceServer- Throws:
IOException
-
getDataRootDir
Returns Return the rootDir. -
getFileSystem
Description copied from interface:ServerReturns Return the FileSystem object used (can return null!).- Specified by:
getFileSystemin 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
-