public class HMaster extends HRegionServer implements MasterServices
The Master can be asked shutdown the cluster. See shutdown(). In
this case it will tell all regionservers to go down and then wait on them
all reporting in that they are down. This master will then shut itself down.
You can also shutdown just this master. Call stopMaster().
org.apache.zookeeper.Watcher| Modifier and Type | Class and Description |
|---|---|
static class |
HMaster.MasterStoppedException |
static class |
HMaster.RedirectServlet |
protected static interface |
HMaster.TableDescriptorGetter
Implement to return TableDescriptor after pre-checks
|
HRegionServer.MovedRegionsCleanerRegionServerServices.PostOpenDeployContext, RegionServerServices.RegionStateTransitionContext| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS |
static java.lang.String |
HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS |
static java.lang.String |
MASTER |
cacheConfig, cacheFlusher, clusterConnection, clusterId, clusterStatusTracker, compactSplitThread, conf, configurationManager, csm, executorService, fs, fsOk, fsUtilizationChore, hMemManager, infoServer, leases, lock, MASTER_HOSTNAME_KEY, metaTableLocator, movedRegions, msgInterval, numRegionsToReport, onlineRegions, regionFavoredNodesMap, REGIONSERVER, regionsInTransitionInRS, replicationSinkHandler, replicationSourceHandler, rpcServices, secureBulkLoadManager, serverName, sleeper, startcode, tableDescriptors, TEST_SKIP_REPORTING_TRANSITION, threadWakeFrequency, useThisHostnameInstead, walFactory, walFs, walRoller, zooKeeper| Constructor and Description |
|---|
HMaster(Configuration conf)
Initializes the HMaster.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.lang.String reason,
java.lang.Throwable cause)
Cause the server to exit without closing the regions it is serving, the log
it is using and without notifying the master.
|
boolean |
abortProcedure(long procId,
boolean mayInterruptIfRunning)
Abort a procedure.
|
long |
addColumn(TableName tableName,
ColumnFamilyDescriptor column,
long nonceGroup,
long nonce)
Add a new column to an existing table
|
void |
addReplicationPeer(java.lang.String peerId,
ReplicationPeerConfig peerConfig,
boolean enabled)
Add a new replication peer for replicating data to slave cluster
|
boolean |
balance() |
boolean |
balance(boolean force) |
boolean |
balanceSwitch(boolean b) |
protected boolean |
canCreateBaseZNode() |
protected boolean |
canUpdateTableDescriptor() |
void |
checkIfShouldMoveSystemRegionAsync()
Called when a new RegionServer is added to the cluster.
|
void |
checkTableModifiable(TableName tableName)
Check table is modifiable; i.e.
|
protected void |
configureInfoServer() |
static HMaster |
constructMaster(java.lang.Class<? extends HMaster> masterClass,
Configuration conf)
Utility for constructing an instance of the passed HMaster class.
|
protected MasterMetaBootstrap |
createMetaBootstrap()
Create a
MasterMetaBootstrap instance. |
protected RSRpcServices |
createRpcServices() |
long |
createSystemTable(TableDescriptor tableDescriptor)
Create a system table using the given table definition.
|
long |
createTable(TableDescriptor tableDescriptor,
byte[][] splitKeys,
long nonceGroup,
long nonce)
Create a table using the given table definition.
|
void |
decommissionRegionServers(java.util.List<ServerName> servers,
boolean offload)
Mark region server(s) as decommissioned (previously called 'draining') to prevent additional
regions from getting assigned to them.
|
static void |
decorateMasterConfiguration(Configuration conf)
This method modifies the master's configuration in order to inject replication-related features
|
long |
deleteColumn(TableName tableName,
byte[] columnName,
long nonceGroup,
long nonce)
Delete a column from an existing table
|
long |
deleteTable(TableName tableName,
long nonceGroup,
long nonce)
Delete a table
|
void |
disableReplicationPeer(java.lang.String peerId)
Stop the replication stream to the specified peer
|
long |
disableTable(TableName tableName,
long nonceGroup,
long nonce)
Disable an existing table
|
void |
enableReplicationPeer(java.lang.String peerId)
Restart the replication stream to the specified peer
|
long |
enableTable(TableName tableName,
long nonceGroup,
long nonce)
Enable an existing table
|
AssignmentManager |
getAssignmentManager() |
double |
getAverageLoad()
Compute the average load across all region servers.
|
CatalogJanitor |
getCatalogJanitor() |
java.lang.String |
getClientIdAuditPrefix() |
ClusterMetrics |
getClusterMetrics() |
ClusterMetrics |
getClusterMetrics(java.util.EnumSet<Option> options) |
ClusterMetrics |
getClusterMetricsWithoutCoprocessor() |
ClusterMetrics |
getClusterMetricsWithoutCoprocessor(java.util.EnumSet<Option> options) |
ClusterSchema |
getClusterSchema() |
protected java.lang.Class<? extends HttpServlet> |
getDumpServlet() |
FavoredNodesManager |
getFavoredNodesManager() |
HFileCleaner |
getHFileCleaner() |
ProcedureEvent |
getInitializedEvent() |
long |
getLastMajorCompactionTimestamp(TableName table) |
long |
getLastMajorCompactionTimestampForRegion(byte[] regionName) |
LoadBalancer |
getLoadBalancer() |
java.lang.String |
getLoadBalancerClassName()
Fetch the configured
LoadBalancer class name. |
static java.lang.String |
getLoadedCoprocessors()
The set of loaded coprocessors is stored in a static set.
|
LockManager |
getLockManager() |
java.util.List<LockedResource> |
getLocks()
Get locks
|
LogCleaner |
getLogCleaner() |
long |
getMasterActiveTime() |
MasterCoprocessorHost |
getMasterCoprocessorHost() |
java.lang.String[] |
getMasterCoprocessors() |
MasterFileSystem |
getMasterFileSystem() |
long |
getMasterFinishedInitializationTime() |
MetricsMaster |
getMasterMetrics() |
<any> |
getMasterProcedureExecutor() |
MasterProcedureManagerHost |
getMasterProcedureManagerHost() |
MasterQuotaManager |
getMasterQuotaManager() |
MasterRpcServices |
getMasterRpcServices() |
long |
getMasterStartTime() |
MasterWalManager |
getMasterWalManager() |
long |
getMergePlanCount() |
protected java.util.function.Function<TableDescriptorBuilder,TableDescriptorBuilder> |
getMetaTableObserver() |
CompactionState |
getMobCompactionState(TableName tableName)
Gets the mob file compaction state for a specific table.
|
int |
getNumWALFiles() |
java.util.List<<any>> |
getProcedures()
Get procedures
|
protected java.lang.String |
getProcessName() |
QuotaObserverChore |
getQuotaObserverChore() |
RegionNormalizer |
getRegionNormalizer() |
RegionNormalizerTracker |
getRegionNormalizerTracker() |
MemoryBoundedLogMessageBuffer |
getRegionServerFatalLogBuffer() |
int |
getRegionServerInfoPort(ServerName sn) |
java.lang.String |
getRegionServerVersion(ServerName sn) |
ReplicationPeerConfig |
getReplicationPeerConfig(java.lang.String peerId)
Returns the configured ReplicationPeerConfig for the specified peer
|
ProcedureEvent |
getServerCrashProcessingEnabledEvent() |
ServerManager |
getServerManager() |
ServerName |
getServerName() |
SnapshotManager |
getSnapshotManager() |
SnapshotQuotaObserverChore |
getSnapshotQuotaObserverChore() |
SpaceQuotaSnapshotNotifier |
getSpaceQuotaSnapshotNotifier() |
SplitOrMergeTracker |
getSplitOrMergeTracker() |
long |
getSplitPlanCount() |
TableDescriptors |
getTableDescriptors() |
TableStateManager |
getTableStateManager() |
protected java.lang.String |
getUseThisHostnameInstead(Configuration conf) |
WALProcedureStore |
getWalProcedureStore() |
ZKWatcher |
getZooKeeper()
Gets the ZooKeeper instance for this server.
|
boolean |
isActiveMaster()
Report whether this master is currently the active master or not.
|
boolean |
isBalancerOn()
Queries the state of the
LoadBalancerTracker. |
boolean |
isInitialized()
Report whether this master has completed with its initialization and is
ready.
|
boolean |
isInMaintenanceMode()
Report whether this master is in maintenance mode.
|
boolean |
isNormalizerOn()
Queries the state of the
RegionNormalizerTracker. |
boolean |
isServerCrashProcessingEnabled()
ServerCrashProcessingEnabled is set false before completing assignMeta to prevent processing
of crashed servers.
|
boolean |
isSplitOrMergeEnabled(MasterSwitchType switchType)
Queries the state of the
SplitOrMergeTracker. |
java.util.List<ServerName> |
listDecommissionedRegionServers()
List region servers marked as decommissioned (previously called 'draining') to not get regions
assigned to them.
|
java.util.List<ReplicationPeerDescription> |
listReplicationPeers(java.lang.String regex)
Return a list of replication peers.
|
java.util.List<TableDescriptor> |
listTableDescriptors(java.lang.String namespace,
java.lang.String regex,
java.util.List<TableName> tableNameList,
boolean includeSysTables)
Returns the list of table descriptors that match the specified request
|
java.util.List<TableDescriptor> |
listTableDescriptorsByNamespace(java.lang.String name)
Get list of table descriptors by namespace
|
java.util.List<TableName> |
listTableNames(java.lang.String namespace,
java.lang.String regex,
boolean includeSysTables)
Returns the list of table names that match the specified request
|
java.util.List<TableName> |
listTableNamesByNamespace(java.lang.String name)
Get list of table names by namespace
|
protected void |
login(UserProvider user,
java.lang.String host)
For compatibility, if failed with regionserver credentials, try the master one
|
static void |
main(java.lang.String[] args) |
long |
mergeRegions(RegionInfo[] regionsToMerge,
boolean forcible,
long nonceGroup,
long nonce)
Merge regions in a table.
|
long |
modifyColumn(TableName tableName,
ColumnFamilyDescriptor descriptor,
long nonceGroup,
long nonce)
Modify the column descriptor of an existing column in an existing table
|
long |
modifyTable(TableName tableName,
TableDescriptor newDescriptor,
long nonceGroup,
long nonce)
Modify the descriptor of an existing table
|
void |
move(byte[] encodedRegionName,
byte[] destServerName) |
boolean |
normalizeRegions()
Perform normalization of cluster (invoked by
RegionNormalizerChore). |
void |
recommissionRegionServer(ServerName server,
java.util.List<byte[]> encodedRegionNames)
Remove decommission marker (previously called 'draining') from a region server to allow regions
assignments.
|
boolean |
recoverMeta()
Recover meta table.
|
boolean |
registerService(Service instance)
Registers a new protocol buffer
Service subclass as a coprocessor endpoint to be
available for handling |
void |
removeReplicationPeer(java.lang.String peerId)
Removes a peer and stops the replication
|
void |
reportMobCompactionEnd(TableName tableName) |
void |
reportMobCompactionStart(TableName tableName) |
void |
requestMobCompaction(TableName tableName,
java.util.List<ColumnFamilyDescriptor> columns,
boolean allFiles)
Requests mob compaction.
|
long |
restoreSnapshot(SnapshotDescription snapshotDesc,
long nonceGroup,
long nonce,
boolean restoreAcl) |
void |
run()
The HRegionServer sticks in this loop until closed.
|
void |
setCatalogJanitorEnabled(boolean b)
Switch for the background CatalogJanitor thread.
|
void |
setInitialized(boolean isInitialized) |
void |
setServerCrashProcessingEnabled(boolean b) |
void |
shutdown()
Shutdown the cluster.
|
long |
splitRegion(RegionInfo regionInfo,
byte[] splitRow,
long nonceGroup,
long nonce)
Split a region.
|
void |
stop(java.lang.String msg) |
void |
stopMaster() |
protected void |
stopServiceThreads()
Wait on all threads to finish.
|
long |
truncateTable(TableName tableName,
boolean preserveSplits,
long nonceGroup,
long nonce)
Truncate a table
|
void |
updateConfigurationForSpaceQuotaObserver(Configuration conf)
Adds the
MasterSpaceQuotaObserver to the list of configured Master observers to
automatically remove space quotas for a table when that table is deleted. |
void |
updateReplicationPeerConfig(java.lang.String peerId,
ReplicationPeerConfig peerConfig)
Update the peerConfig for the specified peer
|
protected void |
waitForMasterActive()
If configured to put regions on active master,
wait till a backup master becomes active.
|
abort, addRegion, addToMovedRegions, checkFileSystem, cleanMovedRegions, clearRegionBlockCache, closeAllRegions, closeAndOfflineRegionForSplitOrMerge, closeRegion, constructRegionServer, convertThrowableToIOE, createClusterConnection, createConnection, createRegionLoad, createRegionServerStatusStub, createRegionServerStatusStub, execRegionServerService, getCacheConfig, getChoreService, getClusterConnection, getClusterId, getCompactionPressure, getCompactionRequestor, getCompactSplitThread, getConfiguration, getConfigurationManager, getConnection, getCoordinatedStateManager, getEventLoopGroupConfig, getExecutorService, getFavoredNodesForRegion, getFileSystem, getFlushPressure, getFlushRequester, getFlushThroughputController, getFsTableDescriptors, getHeapMemoryManager, getInfoServer, getLastSequenceId, getLeases, getMasterAddressTracker, getMetaTableLocator, getMetrics, getMostLoadedRegions, getNonceManager, getNumberOfOnlineRegions, getOnlineRegion, getOnlineRegionsLocalContext, getOnlineTables, getRegion, getRegion, getRegionBlockLocations, getRegionByEncodedName, getRegionByEncodedName, getRegions, getRegions, getRegionServerAccounting, getRegionServerCoprocessorHost, getRegionServerCoprocessors, getRegionServerMetrics, getRegionServerRpcQuotaManager, getRegionServerSpaceQuotaManager, getRegionsInTransitionInRS, getReplicationSourceService, getRootDir, getRpcServer, getRSRpcServices, getSecureBulkLoadManager, getStartcode, getThreadWakeFrequency, getWAL, getWALFileSystem, getWalRoller, getWALRootDir, getWALs, handleReportForDutyResponse, initializeMemStoreChunkCreator, isAborted, isClusterUp, isOnline, isStopped, isStopping, kill, movedRegionCleanerPeriod, onConfigurationChange, postOpenDeployTasks, regionLock, removeRegion, reportFileArchivalForQuotas, reportRegionSizesForQuotas, reportRegionStateTransition, sendShutdownInterrupt, setupClusterConnection, stop, toString, tryRegionServerReport, unassign, updateConfiguration, updateRegionFavoredNodesMapping, waitForServerOnline, walRollRequestFinishedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetExecutorService, isClusterUpcreateConnection, getChoreService, getClusterConnection, getConfiguration, getConnection, getCoordinatedStateManager, getFileSystem, getMetaTableLocator, isStoppingpublic static final java.lang.String MASTER
public static final java.lang.String HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS
public static final int DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS
public HMaster(Configuration conf)
throws java.io.IOException,
KeeperException
Remaining steps of initialization occur in #finishActiveMasterInitialization(MonitoredTask) after the master becomes the active one.
java.io.IOExceptionKeeperExceptionprotected java.lang.String getUseThisHostnameInstead(Configuration conf)
getUseThisHostnameInstead in class HRegionServerpublic void run()
HRegionServerrun in class HRegionServerprotected java.util.function.Function<TableDescriptorBuilder,TableDescriptorBuilder> getMetaTableObserver()
getMetaTableObserver in class HRegionServerprotected void login(UserProvider user,
java.lang.String host)
throws java.io.IOException
login in class HRegionServerjava.io.IOExceptionprotected void waitForMasterActive()
waitForMasterActive in class HRegionServerpublic MasterRpcServices getMasterRpcServices()
public boolean balanceSwitch(boolean b)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String getProcessName()
getProcessName in class HRegionServerprotected boolean canCreateBaseZNode()
canCreateBaseZNode in class HRegionServerprotected boolean canUpdateTableDescriptor()
canUpdateTableDescriptor in class HRegionServerprotected RSRpcServices createRpcServices() throws java.io.IOException
createRpcServices in class HRegionServerjava.io.IOExceptionprotected void configureInfoServer()
configureInfoServer in class HRegionServerprotected java.lang.Class<? extends HttpServlet> getDumpServlet()
getDumpServlet in class HRegionServerpublic MetricsMaster getMasterMetrics()
getMasterMetrics in interface MasterServicesMetricsMasterpublic void updateConfigurationForSpaceQuotaObserver(Configuration conf)
MasterSpaceQuotaObserver to the list of configured Master observers to
automatically remove space quotas for a table when that table is deleted.protected MasterMetaBootstrap createMetaBootstrap()
Create a MasterMetaBootstrap instance.
Will be overridden in tests.
public TableDescriptors getTableDescriptors()
getTableDescriptors in interface MasterServicesgetTableDescriptors in class HRegionServerpublic ServerManager getServerManager()
getServerManager in interface MasterServicesServerManager instance.public MasterFileSystem getMasterFileSystem()
getMasterFileSystem in interface MasterServicesMasterFileSystem utility class.public MasterWalManager getMasterWalManager()
getMasterWalManager in interface MasterServicesMasterWalManager utility class.public TableStateManager getTableStateManager()
getTableStateManager in interface MasterServicesTableStateManagerprotected void stopServiceThreads()
HRegionServerstopServiceThreads in class HRegionServerpublic boolean balance()
throws java.io.IOException
java.io.IOExceptionpublic boolean balance(boolean force)
throws java.io.IOException
java.io.IOExceptionpublic RegionNormalizer getRegionNormalizer()
getRegionNormalizer in interface MasterServicesRegionNormalizerpublic boolean normalizeRegions()
throws java.io.IOException
RegionNormalizerChore).java.io.IOExceptionpublic java.lang.String getClientIdAuditPrefix()
getClientIdAuditPrefix in interface MasterServicespublic void setCatalogJanitorEnabled(boolean b)
b - If false, the catalog janitor won't do anything.public long mergeRegions(RegionInfo[] regionsToMerge,
boolean forcible,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesmergeRegions in interface MasterServicesregionsToMerge - daughter regions to mergeforcible - whether to force to merge even two regions are not adjacentnonceGroup - used to detect duplicatenonce - used to detect duplicatejava.io.IOExceptionpublic long splitRegion(RegionInfo regionInfo,
byte[] splitRow,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicessplitRegion in interface MasterServicesregionInfo - region to splitsplitRow - split pointnonceGroup - used to detect duplicatenonce - used to detect duplicatejava.io.IOExceptionpublic void move(byte[] encodedRegionName,
byte[] destServerName)
throws HBaseIOException
HBaseIOExceptionpublic long createTable(TableDescriptor tableDescriptor,
byte[][] splitKeys,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicescreateTable in interface MasterServicestableDescriptor - The table definitionsplitKeys - Starting row keys for the initial table regions. If nullnonce - a single region is created.java.io.IOExceptionpublic long createSystemTable(TableDescriptor tableDescriptor)
throws java.io.IOException
MasterServicescreateSystemTable in interface MasterServicestableDescriptor - The system table definition
a single region is created.java.io.IOExceptionpublic long deleteTable(TableName tableName,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesdeleteTable in interface MasterServicestableName - The table namejava.io.IOExceptionpublic long truncateTable(TableName tableName,
boolean preserveSplits,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicestruncateTable in interface MasterServicestableName - The table namepreserveSplits - True if the splits should be preservedjava.io.IOExceptionpublic long addColumn(TableName tableName,
ColumnFamilyDescriptor column,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesaddColumn in interface MasterServicestableName - The table namecolumn - The column definitionjava.io.IOExceptionpublic long modifyColumn(TableName tableName,
ColumnFamilyDescriptor descriptor,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesmodifyColumn in interface MasterServicestableName - The table namedescriptor - The updated column definitionjava.io.IOExceptionpublic long deleteColumn(TableName tableName,
byte[] columnName,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesdeleteColumn in interface MasterServicestableName - The table namecolumnName - The column namejava.io.IOExceptionpublic long enableTable(TableName tableName,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesenableTable in interface MasterServicestableName - The table namejava.io.IOExceptionpublic long disableTable(TableName tableName,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesdisableTable in interface MasterServicestableName - The table namejava.io.IOExceptionpublic long modifyTable(TableName tableName,
TableDescriptor newDescriptor,
long nonceGroup,
long nonce)
throws java.io.IOException
MasterServicesmodifyTable in interface MasterServicestableName - The table namenewDescriptor - The updated table descriptorjava.io.IOExceptionpublic long restoreSnapshot(SnapshotDescription snapshotDesc,
long nonceGroup,
long nonce,
boolean restoreAcl)
throws java.io.IOException
java.io.IOExceptionpublic void checkTableModifiable(TableName tableName)
throws java.io.IOException,
TableNotFoundException,
TableNotDisabledException
MasterServicescheckTableModifiable in interface MasterServicestableName - Name of table to check.java.io.IOExceptionTableNotFoundExceptionTableNotDisabledExceptionpublic ClusterMetrics getClusterMetricsWithoutCoprocessor()
throws java.io.InterruptedIOException
java.io.InterruptedIOExceptionpublic ClusterMetrics getClusterMetricsWithoutCoprocessor(java.util.EnumSet<Option> options)
throws java.io.InterruptedIOException
java.io.InterruptedIOExceptionpublic ClusterMetrics getClusterMetrics()
throws java.io.IOException
java.io.IOExceptionpublic ClusterMetrics getClusterMetrics(java.util.EnumSet<Option> options)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String getLoadedCoprocessors()
public long getMasterStartTime()
public long getMasterActiveTime()
public long getMasterFinishedInitializationTime()
public int getNumWALFiles()
public WALProcedureStore getWalProcedureStore()
public int getRegionServerInfoPort(ServerName sn)
public java.lang.String getRegionServerVersion(ServerName sn)
getRegionServerVersion in interface MasterServicespublic void checkIfShouldMoveSystemRegionAsync()
MasterServicescheckIfShouldMoveSystemRegionAsync in interface MasterServicespublic java.lang.String[] getMasterCoprocessors()
public void abort(java.lang.String reason,
java.lang.Throwable cause)
HRegionServerabort in class HRegionServerreason - the reason we are abortingcause - the exception that caused the abort, or nullpublic ZKWatcher getZooKeeper()
ServergetZooKeeper in interface ServergetZooKeeper in class HRegionServerpublic MasterCoprocessorHost getMasterCoprocessorHost()
getMasterCoprocessorHost in interface MasterServicesMasterCoprocessorHostpublic MasterQuotaManager getMasterQuotaManager()
getMasterQuotaManager in interface MasterServicesMasterQuotaManagerpublic <any> getMasterProcedureExecutor()
getMasterProcedureExecutor in interface MasterServicesProcedureExecutorpublic ServerName getServerName()
getServerName in interface ServergetServerName in class HRegionServerpublic AssignmentManager getAssignmentManager()
getAssignmentManager in interface MasterServicesAssignmentManagerpublic CatalogJanitor getCatalogJanitor()
getCatalogJanitor in interface MasterServicesCatalogJanitorpublic MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer()
public void shutdown()
throws java.io.IOException
java.io.IOExceptionpublic void stopMaster()
throws java.io.IOException
java.io.IOExceptionpublic void stop(java.lang.String msg)
stop in class HRegionServerpublic boolean isActiveMaster()
isActiveMaster in interface MasterServicespublic boolean isInitialized()
isInitialized in interface MasterServicespublic boolean isInMaintenanceMode()
throws java.io.IOException
isInMaintenanceMode in interface MasterServicesjava.io.IOException - if the inquiry failed due to an IO problempublic void setInitialized(boolean isInitialized)
public ProcedureEvent getInitializedEvent()
getInitializedEvent in interface MasterServicespublic boolean isServerCrashProcessingEnabled()
isServerCrashProcessingEnabled in interface MasterServicespublic void setServerCrashProcessingEnabled(boolean b)
public ProcedureEvent getServerCrashProcessingEnabledEvent()
public double getAverageLoad()
public long getSplitPlanCount()
public long getMergePlanCount()
public boolean registerService(Service instance)
RegionServerServicesService subclass as a coprocessor endpoint to be
available for handlingregisterService in interface MasterServicesregisterService in interface RegionServerServicesregisterService in class HRegionServerinstance - the Service subclass instance to expose as a coprocessor endpointtrue if the registration was successful, falsepublic static HMaster constructMaster(java.lang.Class<? extends HMaster> masterClass, Configuration conf)
masterClass - public static void main(java.lang.String[] args)
HMasterCommandLinepublic HFileCleaner getHFileCleaner()
public LogCleaner getLogCleaner()
public SnapshotManager getSnapshotManager()
getSnapshotManager in interface MasterServicespublic MasterProcedureManagerHost getMasterProcedureManagerHost()
getMasterProcedureManagerHost in interface MasterServicespublic ClusterSchema getClusterSchema()
getClusterSchema in interface MasterServicesClusterSchemapublic java.util.List<TableName> listTableNamesByNamespace(java.lang.String name)
throws java.io.IOException
MasterServiceslistTableNamesByNamespace in interface MasterServicesname - namespace namejava.io.IOExceptionpublic java.util.List<TableDescriptor> listTableDescriptorsByNamespace(java.lang.String name)
throws java.io.IOException
MasterServiceslistTableDescriptorsByNamespace in interface MasterServicesname - namespace namejava.io.IOExceptionpublic boolean abortProcedure(long procId,
boolean mayInterruptIfRunning)
throws java.io.IOException
MasterServicesabortProcedure in interface MasterServicesprocId - ID of the proceduremayInterruptIfRunning - if the proc completed at least one step, should it be aborted?java.io.IOExceptionpublic java.util.List<<any>> getProcedures()
throws java.io.IOException
MasterServicesgetProcedures in interface MasterServicesjava.io.IOExceptionpublic java.util.List<LockedResource> getLocks()
throws java.io.IOException
MasterServicesgetLocks in interface MasterServicesjava.io.IOExceptionpublic java.util.List<TableDescriptor> listTableDescriptors(java.lang.String namespace,
java.lang.String regex,
java.util.List<TableName> tableNameList,
boolean includeSysTables)
throws java.io.IOException
namespace - the namespace to query, or null if querying for allregex - The regular expression to match against, or null if querying for alltableNameList - the list of table names, or null if querying for allincludeSysTables - False to match only against userspace tablesjava.io.IOExceptionpublic java.util.List<TableName> listTableNames(java.lang.String namespace,
java.lang.String regex,
boolean includeSysTables)
throws java.io.IOException
regex - The regular expression to match against, or null if querying for allnamespace - the namespace to query, or null if querying for allincludeSysTables - False to match only against userspace tablesjava.io.IOExceptionpublic long getLastMajorCompactionTimestamp(TableName table)
throws java.io.IOException
getLastMajorCompactionTimestamp in interface MasterServicestable - the table for which last successful major compaction time is queriedjava.io.IOExceptionpublic long getLastMajorCompactionTimestampForRegion(byte[] regionName)
throws java.io.IOException
getLastMajorCompactionTimestampForRegion in interface MasterServicesjava.io.IOExceptionpublic CompactionState getMobCompactionState(TableName tableName)
tableName - The current table name.public void reportMobCompactionStart(TableName tableName)
throws java.io.IOException
java.io.IOExceptionpublic void reportMobCompactionEnd(TableName tableName)
throws java.io.IOException
java.io.IOExceptionpublic void requestMobCompaction(TableName tableName,
java.util.List<ColumnFamilyDescriptor> columns,
boolean allFiles)
throws java.io.IOException
tableName - The table the compact.columns - The compacted columns.allFiles - Whether add all mob files into the compaction.java.io.IOExceptionpublic boolean isBalancerOn()
LoadBalancerTracker. If the balancer is not initialized,
false is returned.public boolean isNormalizerOn()
RegionNormalizerTracker. If it's not initialized,
false is returned.public boolean isSplitOrMergeEnabled(MasterSwitchType switchType)
SplitOrMergeTracker. If it is not initialized,
false is returned. If switchType is illegal, false will return.isSplitOrMergeEnabled in interface MasterServicesswitchType - see org.apache.hadoop.hbase.client.MasterSwitchTypepublic java.lang.String getLoadBalancerClassName()
LoadBalancer class name. If none is set, a default is returned.LoadBalancer in use.public RegionNormalizerTracker getRegionNormalizerTracker()
public SplitOrMergeTracker getSplitOrMergeTracker()
public LoadBalancer getLoadBalancer()
getLoadBalancer in interface MasterServicespublic FavoredNodesManager getFavoredNodesManager()
getFavoredNodesManager in interface MasterServicespublic void addReplicationPeer(java.lang.String peerId,
ReplicationPeerConfig peerConfig,
boolean enabled)
throws ReplicationException,
java.io.IOException
MasterServicesaddReplicationPeer in interface MasterServicespeerId - a short name that identifies the peerpeerConfig - configuration for the replication slave clusterenabled - peer state, true if ENABLED and false if DISABLEDReplicationExceptionjava.io.IOExceptionpublic void removeReplicationPeer(java.lang.String peerId)
throws ReplicationException,
java.io.IOException
MasterServicesremoveReplicationPeer in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionjava.io.IOExceptionpublic void enableReplicationPeer(java.lang.String peerId)
throws ReplicationException,
java.io.IOException
MasterServicesenableReplicationPeer in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionjava.io.IOExceptionpublic void disableReplicationPeer(java.lang.String peerId)
throws ReplicationException,
java.io.IOException
MasterServicesdisableReplicationPeer in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionjava.io.IOExceptionpublic ReplicationPeerConfig getReplicationPeerConfig(java.lang.String peerId)
throws ReplicationException,
java.io.IOException
MasterServicesgetReplicationPeerConfig in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionjava.io.IOExceptionpublic void updateReplicationPeerConfig(java.lang.String peerId,
ReplicationPeerConfig peerConfig)
throws ReplicationException,
java.io.IOException
MasterServicesupdateReplicationPeerConfig in interface MasterServicespeerId - a short name that identifies the peerpeerConfig - new config for the peerReplicationExceptionjava.io.IOExceptionpublic java.util.List<ReplicationPeerDescription> listReplicationPeers(java.lang.String regex)
throws ReplicationException,
java.io.IOException
MasterServiceslistReplicationPeers in interface MasterServicesregex - The regular expression to match peer idReplicationExceptionjava.io.IOExceptionpublic void decommissionRegionServers(java.util.List<ServerName> servers,
boolean offload)
throws HBaseIOException
servers - Region servers to decommission.HBaseIOExceptionpublic java.util.List<ServerName> listDecommissionedRegionServers()
public void recommissionRegionServer(ServerName server,
java.util.List<byte[]> encodedRegionNames)
throws HBaseIOException
server - Region server to remove decommission marker from.HBaseIOExceptionpublic LockManager getLockManager()
getLockManager in interface MasterServicesLockManager to lock namespaces/tables/regions.public boolean recoverMeta()
throws java.io.IOException
MasterServicesrecoverMeta in interface MasterServicesjava.io.IOExceptionpublic QuotaObserverChore getQuotaObserverChore()
public SpaceQuotaSnapshotNotifier getSpaceQuotaSnapshotNotifier()
public static void decorateMasterConfiguration(Configuration conf)
public SnapshotQuotaObserverChore getSnapshotQuotaObserverChore()