@InterfaceAudience.LimitedPrivate(value="Tools") public class HMaster extends HBaseServerBase<MasterRpcServices> implements MasterServices
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().Watcher| Modifier and Type | Class and Description |
|---|---|
protected static interface |
HMaster.TableDescriptorGetter
Implement to return TableDescriptor after pre-checks
|
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_HBASE_MASTER_CLEANER_INTERVAL |
static int |
DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS |
static String |
HBASE_MASTER_CLEANER_INTERVAL |
static String |
HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS |
static String |
MASTER |
static String |
WARMUP_BEFORE_MOVE |
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 |
|---|
HMaster(org.apache.hadoop.conf.Configuration conf)
Initializes the HMaster.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String reason,
Throwable cause) |
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
|
long |
addReplicationPeer(String peerId,
ReplicationPeerConfig peerConfig,
boolean enabled)
Add a new replication peer for replicating data to slave cluster
|
BalanceResponse |
balance() |
BalanceResponse |
balance(BalanceRequest request) |
BalanceResponse |
balanceOrUpdateMetrics()
Trigger a normal balance, see
balance() . |
boolean |
balanceSwitch(boolean b) |
protected boolean |
cacheTableDescriptor() |
protected boolean |
canCreateBaseZNode() |
protected boolean |
canUpdateTableDescriptor() |
void |
checkIfShouldMoveSystemRegionAsync()
Called when a new RegionServer is added to the cluster.
|
protected void |
checkServiceStarted() |
void |
checkTableModifiable(TableName tableName)
Check table is modifiable; i.e.
|
protected boolean |
clusterMode() |
protected void |
configureInfoServer(InfoServer infoServer) |
static HMaster |
constructMaster(Class<? extends HMaster> masterClass,
org.apache.hadoop.conf.Configuration conf)
Utility for constructing an instance of the passed HMaster class.
|
protected ActiveMasterManager |
createActiveMasterManager(ZKWatcher zk,
ServerName sn,
Server server)
Protected to have custom implementations in tests override the default ActiveMaster
implementation.
|
protected AssignmentManager |
createAssignmentManager(MasterServices master,
MasterRegion masterRegion) |
protected NamedQueueRecorder |
createNamedQueueRecord() |
protected MasterRpcServices |
createRpcServices() |
protected ServerManager |
createServerManager(MasterServices master,
RegionServerList storage)
Create a
ServerManager instance. |
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(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(org.apache.hadoop.conf.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
|
long |
disableReplicationPeer(String peerId)
Stop the replication stream to the specified peer
|
long |
disableTable(TableName tableName,
long nonceGroup,
long nonce)
Disable an existing table
|
long |
enableReplicationPeer(String peerId)
Restart the replication stream to the specified peer
|
long |
enableTable(TableName tableName,
long nonceGroup,
long nonce)
Enable an existing table
|
List<RegionPlan> |
executeRegionPlansWithThrottling(List<RegionPlan> plans)
Execute region plans with throttling
|
void |
flushMasterStore()
Flush master local region
|
Optional<ServerName> |
getActiveMaster()
Get active master address.
|
int |
getActiveMasterInfoPort() |
ActiveMasterManager |
getActiveMasterManager() |
AssignmentManager |
getAssignmentManager() |
double |
getAverageLoad()
Compute the average load across all region servers.
|
int |
getBackupMasterInfoPort(ServerName sn) |
List<ServerName> |
getBackupMasters()
Get backup masters address.
|
Iterator<ServerName> |
getBootstrapNodes()
Get a iterator of the available bootstrap nodes.
|
CatalogJanitor |
getCatalogJanitor() |
String |
getClientIdAuditPrefix() |
String |
getClusterId()
Get cluster id.
|
ClusterMetrics |
getClusterMetrics() |
ClusterMetrics |
getClusterMetrics(EnumSet<ClusterMetrics.Option> options) |
ClusterMetrics |
getClusterMetricsWithoutCoprocessor() |
ClusterMetrics |
getClusterMetricsWithoutCoprocessor(EnumSet<ClusterMetrics.Option> options) |
ClusterSchema |
getClusterSchema() |
CompactionState |
getCompactionState(TableName tableName)
Get the compaction state of the table
|
ConfigurationManager |
getConfigurationManager() |
protected Class<? extends javax.servlet.http.HttpServlet> |
getDumpServlet() |
FavoredNodesManager |
getFavoredNodesManager() |
HbckChore |
getHbckChore() |
HFileCleaner |
getHFileCleaner() |
List<HFileCleaner> |
getHFileCleaners() |
ProcedureEvent<?> |
getInitializedEvent() |
long |
getLastMajorCompactionTimestamp(TableName table) |
long |
getLastMajorCompactionTimestampForRegion(byte[] regionName)
n * @return the timestamp of the last successful major compaction for the passed region or 0 if
no HFile resulting from a major compaction exists n
|
Collection<ServerName> |
getLiveRegionServers() |
RSGroupBasedLoadBalancer |
getLoadBalancer() |
String |
getLoadBalancerClassName()
Fetch the configured
LoadBalancer class name. |
static String |
getLoadedCoprocessors()
The set of loaded coprocessors is stored in a static set.
|
LockManager |
getLockManager() |
List<LockedResource> |
getLocks()
Get locks
|
LogCleaner |
getLogCleaner() |
long |
getMasterActiveTime() |
MasterCoprocessorHost |
getMasterCoprocessorHost() |
String[] |
getMasterCoprocessors() |
MasterFileSystem |
getMasterFileSystem() |
long |
getMasterFinishedInitializationTime() |
MetricsMaster |
getMasterMetrics() |
ProcedureExecutor<MasterProcedureEnv> |
getMasterProcedureExecutor() |
MasterProcedureManagerHost |
getMasterProcedureManagerHost() |
MasterQuotaManager |
getMasterQuotaManager() |
MasterRegion |
getMasterRegion() |
MasterRpcServices |
getMasterRpcServices() |
long |
getMasterStartTime() |
MasterWalManager |
getMasterWalManager() |
List<HRegionLocation> |
getMetaLocations()
Get the location of meta regions.
|
MetaLocationSyncer |
getMetaLocationSyncer()
Get the meta location syncer.
|
org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState |
getMobCompactionState(TableName tableName)
Gets the mob file compaction state for a specific table.
|
int |
getNumWALFiles() |
List<Procedure<?>> |
getProcedures()
Get procedures
|
ProcedureStore |
getProcedureStore() |
protected String |
getProcessName() |
QuotaObserverChore |
getQuotaObserverChore() |
RegionNormalizerManager |
getRegionNormalizerManager() |
MemoryBoundedLogMessageBuffer |
getRegionServerFatalLogBuffer() |
int |
getRegionServerInfoPort(ServerName sn) |
String |
getRegionServerVersion(ServerName sn) |
HashMap<String,List<Pair<ServerName,ReplicationLoadSource>>> |
getReplicationLoad(ServerName[] serverNames) |
ReplicationPeerConfig |
getReplicationPeerConfig(String peerId)
Returns the configured ReplicationPeerConfig for the specified peer
|
ReplicationPeerManager |
getReplicationPeerManager()
Returns the
ReplicationPeerManager. |
RSGroupInfoManager |
getRSGroupInfoManager() |
ServerManager |
getServerManager() |
ServerName |
getServerName() |
SnapshotManager |
getSnapshotManager() |
SnapshotQuotaObserverChore |
getSnapshotQuotaObserverChore() |
SpaceQuotaSnapshotNotifier |
getSpaceQuotaSnapshotNotifier() |
SplitOrMergeTracker |
getSplitOrMergeTracker() |
SplitWALManager |
getSplitWALManager() |
SyncReplicationReplayWALManager |
getSyncReplicationReplayWALManager()
Returns the
SyncReplicationReplayWALManager. |
TableStateManager |
getTableStateManager() |
protected String |
getUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf) |
protected void |
initClusterSchemaService() |
boolean |
isActiveMaster()
Report whether this master is currently the active master or not.
|
boolean |
isBalancerOn()
Queries the state of the
LoadBalancerTracker. |
boolean |
isCatalogJanitorEnabled() |
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 |
isOnline()
Report whether this master is started This method is used for testing.
|
boolean |
isSplitOrMergeEnabled(MasterSwitchType switchType)
Queries the state of the
SplitOrMergeTracker. |
List<ServerName> |
listDecommissionedRegionServers()
List region servers marked as decommissioned (previously called 'draining') to not get regions
assigned to them.
|
List<String> |
listNamespaces()
List namespace names
|
List<ReplicationPeerDescription> |
listReplicationPeers(String regex)
Return a list of replication peers.
|
List<TableDescriptor> |
listTableDescriptors(String namespace,
String regex,
List<TableName> tableNameList,
boolean includeSysTables)
Returns the list of table descriptors that match the specified request
|
List<TableDescriptor> |
listTableDescriptorsByNamespace(String name)
Get list of table descriptors by namespace
|
List<TableName> |
listTableNames(String namespace,
String regex,
boolean includeSysTables)
Returns the list of table names that match the specified request
|
List<TableName> |
listTableNamesByNamespace(String name)
Get list of table names by namespace
|
protected void |
login(UserProvider user,
String host)
For compatibility, if failed with regionserver credentials, try the master one
|
static void |
main(String[] args) |
long |
mergeRegions(RegionInfo[] regionsToMerge,
boolean forcible,
long ng,
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 |
modifyColumnStoreFileTracker(TableName tableName,
byte[] family,
String dstSFT,
long nonceGroup,
long nonce)
Modify the store file tracker 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
|
long |
modifyTableStoreFileTracker(TableName tableName,
String dstSFT,
long nonceGroup,
long nonce)
Modify the store file tracker of an existing table
|
void |
move(byte[] encodedRegionName,
byte[] destServerName) |
boolean |
normalizeRegions(NormalizeTableFilterParams ntfp,
boolean isHighPriority)
Perform normalization of cluster.
|
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration newConf) |
void |
recommissionRegionServer(ServerName server,
List<byte[]> encodedRegionNames)
Remove decommission marker (previously called 'draining') from a region server to allow regions
assignments.
|
boolean |
registerService(org.apache.hbase.thirdparty.com.google.protobuf.Service instance)
Registers a new protocol buffer
Service subclass as a master coprocessor endpoint. |
void |
remoteProcedureCompleted(long procId) |
void |
remoteProcedureFailed(long procId,
RemoteProcedureException error) |
long |
removeReplicationPeer(String peerId)
Removes a peer and stops the replication
|
void |
reportMobCompactionEnd(TableName tableName) |
void |
reportMobCompactionStart(TableName tableName) |
long |
restoreSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc,
long nonceGroup,
long nonce,
boolean restoreAcl,
String customSFT) |
void |
run() |
void |
runReplicationBarrierCleaner()
Run the ReplicationBarrierChore.
|
void |
setCatalogJanitorEnabled(boolean b)
Switch for the background CatalogJanitor thread.
|
void |
setInitialized(boolean isInitialized) |
void |
shutdown()
Shutdown the cluster.
|
boolean |
skipRegionManagementAction(String action)
Checks master state before initiating action over region topology.
|
long |
splitRegion(RegionInfo regionInfo,
byte[] splitRow,
long nonceGroup,
long nonce)
Split a region.
|
protected void |
startProcedureExecutor() |
void |
stop(String msg) |
protected void |
stopChores() |
void |
stopMaster() |
protected void |
stopServiceThreads() |
long |
transitReplicationPeerSyncReplicationState(String peerId,
SyncReplicationState state)
Set current cluster state for a synchronous replication peer.
|
long |
truncateTable(TableName tableName,
boolean preserveSplits,
long nonceGroup,
long nonce)
Truncate a table
|
void |
updateConfigurationForQuotasObserver(org.apache.hadoop.conf.Configuration conf)
Adds the
MasterQuotasObserver to the list of configured Master observers to
automatically remove quotas for a table when that table is deleted. |
long |
updateReplicationPeerConfig(String peerId,
ReplicationPeerConfig peerConfig)
Update the peerConfig for the specified peer
|
boolean |
waitForMetaOnline()
Check hbase:meta is up and ready for reading.
|
closeClusterConnection, closeTableDescriptors, closeZooKeeper, createConnection, getAccessChecker, getAsyncClusterConnection, getChoreService, getConfiguration, getCoordinatedStateManager, getDataRootDir, getEventLoopGroupConfig, getExecutorService, getFileSystem, getInfoServer, getMetaRegionLocationCache, getMsgInterval, getNamedQueueRecorder, getRpcServer, getRpcServices, getStartcode, getTableDescriptors, getWALFileSystem, getWALRootDir, getZKPermissionWatcher, getZooKeeper, initializeFileSystem, initializeMemStoreChunkCreator, installShutdownHook, isAborted, isClusterUp, 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, getTableDescriptors, getZKPermissionWatcher, isClusterUpcreateConnection, getAsyncClusterConnection, getAsyncConnection, getChoreService, getConfiguration, getConnection, getCoordinatedStateManager, getFileSystem, getZooKeeper, isStoppingpublic static final String MASTER
public static final String HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS
public static final int DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS
public static final String HBASE_MASTER_CLEANER_INTERVAL
public static final int DEFAULT_HBASE_MASTER_CLEANER_INTERVAL
public static final String WARMUP_BEFORE_MOVE
public HMaster(org.apache.hadoop.conf.Configuration conf)
throws IOException
Remaining steps of initialization occur in
finishActiveMasterInitialization(MonitoredTask) after the master becomes the active
one.
IOExceptionprotected ActiveMasterManager createActiveMasterManager(ZKWatcher zk, ServerName sn, Server server) throws InterruptedIOException
InterruptedIOExceptionprotected String getUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf)
getUseThisHostnameInstead in class HBaseServerBase<MasterRpcServices>protected void login(UserProvider user, String host) throws IOException
login in class HBaseServerBase<MasterRpcServices>IOExceptionpublic MasterRpcServices getMasterRpcServices()
public boolean balanceSwitch(boolean b)
throws IOException
IOExceptionprotected String getProcessName()
getProcessName in class HBaseServerBase<MasterRpcServices>protected boolean canCreateBaseZNode()
canCreateBaseZNode in class HBaseServerBase<MasterRpcServices>protected boolean canUpdateTableDescriptor()
canUpdateTableDescriptor in class HBaseServerBase<MasterRpcServices>protected boolean cacheTableDescriptor()
cacheTableDescriptor in class HBaseServerBase<MasterRpcServices>protected MasterRpcServices createRpcServices() throws IOException
createRpcServices in class HBaseServerBase<MasterRpcServices>IOExceptionprotected void configureInfoServer(InfoServer infoServer)
configureInfoServer in class HBaseServerBase<MasterRpcServices>protected Class<? extends javax.servlet.http.HttpServlet> getDumpServlet()
getDumpServlet in class HBaseServerBase<MasterRpcServices>public MetricsMaster getMasterMetrics()
getMasterMetrics in interface MasterServicesMetricsMaster@InterfaceAudience.Private protected AssignmentManager createAssignmentManager(MasterServices master, MasterRegion masterRegion)
@InterfaceAudience.Private public boolean waitForMetaOnline()
@InterfaceAudience.Private public void updateConfigurationForQuotasObserver(org.apache.hadoop.conf.Configuration conf)
MasterQuotasObserver to the list of configured Master observers to
automatically remove quotas for a table when that table is deleted.@InterfaceAudience.Private protected ServerManager createServerManager(MasterServices master, RegionServerList storage) throws IOException
Create a ServerManager instance.
Will be overridden in tests.
IOException@InterfaceAudience.Private
protected void initClusterSchemaService()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean isCatalogJanitorEnabled()
public 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 SplitWALManager getSplitWALManager()
getSplitWALManager in interface MasterServicespublic TableStateManager getTableStateManager()
getTableStateManager in interface MasterServicesTableStateManagerprotected void stopServiceThreads()
protected void startProcedureExecutor()
throws IOException
IOExceptionprotected void stopChores()
stopChores in class HBaseServerBase<MasterRpcServices>public BalanceResponse balance() throws IOException
IOExceptionpublic BalanceResponse balanceOrUpdateMetrics() throws IOException
balance() . If the balance is not executed this
time, the metrics related to the balance will be updated. When balance is running, related
metrics will be updated at the same time. But if some checking logic failed and cause the
balancer exit early, we lost the chance to update balancer metrics. This will lead to user
missing the latest balancer info.IOExceptionpublic boolean skipRegionManagementAction(String action)
skipRegionManagementAction in interface MasterServicesaction - the name of the action under consideration, for logging.true when the caller should exit early, false otherwise.public BalanceResponse balance(BalanceRequest request) throws IOException
IOExceptionpublic List<RegionPlan> executeRegionPlansWithThrottling(List<RegionPlan> plans)
executeRegionPlansWithThrottling in interface MasterServicesplans - to executepublic RegionNormalizerManager getRegionNormalizerManager()
getRegionNormalizerManager in interface MasterServicesRegionNormalizerManagerpublic boolean normalizeRegions(NormalizeTableFilterParams ntfp, boolean isHighPriority) throws IOException
MasterServicesnormalizeRegions in interface MasterServicesntfp - Selection criteria for identifying which tables to normalize.isHighPriority - true when these requested tables should skip to the front of the
queue.true when the request was submitted, false otherwise.IOExceptionpublic 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 ng, long nonce) throws IOException
MasterServicesmergeRegions in interface MasterServicesregionsToMerge - daughter regions to mergeforcible - whether to force to merge even two regions are not adjacentng - used to detect duplicatenonce - used to detect duplicateIOExceptionpublic long splitRegion(RegionInfo regionInfo, byte[] splitRow, long nonceGroup, long nonce) throws IOException
MasterServicessplitRegion in interface MasterServicesregionInfo - region to splitsplitRow - split pointnonceGroup - used to detect duplicatenonce - used to detect duplicateIOException@InterfaceAudience.Private
public void move(byte[] encodedRegionName,
byte[] destServerName)
throws IOException
IOExceptionpublic long createTable(TableDescriptor tableDescriptor, byte[][] splitKeys, long nonceGroup, long nonce) throws IOException
MasterServicescreateTable in interface MasterServicestableDescriptor - The table definitionsplitKeys - Starting row keys for the initial table regions. If null nn * a single region
is created.IOExceptionpublic long createSystemTable(TableDescriptor tableDescriptor) throws IOException
MasterServicescreateSystemTable in interface MasterServicestableDescriptor - The system table definition a single region is created.IOExceptionpublic long deleteTable(TableName tableName, long nonceGroup, long nonce) throws IOException
MasterServicesdeleteTable in interface MasterServicestableName - The table name nnnIOExceptionpublic long truncateTable(TableName tableName, boolean preserveSplits, long nonceGroup, long nonce) throws IOException
MasterServicestruncateTable in interface MasterServicestableName - The table namepreserveSplits - True if the splits should be preserved nnnIOExceptionpublic long addColumn(TableName tableName, ColumnFamilyDescriptor column, long nonceGroup, long nonce) throws IOException
MasterServicesaddColumn in interface MasterServicestableName - The table namecolumn - The column definition nnnIOExceptionpublic long modifyColumn(TableName tableName, ColumnFamilyDescriptor descriptor, long nonceGroup, long nonce) throws IOException
MasterServicesmodifyColumn in interface MasterServicestableName - The table namedescriptor - The updated column definition nnnIOExceptionpublic long modifyColumnStoreFileTracker(TableName tableName, byte[] family, String dstSFT, long nonceGroup, long nonce) throws IOException
MasterServicesmodifyColumnStoreFileTracker in interface MasterServicesIOExceptionpublic long deleteColumn(TableName tableName, byte[] columnName, long nonceGroup, long nonce) throws IOException
MasterServicesdeleteColumn in interface MasterServicestableName - The table namecolumnName - The column name nnnIOExceptionpublic long enableTable(TableName tableName, long nonceGroup, long nonce) throws IOException
MasterServicesenableTable in interface MasterServicestableName - The table name nnnIOExceptionpublic long disableTable(TableName tableName, long nonceGroup, long nonce) throws IOException
MasterServicesdisableTable in interface MasterServicestableName - The table name nnnIOExceptionpublic long modifyTable(TableName tableName, TableDescriptor newDescriptor, long nonceGroup, long nonce) throws IOException
MasterServicesmodifyTable in interface MasterServicestableName - The table namenewDescriptor - The updated table descriptor nnnIOExceptionpublic long modifyTableStoreFileTracker(TableName tableName, String dstSFT, long nonceGroup, long nonce) throws IOException
MasterServicesmodifyTableStoreFileTracker in interface MasterServicesIOExceptionpublic long restoreSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc, long nonceGroup, long nonce, boolean restoreAcl, String customSFT) throws IOException
IOExceptionpublic void checkTableModifiable(TableName tableName) throws IOException, TableNotFoundException, TableNotDisabledException
MasterServicescheckTableModifiable in interface MasterServicestableName - Name of table to check. nnnIOExceptionTableNotFoundExceptionTableNotDisabledExceptionpublic ClusterMetrics getClusterMetricsWithoutCoprocessor() throws InterruptedIOException
InterruptedIOExceptionpublic ClusterMetrics getClusterMetricsWithoutCoprocessor(EnumSet<ClusterMetrics.Option> options) throws InterruptedIOException
InterruptedIOExceptionpublic ClusterMetrics getClusterMetrics() throws IOException
IOExceptionpublic ClusterMetrics getClusterMetrics(EnumSet<ClusterMetrics.Option> options) throws IOException
IOExceptionpublic int getActiveMasterInfoPort()
public int getBackupMasterInfoPort(ServerName sn)
sn - is ServerName of the backup masterpublic static String getLoadedCoprocessors()
public long getMasterStartTime()
public long getMasterActiveTime()
public long getMasterFinishedInitializationTime()
public int getNumWALFiles()
public ProcedureStore getProcedureStore()
public int getRegionServerInfoPort(ServerName sn)
public String getRegionServerVersion(ServerName sn)
getRegionServerVersion in interface MasterServicespublic void checkIfShouldMoveSystemRegionAsync()
MasterServicescheckIfShouldMoveSystemRegionAsync in interface MasterServicespublic String[] getMasterCoprocessors()
public MasterCoprocessorHost getMasterCoprocessorHost()
getMasterCoprocessorHost in interface MasterServicesMasterCoprocessorHostpublic MasterQuotaManager getMasterQuotaManager()
getMasterQuotaManager in interface MasterServicesMasterQuotaManagerpublic ProcedureExecutor<MasterProcedureEnv> getMasterProcedureExecutor()
getMasterProcedureExecutor in interface MasterServicesProcedureExecutorpublic ServerName getServerName()
getServerName in interface ServergetServerName in class HBaseServerBase<MasterRpcServices>public AssignmentManager getAssignmentManager()
getAssignmentManager in interface MasterServicesAssignmentManagerpublic CatalogJanitor getCatalogJanitor()
getCatalogJanitor in interface MasterServicesCatalogJanitorpublic MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer()
public void shutdown()
throws IOException
IOExceptionpublic void stopMaster()
throws IOException
IOExceptionprotected void checkServiceStarted()
throws ServerNotRunningYetException
ServerNotRunningYetExceptionpublic boolean isActiveMaster()
isActiveMaster in interface MasterServicespublic boolean isInitialized()
isInitialized in interface MasterServicespublic boolean isOnline()
public boolean isInMaintenanceMode()
isInMaintenanceMode in interface MasterServicespublic void setInitialized(boolean isInitialized)
public ProcedureEvent<?> getInitializedEvent()
getInitializedEvent in interface MasterServicespublic double getAverageLoad()
public boolean registerService(org.apache.hbase.thirdparty.com.google.protobuf.Service instance)
MasterServicesService subclass as a master coprocessor endpoint.
Only a single instance may be registered for a given Service subclass (the instances
are keyed on
Descriptors.ServiceDescriptor.getFullName().
After the first registration, subsequent calls with the same service name will fail with a
return value of false.registerService in interface MasterServicesinstance - the Service subclass instance to expose as a coprocessor endpointtrue if the registration was successful, false otherwisepublic static HMaster constructMaster(Class<? extends HMaster> masterClass, org.apache.hadoop.conf.Configuration conf)
public static void main(String[] args)
HMasterCommandLinepublic HFileCleaner getHFileCleaner()
public List<HFileCleaner> getHFileCleaners()
public LogCleaner getLogCleaner()
public SnapshotManager getSnapshotManager()
getSnapshotManager in interface MasterServicespublic MasterProcedureManagerHost getMasterProcedureManagerHost()
getMasterProcedureManagerHost in interface MasterServicespublic ClusterSchema getClusterSchema()
getClusterSchema in interface MasterServicesClusterSchemapublic List<String> listNamespaces() throws IOException
IOExceptionpublic List<TableName> listTableNamesByNamespace(String name) throws IOException
MasterServiceslistTableNamesByNamespace in interface MasterServicesname - namespace nameIOExceptionpublic List<TableDescriptor> listTableDescriptorsByNamespace(String name) throws IOException
MasterServiceslistTableDescriptorsByNamespace in interface MasterServicesname - namespace name nnIOExceptionpublic boolean abortProcedure(long procId,
boolean mayInterruptIfRunning)
throws IOException
MasterServicesabortProcedure in interface MasterServicesprocId - ID of the proceduremayInterruptIfRunning - if the proc completed at least one step, should it be aborted?IOExceptionpublic List<Procedure<?>> getProcedures() throws IOException
MasterServicesgetProcedures in interface MasterServicesIOExceptionpublic List<LockedResource> getLocks() throws IOException
MasterServicesgetLocks in interface MasterServicesIOExceptionpublic List<TableDescriptor> listTableDescriptors(String namespace, String regex, List<TableName> tableNameList, boolean includeSysTables) throws 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 tablesIOExceptionpublic List<TableName> listTableNames(String namespace, String regex, boolean includeSysTables) throws 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 tablesIOExceptionpublic long getLastMajorCompactionTimestamp(TableName table) throws IOException
getLastMajorCompactionTimestamp in interface MasterServicestable - the table for which last successful major compaction time is queriedIOExceptionpublic long getLastMajorCompactionTimestampForRegion(byte[] regionName)
throws IOException
MasterServicesgetLastMajorCompactionTimestampForRegion in interface MasterServicesIOExceptionpublic org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState getMobCompactionState(TableName tableName)
tableName - The current table name.public void reportMobCompactionStart(TableName tableName) throws IOException
IOExceptionpublic void reportMobCompactionEnd(TableName tableName) throws IOException
IOExceptionpublic boolean isBalancerOn()
LoadBalancerTracker. If the balancer is not initialized, false
is returned.isBalancerOn in interface MasterServicespublic 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 MasterSwitchTypepublic String getLoadBalancerClassName()
LoadBalancer class name. If none is set, a default is returned.
Notice that, the base load balancer will always be RSGroupBasedLoadBalancer now, so
this method will return the balancer used inside each rs group.LoadBalancer in use.public SplitOrMergeTracker getSplitOrMergeTracker()
public RSGroupBasedLoadBalancer getLoadBalancer()
getLoadBalancer in interface MasterServicespublic FavoredNodesManager getFavoredNodesManager()
getFavoredNodesManager in interface MasterServicespublic long addReplicationPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException, 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 DISABLEDReplicationExceptionIOExceptionpublic long removeReplicationPeer(String peerId) throws ReplicationException, IOException
MasterServicesremoveReplicationPeer in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic long enableReplicationPeer(String peerId) throws ReplicationException, IOException
MasterServicesenableReplicationPeer in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic long disableReplicationPeer(String peerId) throws ReplicationException, IOException
MasterServicesdisableReplicationPeer in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic ReplicationPeerConfig getReplicationPeerConfig(String peerId) throws ReplicationException, IOException
MasterServicesgetReplicationPeerConfig in interface MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic long updateReplicationPeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException, IOException
MasterServicesupdateReplicationPeerConfig in interface MasterServicespeerId - a short name that identifies the peerpeerConfig - new config for the peerReplicationExceptionIOExceptionpublic List<ReplicationPeerDescription> listReplicationPeers(String regex) throws ReplicationException, IOException
MasterServiceslistReplicationPeers in interface MasterServicesregex - The regular expression to match peer idReplicationExceptionIOExceptionpublic long transitReplicationPeerSyncReplicationState(String peerId, SyncReplicationState state) throws ReplicationException, IOException
MasterServicestransitReplicationPeerSyncReplicationState in interface MasterServicespeerId - a short name that identifies the peerstate - state of current clusterReplicationExceptionIOExceptionpublic void decommissionRegionServers(List<ServerName> servers, boolean offload) throws IOException
servers - Region servers to decommission.IOExceptionpublic List<ServerName> listDecommissionedRegionServers()
public void recommissionRegionServer(ServerName server, List<byte[]> encodedRegionNames) throws IOException
server - Region server to remove decommission marker from.IOExceptionpublic LockManager getLockManager()
getLockManager in interface MasterServicesLockManager to lock namespaces/tables/regions.public QuotaObserverChore getQuotaObserverChore()
public SpaceQuotaSnapshotNotifier getSpaceQuotaSnapshotNotifier()
public void remoteProcedureCompleted(long procId)
public void remoteProcedureFailed(long procId,
RemoteProcedureException error)
public ReplicationPeerManager getReplicationPeerManager()
MasterServicesReplicationPeerManager.getReplicationPeerManager in interface MasterServicespublic HashMap<String,List<Pair<ServerName,ReplicationLoadSource>>> getReplicationLoad(ServerName[] serverNames)
@InterfaceAudience.Private public static void decorateMasterConfiguration(org.apache.hadoop.conf.Configuration conf)
public SnapshotQuotaObserverChore getSnapshotQuotaObserverChore()
public ActiveMasterManager getActiveMasterManager()
public SyncReplicationReplayWALManager getSyncReplicationReplayWALManager()
MasterServicesSyncReplicationReplayWALManager.getSyncReplicationReplayWALManager in interface MasterServicespublic HbckChore getHbckChore()
public void runReplicationBarrierCleaner()
MasterServicesrunReplicationBarrierCleaner in interface MasterServicespublic RSGroupInfoManager getRSGroupInfoManager()
getRSGroupInfoManager in interface MasterServicesRSGroupInfoManagerpublic CompactionState getCompactionState(TableName tableName)
tableName - The table namepublic MetaLocationSyncer getMetaLocationSyncer()
MasterServicesgetMetaLocationSyncer in interface MasterServicespublic MasterRegion getMasterRegion()
public void onConfigurationChange(org.apache.hadoop.conf.Configuration newConf)
onConfigurationChange in interface ConfigurationObserverprotected NamedQueueRecorder createNamedQueueRecord()
createNamedQueueRecord in class HBaseServerBase<MasterRpcServices>protected boolean clusterMode()
clusterMode in class HBaseServerBase<MasterRpcServices>public String getClusterId()
ConnectionRegistryEndpointgetClusterId in interface ConnectionRegistryEndpointpublic 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 ConnectionRegistryEndpointpublic void flushMasterStore()
throws IOException
MasterServicesflushMasterStore in interface MasterServicesIOExceptionpublic Collection<ServerName> getLiveRegionServers()
public ConfigurationManager getConfigurationManager()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.