@InterfaceAudience.LimitedPrivate(value="Tools") 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().
Watcher| 限定符和类型 | 类和说明 |
|---|---|
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| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS |
static String |
HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS |
static String |
MASTER |
ABORT_TIMEOUT, ABORT_TIMEOUT_TASK, 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| 构造器和说明 |
|---|
HMaster(org.apache.hadoop.conf.Configuration conf)
Initializes the HMaster.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
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
|
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.
|
protected void |
checkServiceStarted() |
void |
checkTableModifiable(TableName tableName)
Check table is modifiable; i.e. exists and is offline.
|
protected void |
configureInfoServer() |
static HMaster |
constructMaster(Class<? extends HMaster> masterClass,
org.apache.hadoop.conf.Configuration conf)
Utility for constructing an instance of the passed HMaster class.
|
protected org.apache.hadoop.hbase.master.MasterMetaBootstrap |
createMetaBootstrap()
Create a
MasterMetaBootstrap instance. |
protected RSRpcServices |
createRpcServices() |
protected ServerManager |
createServerManager(MasterServices master)
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
|
AssignmentManager |
getAssignmentManager() |
double |
getAverageLoad()
Compute the average load across all region servers.
|
CatalogJanitor |
getCatalogJanitor() |
String |
getClientIdAuditPrefix() |
ClusterMetrics |
getClusterMetrics() |
ClusterMetrics |
getClusterMetrics(EnumSet<ClusterMetrics.Option> options) |
ClusterMetrics |
getClusterMetricsWithoutCoprocessor() |
ClusterMetrics |
getClusterMetricsWithoutCoprocessor(EnumSet<ClusterMetrics.Option> options) |
ClusterSchema |
getClusterSchema() |
protected Class<? extends javax.servlet.http.HttpServlet> |
getDumpServlet() |
FavoredNodesManager |
getFavoredNodesManager() |
HFileCleaner |
getHFileCleaner() |
ProcedureEvent<?> |
getInitializedEvent() |
long |
getLastMajorCompactionTimestamp(TableName table) |
long |
getLastMajorCompactionTimestampForRegion(byte[] regionName) |
LoadBalancer |
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() |
MasterRpcServices |
getMasterRpcServices() |
long |
getMasterStartTime() |
MasterWalManager |
getMasterWalManager() |
long |
getMergePlanCount() |
protected Function<TableDescriptorBuilder,TableDescriptorBuilder> |
getMetaTableObserver() |
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
|
protected String |
getProcessName() |
QuotaObserverChore |
getQuotaObserverChore() |
RegionNormalizer |
getRegionNormalizer() |
RegionNormalizerTracker |
getRegionNormalizerTracker() |
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. |
ServerManager |
getServerManager() |
ServerName |
getServerName() |
SnapshotManager |
getSnapshotManager() |
SpaceQuotaSnapshotNotifier |
getSpaceQuotaSnapshotNotifier() |
SplitOrMergeTracker |
getSplitOrMergeTracker() |
long |
getSplitPlanCount() |
TableDescriptors |
getTableDescriptors() |
TableStateManager |
getTableStateManager() |
protected String |
getUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf) |
WALProcedureStore |
getWalProcedureStore() |
ZKWatcher |
getZooKeeper()
Gets the ZooKeeper instance for this server.
|
protected void |
initClusterSchemaService() |
protected void |
initializeZKBasedSystemTrackers()
Initialize all ZK based system trackers.
|
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 |
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<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 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,
List<byte[]> encodedRegionNames)
Remove decommission marker (previously called 'draining') from a region server to allow regions
assignments.
|
boolean |
registerService(com.google.protobuf.Service instance)
Registers a new protocol buffer
Service subclass as a coprocessor endpoint to be
available for handling |
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) |
void |
requestMobCompaction(TableName tableName,
List<ColumnFamilyDescriptor> columns,
boolean allFiles)
Requests mob compaction.
|
long |
restoreSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.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 |
shutdown()
Shutdown the cluster.
|
long |
splitRegion(RegionInfo regionInfo,
byte[] splitRow,
long nonceGroup,
long nonce)
Split a region.
|
void |
stop(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 |
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
|
protected void |
waitForMasterActive()
If configured to put regions on active master,
wait till a backup master becomes active.
|
boolean |
waitForMetaOnline()
Check hbase:meta is up and ready for reading.
|
boolean |
waitForNamespaceOnline()
Check hbase:namespace table is assigned.
|
abort, addRegion, addToMovedRegions, checkFileSystem, cleanMovedRegions, clearRegionBlockCache, closeAllRegions, closeAndOfflineRegionForSplitOrMerge, closeRegion, constructRegionServer, convertThrowableToIOE, createClusterConnection, createConnection, createRegionLoad, createRegionServerStatusStub, createRegionServerStatusStub, execRegionServerService, executeProcedure, 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, getWalGroupsReplicationStatus, getWalRoller, getWALRootDir, getWALs, handleReportForDutyResponse, initializeMemStoreChunkCreator, isAborted, isClusterUp, isOnline, isShutDown, isStopped, isStopping, kill, movedRegionCleanerPeriod, onConfigurationChange, postOpenDeployTasks, regionLock, remoteProcedureComplete, removeRegion, reportRegionSizesForQuotas, reportRegionStateTransition, sendShutdownInterrupt, setupClusterConnection, stop, toString, tryRegionServerReport, unassign, updateConfiguration, updateRegionFavoredNodesMapping, waitForServerOnline, walRollRequestFinishedgetName, getThread, interrupt, isAlive, isInterrupted, join, join, join, setDaemon, setName, setPriority, setUncaughtExceptionHandler, startclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetExecutorService, isClusterUpcreateConnection, getChoreService, getClusterConnection, getConfiguration, getConnection, getCoordinatedStateManager, getFileSystem, getMetaTableLocator, isStoppingpublic static final String HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS
public static final int DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS
public HMaster(org.apache.hadoop.conf.Configuration conf)
throws IOException,
org.apache.zookeeper.KeeperException
Remaining steps of initialization occur in #finishActiveMasterInitialization(MonitoredTask) after the master becomes the active one.
IOExceptionorg.apache.zookeeper.KeeperExceptionprotected String getUseThisHostnameInstead(org.apache.hadoop.conf.Configuration conf)
public void run()
HRegionServerrun 在接口中 Runnablerun 在类中 HRegionServerprotected Function<TableDescriptorBuilder,TableDescriptorBuilder> getMetaTableObserver()
getMetaTableObserver 在类中 HRegionServerprotected void login(UserProvider user, String host) throws IOException
login 在类中 HRegionServerIOExceptionprotected void waitForMasterActive()
waitForMasterActive 在类中 HRegionServerpublic MasterRpcServices getMasterRpcServices()
public boolean balanceSwitch(boolean b)
throws IOException
IOExceptionprotected String getProcessName()
getProcessName 在类中 HRegionServerprotected boolean canCreateBaseZNode()
canCreateBaseZNode 在类中 HRegionServerprotected boolean canUpdateTableDescriptor()
protected RSRpcServices createRpcServices() throws IOException
createRpcServices 在类中 HRegionServerIOExceptionprotected void configureInfoServer()
configureInfoServer 在类中 HRegionServerprotected Class<? extends javax.servlet.http.HttpServlet> getDumpServlet()
getDumpServlet 在类中 HRegionServerpublic MetricsMaster getMasterMetrics()
getMasterMetrics 在接口中 MasterServicesMetricsMasterprotected void initializeZKBasedSystemTrackers()
throws IOException,
InterruptedException,
org.apache.zookeeper.KeeperException,
ReplicationException
Initialize all ZK based system trackers. But do not include RegionServerTracker, it
should have already been initialized along with ServerManager.
Will be overridden in tests.
IOExceptionInterruptedExceptionorg.apache.zookeeper.KeeperExceptionReplicationExceptionpublic boolean waitForMetaOnline()
throws InterruptedException
InterruptedExceptionpublic boolean waitForNamespaceOnline()
throws InterruptedException
InterruptedExceptionpublic 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.protected org.apache.hadoop.hbase.master.MasterMetaBootstrap createMetaBootstrap()
Create a MasterMetaBootstrap instance.
Will be overridden in tests.
protected ServerManager createServerManager(MasterServices master) throws IOException
Create a ServerManager instance.
Will be overridden in tests.
IOExceptionprotected void initClusterSchemaService()
throws IOException,
InterruptedException
public TableDescriptors getTableDescriptors()
getTableDescriptors 在接口中 MasterServicesgetTableDescriptors 在类中 HRegionServerpublic ServerManager getServerManager()
getServerManager 在接口中 MasterServicesServerManager instance.public MasterFileSystem getMasterFileSystem()
getMasterFileSystem 在接口中 MasterServicesMasterFileSystem utility class.public MasterWalManager getMasterWalManager()
getMasterWalManager 在接口中 MasterServicesMasterWalManager utility class.public TableStateManager getTableStateManager()
getTableStateManager 在接口中 MasterServicesTableStateManagerprotected void stopServiceThreads()
HRegionServerstopServiceThreads 在类中 HRegionServerpublic boolean balance()
throws IOException
IOExceptionpublic boolean balance(boolean force)
throws IOException
IOExceptionpublic RegionNormalizer getRegionNormalizer()
getRegionNormalizer 在接口中 MasterServicesRegionNormalizerpublic boolean normalizeRegions()
throws IOException
RegionNormalizerChore).IOExceptionpublic String getClientIdAuditPrefix()
getClientIdAuditPrefix 在接口中 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 IOException
MasterServicesmergeRegions 在接口中 MasterServicesregionsToMerge - daughter regions to mergeforcible - whether to force to merge even two regions are not adjacentnonceGroup - used to detect duplicatenonce - used to detect duplicateIOExceptionpublic long splitRegion(RegionInfo regionInfo, byte[] splitRow, long nonceGroup, long nonce) throws IOException
MasterServicessplitRegion 在接口中 MasterServicesregionInfo - region to splitsplitRow - split pointnonceGroup - used to detect duplicatenonce - used to detect duplicateIOExceptionpublic void move(byte[] encodedRegionName,
byte[] destServerName)
throws HBaseIOException
HBaseIOExceptionpublic long createTable(TableDescriptor tableDescriptor, byte[][] splitKeys, long nonceGroup, long nonce) throws IOException
MasterServicescreateTable 在接口中 MasterServicestableDescriptor - The table definitionsplitKeys - Starting row keys for the initial table regions. If nullnonce - a single region is created.IOExceptionpublic long createSystemTable(TableDescriptor tableDescriptor) throws IOException
MasterServicescreateSystemTable 在接口中 MasterServicestableDescriptor - The system table definition
a single region is created.IOExceptionpublic long deleteTable(TableName tableName, long nonceGroup, long nonce) throws IOException
MasterServicesdeleteTable 在接口中 MasterServicestableName - The table nameIOExceptionpublic long truncateTable(TableName tableName, boolean preserveSplits, long nonceGroup, long nonce) throws IOException
MasterServicestruncateTable 在接口中 MasterServicestableName - The table namepreserveSplits - True if the splits should be preservedIOExceptionpublic long addColumn(TableName tableName, ColumnFamilyDescriptor column, long nonceGroup, long nonce) throws IOException
MasterServicesaddColumn 在接口中 MasterServicestableName - The table namecolumn - The column definitionIOExceptionpublic long modifyColumn(TableName tableName, ColumnFamilyDescriptor descriptor, long nonceGroup, long nonce) throws IOException
MasterServicesmodifyColumn 在接口中 MasterServicestableName - The table namedescriptor - The updated column definitionIOExceptionpublic long deleteColumn(TableName tableName, byte[] columnName, long nonceGroup, long nonce) throws IOException
MasterServicesdeleteColumn 在接口中 MasterServicestableName - The table namecolumnName - The column nameIOExceptionpublic long enableTable(TableName tableName, long nonceGroup, long nonce) throws IOException
MasterServicesenableTable 在接口中 MasterServicestableName - The table nameIOExceptionpublic long disableTable(TableName tableName, long nonceGroup, long nonce) throws IOException
MasterServicesdisableTable 在接口中 MasterServicestableName - The table nameIOExceptionpublic long modifyTable(TableName tableName, TableDescriptor newDescriptor, long nonceGroup, long nonce) throws IOException
MasterServicesmodifyTable 在接口中 MasterServicestableName - The table namenewDescriptor - The updated table descriptorIOExceptionpublic long restoreSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc, long nonceGroup, long nonce, boolean restoreAcl) throws IOException
IOExceptionpublic void checkTableModifiable(TableName tableName) throws IOException, TableNotFoundException, TableNotDisabledException
MasterServicescheckTableModifiable 在接口中 MasterServicestableName - Name of table to check.TableNotDisabledExceptionTableNotFoundExceptionIOExceptionpublic ClusterMetrics getClusterMetricsWithoutCoprocessor() throws InterruptedIOException
public ClusterMetrics getClusterMetricsWithoutCoprocessor(EnumSet<ClusterMetrics.Option> options) throws InterruptedIOException
public ClusterMetrics getClusterMetrics() throws IOException
IOExceptionpublic ClusterMetrics getClusterMetrics(EnumSet<ClusterMetrics.Option> options) throws IOException
IOExceptionpublic static String getLoadedCoprocessors()
public long getMasterStartTime()
public long getMasterActiveTime()
public long getMasterFinishedInitializationTime()
public int getNumWALFiles()
public WALProcedureStore getWalProcedureStore()
public int getRegionServerInfoPort(ServerName sn)
public String getRegionServerVersion(ServerName sn)
getRegionServerVersion 在接口中 MasterServicespublic void checkIfShouldMoveSystemRegionAsync()
MasterServicespublic String[] getMasterCoprocessors()
public void abort(String reason, Throwable cause)
HRegionServerabort 在接口中 Abortableabort 在类中 HRegionServerreason - the reason we are abortingcause - the exception that caused the abort, or nullpublic ZKWatcher getZooKeeper()
ServergetZooKeeper 在接口中 ServergetZooKeeper 在类中 HRegionServerpublic MasterCoprocessorHost getMasterCoprocessorHost()
getMasterCoprocessorHost 在接口中 MasterServicesMasterCoprocessorHostpublic MasterQuotaManager getMasterQuotaManager()
getMasterQuotaManager 在接口中 MasterServicesMasterQuotaManagerpublic ProcedureExecutor<MasterProcedureEnv> getMasterProcedureExecutor()
getMasterProcedureExecutor 在接口中 MasterServicesProcedureExecutorpublic ServerName getServerName()
getServerName 在接口中 ServergetServerName 在类中 HRegionServerpublic AssignmentManager getAssignmentManager()
getAssignmentManager 在接口中 MasterServicesAssignmentManagerpublic CatalogJanitor getCatalogJanitor()
getCatalogJanitor 在接口中 MasterServicesCatalogJanitorpublic MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer()
public void shutdown()
throws IOException
IOExceptionpublic void stopMaster()
throws IOException
IOExceptionpublic void stop(String msg)
stop 在接口中 Stoppablestop 在类中 HRegionServerprotected void checkServiceStarted()
throws ServerNotRunningYetException
public boolean isActiveMaster()
isActiveMaster 在接口中 MasterServicespublic boolean isInitialized()
isInitialized 在接口中 MasterServicespublic boolean isInMaintenanceMode()
isInMaintenanceMode 在接口中 MasterServicespublic void setInitialized(boolean isInitialized)
public ProcedureEvent<?> getInitializedEvent()
getInitializedEvent 在接口中 MasterServicespublic double getAverageLoad()
public long getSplitPlanCount()
public long getMergePlanCount()
public boolean registerService(com.google.protobuf.Service instance)
RegionServerServicesService subclass as a coprocessor endpoint to be
available for handlingregisterService 在接口中 MasterServicesregisterService 在接口中 RegionServerServicesregisterService 在类中 HRegionServerinstance - the Service subclass instance to expose as a coprocessor endpointtrue if the registration was successful, falsepublic static HMaster constructMaster(Class<? extends HMaster> masterClass, org.apache.hadoop.conf.Configuration conf)
masterClass - public static void main(String[] args)
HMasterCommandLinepublic HFileCleaner getHFileCleaner()
public LogCleaner getLogCleaner()
public SnapshotManager getSnapshotManager()
getSnapshotManager 在接口中 MasterServicespublic MasterProcedureManagerHost getMasterProcedureManagerHost()
getMasterProcedureManagerHost 在接口中 MasterServicespublic ClusterSchema getClusterSchema()
getClusterSchema 在接口中 MasterServicesClusterSchemapublic List<TableName> listTableNamesByNamespace(String name) throws IOException
MasterServiceslistTableNamesByNamespace 在接口中 MasterServicesname - namespace nameIOExceptionpublic List<TableDescriptor> listTableDescriptorsByNamespace(String name) throws IOException
MasterServiceslistTableDescriptorsByNamespace 在接口中 MasterServicesname - namespace nameIOExceptionpublic boolean abortProcedure(long procId,
boolean mayInterruptIfRunning)
throws IOException
MasterServicesabortProcedure 在接口中 MasterServicesprocId - ID of the proceduremayInterruptIfRunning - if the proc completed at least one step, should it be aborted?IOExceptionpublic List<Procedure<?>> getProcedures() throws IOException
MasterServicesgetProcedures 在接口中 MasterServicesIOExceptionpublic List<LockedResource> getLocks() throws IOException
MasterServicesgetLocks 在接口中 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 在接口中 MasterServicestable - the table for which last successful major compaction time is queriedIOExceptionpublic long getLastMajorCompactionTimestampForRegion(byte[] regionName)
throws IOException
getLastMajorCompactionTimestampForRegion 在接口中 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 void requestMobCompaction(TableName tableName, List<ColumnFamilyDescriptor> columns, boolean allFiles) throws IOException
tableName - The table the compact.columns - The compacted columns.allFiles - Whether add all mob files into the compaction.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 在接口中 MasterServicesswitchType - see MasterSwitchTypepublic 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 在接口中 MasterServicespublic FavoredNodesManager getFavoredNodesManager()
getFavoredNodesManager 在接口中 MasterServicespublic long addReplicationPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException, IOException
MasterServicesaddReplicationPeer 在接口中 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 在接口中 MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic long enableReplicationPeer(String peerId) throws ReplicationException, IOException
MasterServicesenableReplicationPeer 在接口中 MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic long disableReplicationPeer(String peerId) throws ReplicationException, IOException
MasterServicesdisableReplicationPeer 在接口中 MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic ReplicationPeerConfig getReplicationPeerConfig(String peerId) throws ReplicationException, IOException
MasterServicesgetReplicationPeerConfig 在接口中 MasterServicespeerId - a short name that identifies the peerReplicationExceptionIOExceptionpublic long updateReplicationPeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException, IOException
MasterServicesupdateReplicationPeerConfig 在接口中 MasterServicespeerId - a short name that identifies the peerpeerConfig - new config for the peerReplicationExceptionIOExceptionpublic List<ReplicationPeerDescription> listReplicationPeers(String regex) throws ReplicationException, IOException
MasterServiceslistReplicationPeers 在接口中 MasterServicesregex - The regular expression to match peer idReplicationExceptionIOExceptionpublic void decommissionRegionServers(List<ServerName> servers, boolean offload) throws HBaseIOException
servers - Region servers to decommission.HBaseIOExceptionpublic List<ServerName> listDecommissionedRegionServers()
public void recommissionRegionServer(ServerName server, List<byte[]> encodedRegionNames) throws HBaseIOException
server - Region server to remove decommission marker from.HBaseIOExceptionpublic LockManager getLockManager()
getLockManager 在接口中 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 在接口中 MasterServicespublic HashMap<String,List<Pair<ServerName,ReplicationLoadSource>>> getReplicationLoad(ServerName[] serverNames)
public static void decorateMasterConfiguration(org.apache.hadoop.conf.Configuration conf)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.