@InterfaceAudience.Private public interface MasterServices extends Server
HMaster. For use internally only. Passed to
Managers, Services and Chores so can pass less-than-a full-on HMaster at test-time. Be judicious
adding API. Changes cause ripples through the code base.| Modifier and Type | Method and Description |
|---|---|
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
|
void |
checkIfShouldMoveSystemRegionAsync()
Called when a new RegionServer is added to the cluster.
|
void |
checkTableModifiable(TableName tableName)
Check table is modifiable; i.e.
|
long |
createSystemTable(TableDescriptor tableDescriptor)
Create a system table using the given table definition.
|
long |
createTable(TableDescriptor desc,
byte[][] splitKeys,
long nonceGroup,
long nonce)
Create a table using the given table definition.
|
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
|
AccessChecker |
getAccessChecker()
Returns the
AccessChecker |
AssignmentManager |
getAssignmentManager()
Returns Master's instance of the
AssignmentManager |
CatalogJanitor |
getCatalogJanitor()
Returns Master's instance of
CatalogJanitor |
String |
getClientIdAuditPrefix() |
ClusterSchema |
getClusterSchema()
Returns Master's instance of
ClusterSchema |
ExecutorService |
getExecutorService()
Returns Master's instance of
ExecutorService |
FavoredNodesManager |
getFavoredNodesManager()
Returns Favored Nodes Manager
|
ProcedureEvent<?> |
getInitializedEvent()
Returns Tripped when Master has finished initialization.
|
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
|
LoadBalancer |
getLoadBalancer()
Returns load balancer
|
LockManager |
getLockManager()
Returns
LockManager to lock namespaces/tables/regions. |
List<LockedResource> |
getLocks()
Get locks
|
MasterCoprocessorHost |
getMasterCoprocessorHost()
Returns Master's instance of
MasterCoprocessorHost |
MasterFileSystem |
getMasterFileSystem()
Returns Master's filesystem
MasterFileSystem utility class. |
MetricsMaster |
getMasterMetrics()
Returns Master's instance of
MetricsMaster |
ProcedureExecutor<MasterProcedureEnv> |
getMasterProcedureExecutor()
Returns Master's instance of
ProcedureExecutor |
MasterProcedureManagerHost |
getMasterProcedureManagerHost()
Returns the underlying MasterProcedureManagerHost
|
MasterQuotaManager |
getMasterQuotaManager()
Returns Master's instance of
MasterQuotaManager |
MasterWalManager |
getMasterWalManager()
Returns Master's WALs
MasterWalManager utility class. |
MetaLocationSyncer |
getMetaLocationSyncer()
Get the meta location syncer.
|
List<Procedure<?>> |
getProcedures()
Get procedures
|
RegionNormalizerManager |
getRegionNormalizerManager()
Returns Master's instance of
RegionNormalizerManager |
String |
getRegionServerVersion(ServerName sn) |
ReplicationPeerConfig |
getReplicationPeerConfig(String peerId)
Returns the configured ReplicationPeerConfig for the specified peer
|
ReplicationPeerManager |
getReplicationPeerManager()
Returns the
ReplicationPeerManager. |
ServerManager |
getServerManager()
Returns Master's
ServerManager instance. |
SnapshotManager |
getSnapshotManager()
Returns the underlying snapshot manager
|
default SplitWALManager |
getSplitWALManager()
Returns return null if current is zk-based WAL splitting
|
TableDescriptors |
getTableDescriptors()
Returns Return table descriptors implementation.
|
TableStateManager |
getTableStateManager()
Returns Master's instance of
TableStateManager |
ZKPermissionWatcher |
getZKPermissionWatcher()
Returns the
ZKPermissionWatcher |
boolean |
isActiveMaster()
Returns true if master is the active one
|
boolean |
isClusterUp()
Returns True if cluster is up; false if cluster is not up (we are shutting down).
|
boolean |
isInitialized()
Returns true if master is initialized
|
boolean |
isInMaintenanceMode() |
boolean |
isSplitOrMergeEnabled(MasterSwitchType switchType) |
List<ReplicationPeerDescription> |
listReplicationPeers(String regex)
Return a list of replication peers.
|
List<TableDescriptor> |
listTableDescriptorsByNamespace(String name)
Get list of table descriptors by namespace
|
List<TableName> |
listTableNamesByNamespace(String name)
Get list of table names by namespace
|
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 |
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 descriptor,
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
|
boolean |
normalizeRegions(NormalizeTableFilterParams ntfp,
boolean isHighPriority)
Perform normalization of cluster.
|
boolean |
registerService(com.google.protobuf.Service instance)
Registers a new protocol buffer
Service subclass as a master coprocessor endpoint. |
long |
removeReplicationPeer(String peerId)
Removes a peer and stops the replication
|
void |
runReplicationBarrierCleaner()
Run the ReplicationBarrierChore.
|
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.
|
long |
truncateTable(TableName tableName,
boolean preserveSplits,
long nonceGroup,
long nonce)
Truncate a table
|
long |
updateReplicationPeerConfig(String peerId,
ReplicationPeerConfig peerConfig)
Update the peerConfig for the specified peer
|
createConnection, getChoreService, getClusterConnection, getConfiguration, getConnection, getCoordinatedStateManager, getFileSystem, getServerName, getZooKeeper, isStoppingSnapshotManager getSnapshotManager()
MasterProcedureManagerHost getMasterProcedureManagerHost()
ClusterSchema getClusterSchema()
ClusterSchemaAssignmentManager getAssignmentManager()
AssignmentManagerMasterFileSystem getMasterFileSystem()
MasterFileSystem utility class.MasterWalManager getMasterWalManager()
MasterWalManager utility class.ServerManager getServerManager()
ServerManager instance.ExecutorService getExecutorService()
ExecutorServiceTableStateManager getTableStateManager()
TableStateManagerMasterCoprocessorHost getMasterCoprocessorHost()
MasterCoprocessorHostMasterQuotaManager getMasterQuotaManager()
MasterQuotaManagerRegionNormalizerManager getRegionNormalizerManager()
RegionNormalizerManagerCatalogJanitor getCatalogJanitor()
CatalogJanitorProcedureExecutor<MasterProcedureEnv> getMasterProcedureExecutor()
ProcedureExecutorProcedureEvent<?> getInitializedEvent()
MetricsMaster getMasterMetrics()
MetricsMastervoid checkTableModifiable(TableName tableName) throws IOException, TableNotFoundException, TableNotDisabledException
tableName - Name of table to check. nnnIOExceptionTableNotFoundExceptionTableNotDisabledExceptionlong createTable(TableDescriptor desc, byte[][] splitKeys, long nonceGroup, long nonce) throws IOException
desc - The table definitionsplitKeys - Starting row keys for the initial table regions. If null nn * a single region
is created.IOExceptionlong createSystemTable(TableDescriptor tableDescriptor) throws IOException
tableDescriptor - The system table definition a single region is created.IOExceptionlong deleteTable(TableName tableName, long nonceGroup, long nonce) throws IOException
tableName - The table name nnnIOExceptionlong truncateTable(TableName tableName, boolean preserveSplits, long nonceGroup, long nonce) throws IOException
tableName - The table namepreserveSplits - True if the splits should be preserved nnnIOExceptionlong modifyTable(TableName tableName, TableDescriptor descriptor, long nonceGroup, long nonce) throws IOException
tableName - The table namedescriptor - The updated table descriptor nnnIOExceptionlong modifyTableStoreFileTracker(TableName tableName, String dstSFT, long nonceGroup, long nonce) throws IOException
IOExceptionlong enableTable(TableName tableName, long nonceGroup, long nonce) throws IOException
tableName - The table name nnnIOExceptionlong disableTable(TableName tableName, long nonceGroup, long nonce) throws IOException
tableName - The table name nnnIOExceptionlong addColumn(TableName tableName, ColumnFamilyDescriptor column, long nonceGroup, long nonce) throws IOException
tableName - The table namecolumn - The column definition nnnIOExceptionlong modifyColumn(TableName tableName, ColumnFamilyDescriptor descriptor, long nonceGroup, long nonce) throws IOException
tableName - The table namedescriptor - The updated column definition nnnIOExceptionlong modifyColumnStoreFileTracker(TableName tableName, byte[] family, String dstSFT, long nonceGroup, long nonce) throws IOException
IOExceptionlong deleteColumn(TableName tableName, byte[] columnName, long nonceGroup, long nonce) throws IOException
tableName - The table namecolumnName - The column name nnnIOExceptionlong mergeRegions(RegionInfo[] regionsToMerge, boolean forcible, long nonceGroup, long nonce) throws IOException
regionsToMerge - daughter regions to mergeforcible - whether to force to merge even two regions are not adjacentnonceGroup - used to detect duplicatenonce - used to detect duplicateIOExceptionlong splitRegion(RegionInfo regionInfo, byte[] splitRow, long nonceGroup, long nonce) throws IOException
regionInfo - region to splitsplitRow - split pointnonceGroup - used to detect duplicatenonce - used to detect duplicateIOExceptionTableDescriptors getTableDescriptors()
boolean registerService(com.google.protobuf.Service instance)
Service 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.instance - the Service subclass instance to expose as a coprocessor endpointtrue if the registration was successful, false otherwiseboolean isActiveMaster()
boolean isInitialized()
boolean isInMaintenanceMode()
IOException - if the inquiry failed due to an IO problemboolean skipRegionManagementAction(String action)
action - the name of the action under consideration, for logging.true when the caller should exit early, false otherwise.boolean abortProcedure(long procId, boolean mayInterruptIfRunning) throws IOException
procId - ID of the proceduremayInterruptIfRunning - if the proc completed at least one step, should it be aborted?IOExceptionList<Procedure<?>> getProcedures() throws IOException
IOExceptionList<LockedResource> getLocks() throws IOException
IOExceptionList<TableDescriptor> listTableDescriptorsByNamespace(String name) throws IOException
name - namespace name nnIOExceptionList<TableName> listTableNamesByNamespace(String name) throws IOException
name - namespace nameIOExceptionlong getLastMajorCompactionTimestamp(TableName table) throws IOException
table - the table for which last successful major compaction time is queriedIOExceptionlong getLastMajorCompactionTimestampForRegion(byte[] regionName) throws IOException
IOExceptionLoadBalancer getLoadBalancer()
boolean isSplitOrMergeEnabled(MasterSwitchType switchType)
FavoredNodesManager getFavoredNodesManager()
long addReplicationPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException, IOException
peerId - a short name that identifies the peerpeerConfig - configuration for the replication slave clusterenabled - peer state, true if ENABLED and false if DISABLEDReplicationExceptionIOExceptionlong removeReplicationPeer(String peerId) throws ReplicationException, IOException
peerId - a short name that identifies the peerReplicationExceptionIOExceptionlong enableReplicationPeer(String peerId) throws ReplicationException, IOException
peerId - a short name that identifies the peerReplicationExceptionIOExceptionlong disableReplicationPeer(String peerId) throws ReplicationException, IOException
peerId - a short name that identifies the peerReplicationExceptionIOExceptionReplicationPeerConfig getReplicationPeerConfig(String peerId) throws ReplicationException, IOException
peerId - a short name that identifies the peerReplicationExceptionIOExceptionReplicationPeerManager getReplicationPeerManager()
ReplicationPeerManager.long updateReplicationPeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException, IOException
peerId - a short name that identifies the peerpeerConfig - new config for the peerReplicationExceptionIOExceptionList<ReplicationPeerDescription> listReplicationPeers(String regex) throws ReplicationException, IOException
regex - The regular expression to match peer idReplicationExceptionIOExceptionLockManager getLockManager()
LockManager to lock namespaces/tables/regions.String getRegionServerVersion(ServerName sn)
void checkIfShouldMoveSystemRegionAsync()
String getClientIdAuditPrefix()
boolean isClusterUp()
default SplitWALManager getSplitWALManager()
AccessChecker getAccessChecker()
AccessCheckerZKPermissionWatcher getZKPermissionWatcher()
ZKPermissionWatcherList<RegionPlan> executeRegionPlansWithThrottling(List<RegionPlan> plans)
plans - to executevoid runReplicationBarrierCleaner()
boolean normalizeRegions(NormalizeTableFilterParams ntfp, boolean isHighPriority) throws IOException
ntfp - 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.IOExceptionMetaLocationSyncer getMetaLocationSyncer()
void flushMasterStore() throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.