@InterfaceAudience.Private public class HMaster extends HasThread implements MasterProtos.MasterService.BlockingInterface, RegionServerStatusProtos.RegionServerStatusService.BlockingInterface, MasterServices, Server
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
Constructor and Description |
---|
HMaster(org.apache.hadoop.conf.Configuration conf)
Initializes the HMaster.
|
Modifier and Type | Method and Description |
---|---|
void |
abort(String msg,
Throwable t)
Abort the server or client.
|
MasterProtos.AddColumnResponse |
addColumn(com.google.protobuf.RpcController controller,
MasterProtos.AddColumnRequest req) |
void |
addColumn(TableName tableName,
HColumnDescriptor column)
Add a new column to an existing table
|
void |
assignRegion(HRegionInfo hri) |
MasterProtos.AssignRegionResponse |
assignRegion(com.google.protobuf.RpcController controller,
MasterProtos.AssignRegionRequest req) |
boolean |
balance() |
MasterProtos.BalanceResponse |
balance(com.google.protobuf.RpcController c,
MasterProtos.BalanceRequest request) |
boolean |
balanceSwitch(boolean b) |
void |
checkTableModifiable(TableName tableName)
Check table is modifiable; i.e.
|
static HMaster |
constructMaster(Class<? extends HMaster> masterClass,
org.apache.hadoop.conf.Configuration conf)
Utility for constructing an instance of the passed HMaster class.
|
protected RegionServerStatusProtos.RegionServerStartupResponse.Builder |
createConfigurationSubset() |
void |
createNamespace(NamespaceDescriptor descriptor)
Create a new namespace
|
MasterProtos.CreateNamespaceResponse |
createNamespace(com.google.protobuf.RpcController controller,
MasterProtos.CreateNamespaceRequest request) |
void |
createTable(HTableDescriptor hTableDescriptor,
byte[][] splitKeys)
Create a table using the given table definition.
|
MasterProtos.CreateTableResponse |
createTable(com.google.protobuf.RpcController controller,
MasterProtos.CreateTableRequest req) |
MasterProtos.DeleteColumnResponse |
deleteColumn(com.google.protobuf.RpcController controller,
MasterProtos.DeleteColumnRequest req) |
void |
deleteColumn(TableName tableName,
byte[] columnName)
Delete a column from an existing table
|
MasterProtos.DeleteNamespaceResponse |
deleteNamespace(com.google.protobuf.RpcController controller,
MasterProtos.DeleteNamespaceRequest request) |
void |
deleteNamespace(String name)
Delete an existing namespace.
|
MasterProtos.DeleteSnapshotResponse |
deleteSnapshot(com.google.protobuf.RpcController controller,
MasterProtos.DeleteSnapshotRequest request)
Execute Delete Snapshot operation.
|
MasterProtos.DeleteTableResponse |
deleteTable(com.google.protobuf.RpcController controller,
MasterProtos.DeleteTableRequest request) |
void |
deleteTable(TableName tableName)
Delete a table
|
MasterProtos.DisableTableResponse |
disableTable(com.google.protobuf.RpcController controller,
MasterProtos.DisableTableRequest request) |
void |
disableTable(TableName tableName)
Disable an existing table
|
void |
dispatchMergingRegions(HRegionInfo region_a,
HRegionInfo region_b,
boolean forcible)
Merge two regions.
|
MasterProtos.DispatchMergingRegionsResponse |
dispatchMergingRegions(com.google.protobuf.RpcController controller,
MasterProtos.DispatchMergingRegionsRequest request) |
MasterProtos.EnableCatalogJanitorResponse |
enableCatalogJanitor(com.google.protobuf.RpcController c,
MasterProtos.EnableCatalogJanitorRequest req) |
MasterProtos.EnableTableResponse |
enableTable(com.google.protobuf.RpcController controller,
MasterProtos.EnableTableRequest request) |
void |
enableTable(TableName tableName)
Enable an existing table
|
ClientProtos.CoprocessorServiceResponse |
execMasterService(com.google.protobuf.RpcController controller,
ClientProtos.CoprocessorServiceRequest request) |
MasterProtos.ExecProcedureResponse |
execProcedure(com.google.protobuf.RpcController controller,
MasterProtos.ExecProcedureRequest request)
Triggers an asynchronous attempt to run a distributed procedure.
|
ActiveMasterManager |
getActiveMasterManager() |
AssignmentManager |
getAssignmentManager() |
double |
getAverageLoad()
Compute the average load across all region servers.
|
CatalogTracker |
getCatalogTracker() |
String |
getClusterId() |
ClusterStatus |
getClusterStatus() |
MasterProtos.GetClusterStatusResponse |
getClusterStatus(com.google.protobuf.RpcController controller,
MasterProtos.GetClusterStatusRequest req) |
MasterProtos.GetCompletedSnapshotsResponse |
getCompletedSnapshots(com.google.protobuf.RpcController controller,
MasterProtos.GetCompletedSnapshotsRequest request)
List the currently available/stored snapshots.
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Gets the configuration object for this server.
|
MasterCoprocessorHost |
getCoprocessorHost() |
String[] |
getCoprocessors() |
ExecutorService |
getExecutorService() |
HFileCleaner |
getHFileCleaner() |
InfoServer |
getInfoServer() |
RegionServerStatusProtos.GetLastFlushedSequenceIdResponse |
getLastFlushedSequenceId(com.google.protobuf.RpcController controller,
RegionServerStatusProtos.GetLastFlushedSequenceIdRequest request) |
static String |
getLoadedCoprocessors()
The set of loaded coprocessors is stored in a static set.
|
long |
getMasterActiveTime() |
MasterAddressTracker |
getMasterAddressTracker() |
MasterFileSystem |
getMasterFileSystem() |
long |
getMasterStartTime() |
MasterProtos.GetNamespaceDescriptorResponse |
getNamespaceDescriptor(com.google.protobuf.RpcController controller,
MasterProtos.GetNamespaceDescriptorRequest request) |
NamespaceDescriptor |
getNamespaceDescriptor(String name)
Get a namespace descriptor by name
|
MemoryBoundedLogMessageBuffer |
getRegionServerFatalLogBuffer() |
int |
getRegionServerInfoPort(ServerName sn) |
MasterProtos.GetSchemaAlterStatusResponse |
getSchemaAlterStatus(com.google.protobuf.RpcController controller,
MasterProtos.GetSchemaAlterStatusRequest req)
Get the number of regions of the table that have been updated by the alter.
|
ServerManager |
getServerManager() |
ServerName |
getServerName() |
SnapshotManager |
getSnapshotManagerForTesting()
Exposed for TESTING!
|
TableDescriptors |
getTableDescriptors() |
MasterProtos.GetTableDescriptorsResponse |
getTableDescriptors(com.google.protobuf.RpcController controller,
MasterProtos.GetTableDescriptorsRequest req)
Get list of TableDescriptors for requested tables.
|
TableLockManager |
getTableLockManager() |
MasterProtos.GetTableNamesResponse |
getTableNames(com.google.protobuf.RpcController controller,
MasterProtos.GetTableNamesRequest req)
Get list of userspace table names
|
ZooKeeperWatcher |
getZooKeeper()
Gets the ZooKeeper instance for this server.
|
ZooKeeperWatcher |
getZooKeeperWatcher()
Get the ZK wrapper object - needed by master_jsp.java
|
boolean |
isAborted()
Check if the server or client was aborted.
|
boolean |
isActiveMaster()
Report whether this master is currently the active master or not.
|
MasterProtos.IsCatalogJanitorEnabledResponse |
isCatalogJanitorEnabled(com.google.protobuf.RpcController c,
MasterProtos.IsCatalogJanitorEnabledRequest req) |
boolean |
isInitializationStartsMetaRegionAssignment()
Report whether this master has started initialization and is about to do meta region assignment
|
boolean |
isInitialized()
Report whether this master has completed with its initialization and is
ready.
|
boolean |
isMasterRunning() |
MasterProtos.IsMasterRunningResponse |
isMasterRunning(com.google.protobuf.RpcController c,
MasterProtos.IsMasterRunningRequest req) |
MasterProtos.IsProcedureDoneResponse |
isProcedureDone(com.google.protobuf.RpcController controller,
MasterProtos.IsProcedureDoneRequest request)
Checks if the specified procedure is done.
|
MasterProtos.IsRestoreSnapshotDoneResponse |
isRestoreSnapshotDone(com.google.protobuf.RpcController controller,
MasterProtos.IsRestoreSnapshotDoneRequest request)
Returns the status of the requested snapshot restore/clone operation.
|
boolean |
isServerShutdownHandlerEnabled()
ServerShutdownHandlerEnabled is set false before completing
assignMeta to prevent processing of ServerShutdownHandler.
|
MasterProtos.IsSnapshotDoneResponse |
isSnapshotDone(com.google.protobuf.RpcController controller,
MasterProtos.IsSnapshotDoneRequest request)
Checks if the specified snapshot is done.
|
boolean |
isStopped() |
List<NamespaceDescriptor> |
listNamespaceDescriptors()
List available namespace descriptors
|
MasterProtos.ListNamespaceDescriptorsResponse |
listNamespaceDescriptors(com.google.protobuf.RpcController controller,
MasterProtos.ListNamespaceDescriptorsRequest request) |
MasterProtos.ListTableDescriptorsByNamespaceResponse |
listTableDescriptorsByNamespace(com.google.protobuf.RpcController controller,
MasterProtos.ListTableDescriptorsByNamespaceRequest request) |
List<HTableDescriptor> |
listTableDescriptorsByNamespace(String name)
Get list of table descriptors by namespace
|
MasterProtos.ListTableNamesByNamespaceResponse |
listTableNamesByNamespace(com.google.protobuf.RpcController controller,
MasterProtos.ListTableNamesByNamespaceRequest request) |
List<TableName> |
listTableNamesByNamespace(String name)
Get list of table names by namespace
|
static void |
main(String[] args) |
MasterProtos.ModifyColumnResponse |
modifyColumn(com.google.protobuf.RpcController controller,
MasterProtos.ModifyColumnRequest req) |
void |
modifyColumn(TableName tableName,
HColumnDescriptor descriptor)
Modify the column descriptor of an existing column in an existing table
|
void |
modifyNamespace(NamespaceDescriptor descriptor)
Modify an existing namespace
|
MasterProtos.ModifyNamespaceResponse |
modifyNamespace(com.google.protobuf.RpcController controller,
MasterProtos.ModifyNamespaceRequest request) |
MasterProtos.ModifyTableResponse |
modifyTable(com.google.protobuf.RpcController controller,
MasterProtos.ModifyTableRequest req) |
void |
modifyTable(TableName tableName,
HTableDescriptor descriptor)
Modify the descriptor of an existing table
|
MasterProtos.MoveRegionResponse |
moveRegion(com.google.protobuf.RpcController controller,
MasterProtos.MoveRegionRequest req) |
MasterProtos.OfflineRegionResponse |
offlineRegion(com.google.protobuf.RpcController controller,
MasterProtos.OfflineRegionRequest request)
Offline specified region from master's in-memory state.
|
RegionServerStatusProtos.RegionServerReportResponse |
regionServerReport(com.google.protobuf.RpcController controller,
RegionServerStatusProtos.RegionServerReportRequest request) |
RegionServerStatusProtos.RegionServerStartupResponse |
regionServerStartup(com.google.protobuf.RpcController controller,
RegionServerStatusProtos.RegionServerStartupRequest request) |
boolean |
registerService(com.google.protobuf.Service instance)
Registers a new protocol buffer
Service subclass as a master coprocessor endpoint. |
RegionServerStatusProtos.ReportRSFatalErrorResponse |
reportRSFatalError(com.google.protobuf.RpcController controller,
RegionServerStatusProtos.ReportRSFatalErrorRequest request) |
MasterProtos.RestoreSnapshotResponse |
restoreSnapshot(com.google.protobuf.RpcController controller,
MasterProtos.RestoreSnapshotRequest request)
Execute Restore/Clone snapshot operation.
|
void |
run()
Main processing loop for the HMaster.
|
MasterProtos.RunCatalogScanResponse |
runCatalogScan(com.google.protobuf.RpcController c,
MasterProtos.RunCatalogScanRequest req) |
MasterProtos.SetBalancerRunningResponse |
setBalancerRunning(com.google.protobuf.RpcController controller,
MasterProtos.SetBalancerRunningRequest req) |
void |
setCatalogJanitorEnabled(boolean b)
Switch for the background CatalogJanitor thread.
|
void |
shutdown() |
MasterProtos.ShutdownResponse |
shutdown(com.google.protobuf.RpcController controller,
MasterProtos.ShutdownRequest request) |
MasterProtos.SnapshotResponse |
snapshot(com.google.protobuf.RpcController controller,
MasterProtos.SnapshotRequest request)
Triggers an asynchronous attempt to take a snapshot.
|
protected void |
startCatalogJanitorChore()
Useful for testing purpose also where we have
master restart scenarios.
|
protected void |
startNamespaceJanitorChore()
Useful for testing purpose also where we have
master restart scenarios.
|
void |
stop(String why)
Stop this service.
|
void |
stopMaster() |
MasterProtos.StopMasterResponse |
stopMaster(com.google.protobuf.RpcController controller,
MasterProtos.StopMasterRequest request) |
boolean |
switchBalancer(boolean b,
org.apache.hadoop.hbase.master.HMaster.BalanceSwitchMode mode)
Assigns balancer switch according to BalanceSwitchMode
|
boolean |
synchronousBalanceSwitch(boolean b) |
MasterProtos.UnassignRegionResponse |
unassignRegion(com.google.protobuf.RpcController controller,
MasterProtos.UnassignRegionRequest req) |
getName, getThread, interrupt, isAlive, isInterrupted, join, join, join, setDaemon, setName, setPriority, setUncaughtExceptionHandler, start
public static final String MASTER
public HMaster(org.apache.hadoop.conf.Configuration conf) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
Remaining steps of initialization occur in run()
so that they
run in their own thread rather than within the context of the constructor.
InterruptedException
IOException
org.apache.zookeeper.KeeperException
public void run()
protected void startCatalogJanitorChore()
protected void startNamespaceJanitorChore()
public TableDescriptors getTableDescriptors()
getTableDescriptors
in interface MasterServices
public InfoServer getInfoServer()
public org.apache.hadoop.conf.Configuration getConfiguration()
Server
getConfiguration
in interface Server
public ServerManager getServerManager()
getServerManager
in interface MasterServices
ServerManager
instance.public ExecutorService getExecutorService()
getExecutorService
in interface MasterServices
ExecutorService
public MasterFileSystem getMasterFileSystem()
getMasterFileSystem
in interface MasterServices
MasterFileSystem
utility class.public ZooKeeperWatcher getZooKeeperWatcher()
public ActiveMasterManager getActiveMasterManager()
public MasterAddressTracker getMasterAddressTracker()
public RegionServerStatusProtos.RegionServerStartupResponse regionServerStartup(com.google.protobuf.RpcController controller, RegionServerStatusProtos.RegionServerStartupRequest request) throws com.google.protobuf.ServiceException
regionServerStartup
in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
com.google.protobuf.ServiceException
protected RegionServerStatusProtos.RegionServerStartupResponse.Builder createConfigurationSubset()
public RegionServerStatusProtos.GetLastFlushedSequenceIdResponse getLastFlushedSequenceId(com.google.protobuf.RpcController controller, RegionServerStatusProtos.GetLastFlushedSequenceIdRequest request) throws com.google.protobuf.ServiceException
getLastFlushedSequenceId
in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
com.google.protobuf.ServiceException
public RegionServerStatusProtos.RegionServerReportResponse regionServerReport(com.google.protobuf.RpcController controller, RegionServerStatusProtos.RegionServerReportRequest request) throws com.google.protobuf.ServiceException
regionServerReport
in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
com.google.protobuf.ServiceException
public RegionServerStatusProtos.ReportRSFatalErrorResponse reportRSFatalError(com.google.protobuf.RpcController controller, RegionServerStatusProtos.ReportRSFatalErrorRequest request) throws com.google.protobuf.ServiceException
reportRSFatalError
in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
com.google.protobuf.ServiceException
public boolean isMasterRunning()
public MasterProtos.IsMasterRunningResponse isMasterRunning(com.google.protobuf.RpcController c, MasterProtos.IsMasterRunningRequest req) throws com.google.protobuf.ServiceException
isMasterRunning
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.RunCatalogScanResponse runCatalogScan(com.google.protobuf.RpcController c, MasterProtos.RunCatalogScanRequest req) throws com.google.protobuf.ServiceException
runCatalogScan
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.EnableCatalogJanitorResponse enableCatalogJanitor(com.google.protobuf.RpcController c, MasterProtos.EnableCatalogJanitorRequest req) throws com.google.protobuf.ServiceException
enableCatalogJanitor
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.IsCatalogJanitorEnabledResponse isCatalogJanitorEnabled(com.google.protobuf.RpcController c, MasterProtos.IsCatalogJanitorEnabledRequest req) throws com.google.protobuf.ServiceException
isCatalogJanitorEnabled
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public boolean balance() throws HBaseIOException
HBaseIOException
public MasterProtos.BalanceResponse balance(com.google.protobuf.RpcController c, MasterProtos.BalanceRequest request) throws com.google.protobuf.ServiceException
balance
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public boolean switchBalancer(boolean b, org.apache.hadoop.hbase.master.HMaster.BalanceSwitchMode mode) throws IOException
b
- new balancer switchmode
- BalanceSwitchModeIOException
public boolean synchronousBalanceSwitch(boolean b) throws IOException
IOException
public boolean balanceSwitch(boolean b) throws IOException
IOException
public MasterProtos.SetBalancerRunningResponse setBalancerRunning(com.google.protobuf.RpcController controller, MasterProtos.SetBalancerRunningRequest req) throws com.google.protobuf.ServiceException
setBalancerRunning
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void setCatalogJanitorEnabled(boolean b)
b
- If false, the catalog janitor won't do anything.public MasterProtos.DispatchMergingRegionsResponse dispatchMergingRegions(com.google.protobuf.RpcController controller, MasterProtos.DispatchMergingRegionsRequest request) throws com.google.protobuf.ServiceException
dispatchMergingRegions
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void dispatchMergingRegions(HRegionInfo region_a, HRegionInfo region_b, boolean forcible) throws IOException
MasterServices
dispatchMergingRegions
in interface MasterServices
region_a
- region to mergeregion_b
- region to mergeforcible
- true if do a compulsory merge, otherwise we will only merge
two adjacent regionsIOException
public MasterProtos.MoveRegionResponse moveRegion(com.google.protobuf.RpcController controller, MasterProtos.MoveRegionRequest req) throws com.google.protobuf.ServiceException
moveRegion
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void createTable(HTableDescriptor hTableDescriptor, byte[][] splitKeys) throws IOException
MasterServices
createTable
in interface MasterServices
hTableDescriptor
- The table definitionsplitKeys
- Starting row keys for the initial table regions. If null
a single region is created.IOException
public MasterProtos.CreateTableResponse createTable(com.google.protobuf.RpcController controller, MasterProtos.CreateTableRequest req) throws com.google.protobuf.ServiceException
createTable
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void deleteTable(TableName tableName) throws IOException
MasterServices
deleteTable
in interface MasterServices
tableName
- The table nameIOException
public MasterProtos.DeleteTableResponse deleteTable(com.google.protobuf.RpcController controller, MasterProtos.DeleteTableRequest request) throws com.google.protobuf.ServiceException
deleteTable
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.GetSchemaAlterStatusResponse getSchemaAlterStatus(com.google.protobuf.RpcController controller, MasterProtos.GetSchemaAlterStatusRequest req) throws com.google.protobuf.ServiceException
getSchemaAlterStatus
in interface MasterProtos.MasterService.BlockingInterface
IOException
com.google.protobuf.ServiceException
public void addColumn(TableName tableName, HColumnDescriptor column) throws IOException
MasterServices
addColumn
in interface MasterServices
tableName
- The table namecolumn
- The column definitionIOException
public MasterProtos.AddColumnResponse addColumn(com.google.protobuf.RpcController controller, MasterProtos.AddColumnRequest req) throws com.google.protobuf.ServiceException
addColumn
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void modifyColumn(TableName tableName, HColumnDescriptor descriptor) throws IOException
MasterServices
modifyColumn
in interface MasterServices
tableName
- The table namedescriptor
- The updated column definitionIOException
public MasterProtos.ModifyColumnResponse modifyColumn(com.google.protobuf.RpcController controller, MasterProtos.ModifyColumnRequest req) throws com.google.protobuf.ServiceException
modifyColumn
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void deleteColumn(TableName tableName, byte[] columnName) throws IOException
MasterServices
deleteColumn
in interface MasterServices
tableName
- The table namecolumnName
- The column nameIOException
public MasterProtos.DeleteColumnResponse deleteColumn(com.google.protobuf.RpcController controller, MasterProtos.DeleteColumnRequest req) throws com.google.protobuf.ServiceException
deleteColumn
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void enableTable(TableName tableName) throws IOException
MasterServices
enableTable
in interface MasterServices
tableName
- The table nameIOException
public MasterProtos.EnableTableResponse enableTable(com.google.protobuf.RpcController controller, MasterProtos.EnableTableRequest request) throws com.google.protobuf.ServiceException
enableTable
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void disableTable(TableName tableName) throws IOException
MasterServices
disableTable
in interface MasterServices
tableName
- The table nameIOException
public MasterProtos.DisableTableResponse disableTable(com.google.protobuf.RpcController controller, MasterProtos.DisableTableRequest request) throws com.google.protobuf.ServiceException
disableTable
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void modifyTable(TableName tableName, HTableDescriptor descriptor) throws IOException
MasterServices
modifyTable
in interface MasterServices
tableName
- The table namedescriptor
- The updated table descriptorIOException
public MasterProtos.ModifyTableResponse modifyTable(com.google.protobuf.RpcController controller, MasterProtos.ModifyTableRequest req) throws com.google.protobuf.ServiceException
modifyTable
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void checkTableModifiable(TableName tableName) throws IOException, TableNotFoundException, TableNotDisabledException
MasterServices
checkTableModifiable
in interface MasterServices
tableName
- Name of table to check.TableNotDisabledException
TableNotFoundException
IOException
public MasterProtos.GetClusterStatusResponse getClusterStatus(com.google.protobuf.RpcController controller, MasterProtos.GetClusterStatusRequest req) throws com.google.protobuf.ServiceException
getClusterStatus
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public ClusterStatus getClusterStatus()
public String getClusterId()
public static String getLoadedCoprocessors()
public long getMasterStartTime()
public long getMasterActiveTime()
public int getRegionServerInfoPort(ServerName sn)
public String[] getCoprocessors()
public void abort(String msg, Throwable t)
Abortable
public ZooKeeperWatcher getZooKeeper()
Server
getZooKeeper
in interface Server
public MasterCoprocessorHost getCoprocessorHost()
getCoprocessorHost
in interface MasterServices
MasterCoprocessorHost
public ServerName getServerName()
getServerName
in interface Server
public CatalogTracker getCatalogTracker()
getCatalogTracker
in interface Server
CatalogTracker
public AssignmentManager getAssignmentManager()
getAssignmentManager
in interface MasterServices
AssignmentManager
public TableLockManager getTableLockManager()
getTableLockManager
in interface MasterServices
TableLockManager
public MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer()
public void shutdown()
public MasterProtos.ShutdownResponse shutdown(com.google.protobuf.RpcController controller, MasterProtos.ShutdownRequest request) throws com.google.protobuf.ServiceException
shutdown
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void stopMaster()
public MasterProtos.StopMasterResponse stopMaster(com.google.protobuf.RpcController controller, MasterProtos.StopMasterRequest request) throws com.google.protobuf.ServiceException
stopMaster
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public boolean isStopped()
isStopped
in interface Stoppable
Stoppable.stop(String)
has been closed.public boolean isAborted()
Abortable
public boolean isActiveMaster()
public boolean isInitialized()
isInitialized
in interface MasterServices
public boolean isServerShutdownHandlerEnabled()
isServerShutdownHandlerEnabled
in interface MasterServices
public boolean isInitializationStartsMetaRegionAssignment()
public MasterProtos.AssignRegionResponse assignRegion(com.google.protobuf.RpcController controller, MasterProtos.AssignRegionRequest req) throws com.google.protobuf.ServiceException
assignRegion
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void assignRegion(HRegionInfo hri)
public MasterProtos.UnassignRegionResponse unassignRegion(com.google.protobuf.RpcController controller, MasterProtos.UnassignRegionRequest req) throws com.google.protobuf.ServiceException
unassignRegion
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.GetTableDescriptorsResponse getTableDescriptors(com.google.protobuf.RpcController controller, MasterProtos.GetTableDescriptorsRequest req) throws com.google.protobuf.ServiceException
getTableDescriptors
in interface MasterProtos.MasterService.BlockingInterface
controller
- Unused (set to null).req
- GetTableDescriptorsRequest that contains:
- tableNames: requested tables, or if empty, all are requestedcom.google.protobuf.ServiceException
public MasterProtos.GetTableNamesResponse getTableNames(com.google.protobuf.RpcController controller, MasterProtos.GetTableNamesRequest req) throws com.google.protobuf.ServiceException
getTableNames
in interface MasterProtos.MasterService.BlockingInterface
controller
- Unused (set to null).req
- GetTableNamesRequestcom.google.protobuf.ServiceException
public double getAverageLoad()
public MasterProtos.OfflineRegionResponse offlineRegion(com.google.protobuf.RpcController controller, MasterProtos.OfflineRegionRequest request) throws com.google.protobuf.ServiceException
offlineRegion
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public boolean registerService(com.google.protobuf.Service instance)
MasterServices
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
.
registerService
in interface MasterServices
instance
- the Service
subclass instance to expose as a coprocessor endpointtrue
if the registration was successful, false
otherwisepublic ClientProtos.CoprocessorServiceResponse execMasterService(com.google.protobuf.RpcController controller, ClientProtos.CoprocessorServiceRequest request) throws com.google.protobuf.ServiceException
execMasterService
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public static HMaster constructMaster(Class<? extends HMaster> masterClass, org.apache.hadoop.conf.Configuration conf)
masterClass
- conf
- public static void main(String[] args)
HMasterCommandLine
public HFileCleaner getHFileCleaner()
public SnapshotManager getSnapshotManagerForTesting()
public MasterProtos.SnapshotResponse snapshot(com.google.protobuf.RpcController controller, MasterProtos.SnapshotRequest request) throws com.google.protobuf.ServiceException
snapshot
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.GetCompletedSnapshotsResponse getCompletedSnapshots(com.google.protobuf.RpcController controller, MasterProtos.GetCompletedSnapshotsRequest request) throws com.google.protobuf.ServiceException
getCompletedSnapshots
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.DeleteSnapshotResponse deleteSnapshot(com.google.protobuf.RpcController controller, MasterProtos.DeleteSnapshotRequest request) throws com.google.protobuf.ServiceException
deleteSnapshot
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
- wrapping SnapshotDoesNotExistException if specified snapshot did not
exist.public MasterProtos.IsSnapshotDoneResponse isSnapshotDone(com.google.protobuf.RpcController controller, MasterProtos.IsSnapshotDoneRequest request) throws com.google.protobuf.ServiceException
isSnapshotDone
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
- wrapping UnknownSnapshotException if invalid snapshot, or
a wrapped HBaseSnapshotException with progress failure reason.public MasterProtos.RestoreSnapshotResponse restoreSnapshot(com.google.protobuf.RpcController controller, MasterProtos.RestoreSnapshotRequest request) throws com.google.protobuf.ServiceException
If the specified table exists a "Restore" is executed, replacing the table schema and directory data with the content of the snapshot. The table must be disabled, or a UnsupportedOperationException will be thrown.
If the table doesn't exist a "Clone" is executed, a new table is created using the schema at the time of the snapshot, and the content of the snapshot.
The restore/clone operation does not require copying HFiles. Since HFiles are immutable the table can point to and use the same files as the original one.
restoreSnapshot
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.IsRestoreSnapshotDoneResponse isRestoreSnapshotDone(com.google.protobuf.RpcController controller, MasterProtos.IsRestoreSnapshotDoneRequest request) throws com.google.protobuf.ServiceException
isRestoreSnapshotDone
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
- if the operation failed.public MasterProtos.ExecProcedureResponse execProcedure(com.google.protobuf.RpcController controller, MasterProtos.ExecProcedureRequest request) throws com.google.protobuf.ServiceException
execProcedure
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.IsProcedureDoneResponse isProcedureDone(com.google.protobuf.RpcController controller, MasterProtos.IsProcedureDoneRequest request) throws com.google.protobuf.ServiceException
isProcedureDone
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
- if invalid procedure, or
a failed procedure with progress failure reason.public MasterProtos.ModifyNamespaceResponse modifyNamespace(com.google.protobuf.RpcController controller, MasterProtos.ModifyNamespaceRequest request) throws com.google.protobuf.ServiceException
modifyNamespace
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.CreateNamespaceResponse createNamespace(com.google.protobuf.RpcController controller, MasterProtos.CreateNamespaceRequest request) throws com.google.protobuf.ServiceException
createNamespace
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.DeleteNamespaceResponse deleteNamespace(com.google.protobuf.RpcController controller, MasterProtos.DeleteNamespaceRequest request) throws com.google.protobuf.ServiceException
deleteNamespace
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.GetNamespaceDescriptorResponse getNamespaceDescriptor(com.google.protobuf.RpcController controller, MasterProtos.GetNamespaceDescriptorRequest request) throws com.google.protobuf.ServiceException
getNamespaceDescriptor
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.ListNamespaceDescriptorsResponse listNamespaceDescriptors(com.google.protobuf.RpcController controller, MasterProtos.ListNamespaceDescriptorsRequest request) throws com.google.protobuf.ServiceException
listNamespaceDescriptors
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.ListTableDescriptorsByNamespaceResponse listTableDescriptorsByNamespace(com.google.protobuf.RpcController controller, MasterProtos.ListTableDescriptorsByNamespaceRequest request) throws com.google.protobuf.ServiceException
listTableDescriptorsByNamespace
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public MasterProtos.ListTableNamesByNamespaceResponse listTableNamesByNamespace(com.google.protobuf.RpcController controller, MasterProtos.ListTableNamesByNamespaceRequest request) throws com.google.protobuf.ServiceException
listTableNamesByNamespace
in interface MasterProtos.MasterService.BlockingInterface
com.google.protobuf.ServiceException
public void createNamespace(NamespaceDescriptor descriptor) throws IOException
MasterServices
createNamespace
in interface MasterServices
descriptor
- descriptor which describes the new namespaceIOException
public void modifyNamespace(NamespaceDescriptor descriptor) throws IOException
MasterServices
modifyNamespace
in interface MasterServices
descriptor
- descriptor which updates the existing namespaceIOException
public void deleteNamespace(String name) throws IOException
MasterServices
deleteNamespace
in interface MasterServices
name
- namespace nameIOException
public NamespaceDescriptor getNamespaceDescriptor(String name) throws IOException
MasterServices
getNamespaceDescriptor
in interface MasterServices
name
- name of namespace descriptorIOException
public List<NamespaceDescriptor> listNamespaceDescriptors() throws IOException
MasterServices
listNamespaceDescriptors
in interface MasterServices
IOException
public List<HTableDescriptor> listTableDescriptorsByNamespace(String name) throws IOException
MasterServices
listTableDescriptorsByNamespace
in interface MasterServices
name
- namespace nameIOException
public List<TableName> listTableNamesByNamespace(String name) throws IOException
MasterServices
listTableNamesByNamespace
in interface MasterServices
name
- namespace nameIOException
Copyright © 2014 The Apache Software Foundation. All rights reserved.