org.apache.hadoop.hbase.master
Class HMaster

java.lang.Object
  extended by org.apache.hadoop.hbase.util.HasThread
      extended by org.apache.hadoop.hbase.master.HMaster
All Implemented Interfaces:
Runnable, Abortable, MasterServices, MasterProtos.MasterService.BlockingInterface, RegionServerStatusProtos.RegionServerStatusService.BlockingInterface, Server, Stoppable
Direct Known Subclasses:
HMasterCommandLine.LocalHMaster

@InterfaceAudience.Private
public class HMaster
extends HasThread
implements MasterProtos.MasterService.BlockingInterface, RegionServerStatusProtos.RegionServerStatusService.BlockingInterface, MasterServices, Server

HMaster is the "master server" for HBase. An HBase cluster has one active master. If many masters are started, all compete. Whichever wins goes on to run the cluster. All others park themselves in their constructor until master or cluster shutdown or until the active master loses its lease in zookeeper. Thereafter, all running master jostle to take over master role.

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().

See Also:
Watcher

Field Summary
static String MASTER
           
 
Constructor Summary
HMaster(org.apache.hadoop.conf.Configuration conf)
          Initializes the HMaster.
 
Method Summary
 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 columnDescriptor)
          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)
           
 String getLoadBalancerClassName()
          Fetch the configured LoadBalancer class name.
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.
 MasterProtos.SecurityCapabilitiesResponse getSecurityCapabilities(com.google.protobuf.RpcController controller, MasterProtos.SecurityCapabilitiesRequest request)
          Returns the security capabilities in effect on the cluster
 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.IsBalancerEnabledResponse isBalancerEnabled(com.google.protobuf.RpcController controller, MasterProtos.IsBalancerEnabledRequest request)
           
 boolean isBalancerOn()
          Queries the state of the LoadBalancerTracker.
 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.ReportRegionStateTransitionResponse reportRegionStateTransition(com.google.protobuf.RpcController controller, RegionServerStatusProtos.ReportRegionStateTransitionRequest req)
           
 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.
 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.TruncateTableResponse truncateTable(com.google.protobuf.RpcController controller, MasterProtos.TruncateTableRequest request)
           
 void truncateTable(TableName tableName, boolean preserveSplits)
          Truncate a table
 MasterProtos.UnassignRegionResponse unassignRegion(com.google.protobuf.RpcController controller, MasterProtos.UnassignRegionRequest req)
           
 
Methods inherited from class org.apache.hadoop.hbase.util.HasThread
getName, getThread, interrupt, isAlive, isInterrupted, join, join, join, setDaemon, setName, setPriority, setUncaughtExceptionHandler, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASTER

public static final String MASTER
See Also:
Constant Field Values
Constructor Detail

HMaster

public HMaster(org.apache.hadoop.conf.Configuration conf)
        throws IOException,
               org.apache.zookeeper.KeeperException,
               InterruptedException
Initializes the HMaster. The steps are as follows:

  1. Initialize HMaster RPC and address
  2. Connect to ZooKeeper.

Remaining steps of initialization occur in run() so that they run in their own thread rather than within the context of the constructor.

Throws:
InterruptedException
IOException
org.apache.zookeeper.KeeperException
Method Detail

run

public void run()
Main processing loop for the HMaster.
  1. Block until becoming active master
  2. Finish initialization via finishInitialization(MonitoredTask)
  3. Enter loop until we are stopped
  4. Stop services and perform cleanup once stopped

Specified by:
run in interface Runnable
Specified by:
run in class HasThread

startCatalogJanitorChore

protected void startCatalogJanitorChore()
Useful for testing purpose also where we have master restart scenarios.


getTableDescriptors

public TableDescriptors getTableDescriptors()
Specified by:
getTableDescriptors in interface MasterServices
Returns:
Return table descriptors implementation.

getInfoServer

public InfoServer getInfoServer()
Returns:
InfoServer object. Maybe null.

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Description copied from interface: Server
Gets the configuration object for this server.

Specified by:
getConfiguration in interface Server

getServerManager

public ServerManager getServerManager()
Specified by:
getServerManager in interface MasterServices
Returns:
Master's ServerManager instance.

getExecutorService

public ExecutorService getExecutorService()
Specified by:
getExecutorService in interface MasterServices
Returns:
Master's instance of ExecutorService

getMasterFileSystem

public MasterFileSystem getMasterFileSystem()
Specified by:
getMasterFileSystem in interface MasterServices
Returns:
Master's filesystem MasterFileSystem utility class.

getZooKeeperWatcher

public ZooKeeperWatcher getZooKeeperWatcher()
Get the ZK wrapper object - needed by master_jsp.java

Returns:
the zookeeper wrapper

getActiveMasterManager

public ActiveMasterManager getActiveMasterManager()

getMasterAddressTracker

public MasterAddressTracker getMasterAddressTracker()

regionServerStartup

public RegionServerStatusProtos.RegionServerStartupResponse regionServerStartup(com.google.protobuf.RpcController controller,
                                                                                RegionServerStatusProtos.RegionServerStartupRequest request)
                                                                         throws com.google.protobuf.ServiceException
Specified by:
regionServerStartup in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

createConfigurationSubset

protected RegionServerStatusProtos.RegionServerStartupResponse.Builder createConfigurationSubset()
Returns:
Subset of configuration to pass initializing regionservers: e.g. the filesystem to use and root directory to use.

getLastFlushedSequenceId

public RegionServerStatusProtos.GetLastFlushedSequenceIdResponse getLastFlushedSequenceId(com.google.protobuf.RpcController controller,
                                                                                          RegionServerStatusProtos.GetLastFlushedSequenceIdRequest request)
                                                                                   throws com.google.protobuf.ServiceException
Specified by:
getLastFlushedSequenceId in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

regionServerReport

public RegionServerStatusProtos.RegionServerReportResponse regionServerReport(com.google.protobuf.RpcController controller,
                                                                              RegionServerStatusProtos.RegionServerReportRequest request)
                                                                       throws com.google.protobuf.ServiceException
Specified by:
regionServerReport in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

reportRSFatalError

public RegionServerStatusProtos.ReportRSFatalErrorResponse reportRSFatalError(com.google.protobuf.RpcController controller,
                                                                              RegionServerStatusProtos.ReportRSFatalErrorRequest request)
                                                                       throws com.google.protobuf.ServiceException
Specified by:
reportRSFatalError in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

isMasterRunning

public boolean isMasterRunning()

isMasterRunning

public MasterProtos.IsMasterRunningResponse isMasterRunning(com.google.protobuf.RpcController c,
                                                            MasterProtos.IsMasterRunningRequest req)
                                                     throws com.google.protobuf.ServiceException
Specified by:
isMasterRunning in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

runCatalogScan

public MasterProtos.RunCatalogScanResponse runCatalogScan(com.google.protobuf.RpcController c,
                                                          MasterProtos.RunCatalogScanRequest req)
                                                   throws com.google.protobuf.ServiceException
Specified by:
runCatalogScan in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

enableCatalogJanitor

public MasterProtos.EnableCatalogJanitorResponse enableCatalogJanitor(com.google.protobuf.RpcController c,
                                                                      MasterProtos.EnableCatalogJanitorRequest req)
                                                               throws com.google.protobuf.ServiceException
Specified by:
enableCatalogJanitor in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

isCatalogJanitorEnabled

public MasterProtos.IsCatalogJanitorEnabledResponse isCatalogJanitorEnabled(com.google.protobuf.RpcController c,
                                                                            MasterProtos.IsCatalogJanitorEnabledRequest req)
                                                                     throws com.google.protobuf.ServiceException
Specified by:
isCatalogJanitorEnabled in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

balance

public boolean balance()
                throws HBaseIOException
Throws:
HBaseIOException

balance

public MasterProtos.BalanceResponse balance(com.google.protobuf.RpcController c,
                                            MasterProtos.BalanceRequest request)
                                     throws com.google.protobuf.ServiceException
Specified by:
balance in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

switchBalancer

public boolean switchBalancer(boolean b,
                              org.apache.hadoop.hbase.master.HMaster.BalanceSwitchMode mode)
                       throws IOException
Assigns balancer switch according to BalanceSwitchMode

Parameters:
b - new balancer switch
mode - BalanceSwitchMode
Returns:
old balancer switch
Throws:
IOException

synchronousBalanceSwitch

public boolean synchronousBalanceSwitch(boolean b)
                                 throws IOException
Throws:
IOException

balanceSwitch

public boolean balanceSwitch(boolean b)
                      throws IOException
Throws:
IOException

setBalancerRunning

public MasterProtos.SetBalancerRunningResponse setBalancerRunning(com.google.protobuf.RpcController controller,
                                                                  MasterProtos.SetBalancerRunningRequest req)
                                                           throws com.google.protobuf.ServiceException
Specified by:
setBalancerRunning in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

setCatalogJanitorEnabled

public void setCatalogJanitorEnabled(boolean b)
Switch for the background CatalogJanitor thread. Used for testing. The thread will continue to run. It will just be a noop if disabled.

Parameters:
b - If false, the catalog janitor won't do anything.

dispatchMergingRegions

public MasterProtos.DispatchMergingRegionsResponse dispatchMergingRegions(com.google.protobuf.RpcController controller,
                                                                          MasterProtos.DispatchMergingRegionsRequest request)
                                                                   throws com.google.protobuf.ServiceException
Specified by:
dispatchMergingRegions in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

dispatchMergingRegions

public void dispatchMergingRegions(HRegionInfo region_a,
                                   HRegionInfo region_b,
                                   boolean forcible)
                            throws IOException
Description copied from interface: MasterServices
Merge two regions. The real implementation is on the regionserver, master just move the regions together and send MERGE RPC to regionserver

Specified by:
dispatchMergingRegions in interface MasterServices
Parameters:
region_a - region to merge
region_b - region to merge
forcible - true if do a compulsory merge, otherwise we will only merge two adjacent regions
Throws:
IOException

moveRegion

public MasterProtos.MoveRegionResponse moveRegion(com.google.protobuf.RpcController controller,
                                                  MasterProtos.MoveRegionRequest req)
                                           throws com.google.protobuf.ServiceException
Specified by:
moveRegion in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

createTable

public void createTable(HTableDescriptor hTableDescriptor,
                        byte[][] splitKeys)
                 throws IOException
Description copied from interface: MasterServices
Create a table using the given table definition.

Specified by:
createTable in interface MasterServices
Parameters:
hTableDescriptor - The table definition
splitKeys - Starting row keys for the initial table regions. If null a single region is created.
Throws:
IOException

createTable

public MasterProtos.CreateTableResponse createTable(com.google.protobuf.RpcController controller,
                                                    MasterProtos.CreateTableRequest req)
                                             throws com.google.protobuf.ServiceException
Specified by:
createTable in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

deleteTable

public void deleteTable(TableName tableName)
                 throws IOException
Description copied from interface: MasterServices
Delete a table

Specified by:
deleteTable in interface MasterServices
Parameters:
tableName - The table name
Throws:
IOException

deleteTable

public MasterProtos.DeleteTableResponse deleteTable(com.google.protobuf.RpcController controller,
                                                    MasterProtos.DeleteTableRequest request)
                                             throws com.google.protobuf.ServiceException
Specified by:
deleteTable in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

getSchemaAlterStatus

public MasterProtos.GetSchemaAlterStatusResponse getSchemaAlterStatus(com.google.protobuf.RpcController controller,
                                                                      MasterProtos.GetSchemaAlterStatusRequest req)
                                                               throws com.google.protobuf.ServiceException
Get the number of regions of the table that have been updated by the alter.

Specified by:
getSchemaAlterStatus in interface MasterProtos.MasterService.BlockingInterface
Returns:
Pair indicating the number of regions updated Pair.getFirst is the regions that are yet to be updated Pair.getSecond is the total number of regions of the table
Throws:
IOException
com.google.protobuf.ServiceException

addColumn

public void addColumn(TableName tableName,
                      HColumnDescriptor columnDescriptor)
               throws IOException
Description copied from interface: MasterServices
Add a new column to an existing table

Specified by:
addColumn in interface MasterServices
Parameters:
tableName - The table name
columnDescriptor - The column definition
Throws:
IOException

addColumn

public MasterProtos.AddColumnResponse addColumn(com.google.protobuf.RpcController controller,
                                                MasterProtos.AddColumnRequest req)
                                         throws com.google.protobuf.ServiceException
Specified by:
addColumn in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

modifyColumn

public void modifyColumn(TableName tableName,
                         HColumnDescriptor descriptor)
                  throws IOException
Description copied from interface: MasterServices
Modify the column descriptor of an existing column in an existing table

Specified by:
modifyColumn in interface MasterServices
Parameters:
tableName - The table name
descriptor - The updated column definition
Throws:
IOException

modifyColumn

public MasterProtos.ModifyColumnResponse modifyColumn(com.google.protobuf.RpcController controller,
                                                      MasterProtos.ModifyColumnRequest req)
                                               throws com.google.protobuf.ServiceException
Specified by:
modifyColumn in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

deleteColumn

public void deleteColumn(TableName tableName,
                         byte[] columnName)
                  throws IOException
Description copied from interface: MasterServices
Delete a column from an existing table

Specified by:
deleteColumn in interface MasterServices
Parameters:
tableName - The table name
columnName - The column name
Throws:
IOException

deleteColumn

public MasterProtos.DeleteColumnResponse deleteColumn(com.google.protobuf.RpcController controller,
                                                      MasterProtos.DeleteColumnRequest req)
                                               throws com.google.protobuf.ServiceException
Specified by:
deleteColumn in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

enableTable

public void enableTable(TableName tableName)
                 throws IOException
Description copied from interface: MasterServices
Enable an existing table

Specified by:
enableTable in interface MasterServices
Parameters:
tableName - The table name
Throws:
IOException

enableTable

public MasterProtos.EnableTableResponse enableTable(com.google.protobuf.RpcController controller,
                                                    MasterProtos.EnableTableRequest request)
                                             throws com.google.protobuf.ServiceException
Specified by:
enableTable in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

disableTable

public void disableTable(TableName tableName)
                  throws IOException
Description copied from interface: MasterServices
Disable an existing table

Specified by:
disableTable in interface MasterServices
Parameters:
tableName - The table name
Throws:
IOException

disableTable

public MasterProtos.DisableTableResponse disableTable(com.google.protobuf.RpcController controller,
                                                      MasterProtos.DisableTableRequest request)
                                               throws com.google.protobuf.ServiceException
Specified by:
disableTable in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

modifyTable

public void modifyTable(TableName tableName,
                        HTableDescriptor descriptor)
                 throws IOException
Description copied from interface: MasterServices
Modify the descriptor of an existing table

Specified by:
modifyTable in interface MasterServices
Parameters:
tableName - The table name
descriptor - The updated table descriptor
Throws:
IOException

modifyTable

public MasterProtos.ModifyTableResponse modifyTable(com.google.protobuf.RpcController controller,
                                                    MasterProtos.ModifyTableRequest req)
                                             throws com.google.protobuf.ServiceException
Specified by:
modifyTable in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

checkTableModifiable

public void checkTableModifiable(TableName tableName)
                          throws IOException,
                                 TableNotFoundException,
                                 TableNotDisabledException
Description copied from interface: MasterServices
Check table is modifiable; i.e. exists and is offline.

Specified by:
checkTableModifiable in interface MasterServices
Parameters:
tableName - Name of table to check.
Throws:
TableNotDisabledException
TableNotFoundException
IOException

getClusterStatus

public MasterProtos.GetClusterStatusResponse getClusterStatus(com.google.protobuf.RpcController controller,
                                                              MasterProtos.GetClusterStatusRequest req)
                                                       throws com.google.protobuf.ServiceException
Specified by:
getClusterStatus in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

getClusterStatus

public ClusterStatus getClusterStatus()
Returns:
cluster status

getClusterId

public String getClusterId()

getLoadedCoprocessors

public static String getLoadedCoprocessors()
The set of loaded coprocessors is stored in a static set. Since it's statically allocated, it does not require that HMaster's cpHost be initialized prior to accessing it.

Returns:
a String representation of the set of names of the loaded coprocessors.

getMasterStartTime

public long getMasterStartTime()
Returns:
timestamp in millis when HMaster was started.

getMasterActiveTime

public long getMasterActiveTime()
Returns:
timestamp in millis when HMaster became the active master.

getRegionServerInfoPort

public int getRegionServerInfoPort(ServerName sn)

getCoprocessors

public String[] getCoprocessors()
Returns:
array of coprocessor SimpleNames.

abort

public void abort(String msg,
                  Throwable t)
Description copied from interface: Abortable
Abort the server or client.

Specified by:
abort in interface Abortable
Parameters:
msg - Why we're aborting.
t - Throwable that caused abort. Can be null.

getZooKeeper

public ZooKeeperWatcher getZooKeeper()
Description copied from interface: Server
Gets the ZooKeeper instance for this server.

Specified by:
getZooKeeper in interface Server

getCoprocessorHost

public MasterCoprocessorHost getCoprocessorHost()
Specified by:
getCoprocessorHost in interface MasterServices
Returns:
Master's instance of MasterCoprocessorHost

getServerName

public ServerName getServerName()
Specified by:
getServerName in interface Server
Returns:
The unique server name for this server.

getCatalogTracker

public CatalogTracker getCatalogTracker()
Specified by:
getCatalogTracker in interface Server
Returns:
Master's instance of CatalogTracker

getAssignmentManager

public AssignmentManager getAssignmentManager()
Specified by:
getAssignmentManager in interface MasterServices
Returns:
Master's instance of the AssignmentManager

getTableLockManager

public TableLockManager getTableLockManager()
Specified by:
getTableLockManager in interface MasterServices
Returns:
Master's instance of TableLockManager

getRegionServerFatalLogBuffer

public MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer()

shutdown

public void shutdown()

shutdown

public MasterProtos.ShutdownResponse shutdown(com.google.protobuf.RpcController controller,
                                              MasterProtos.ShutdownRequest request)
                                       throws com.google.protobuf.ServiceException
Specified by:
shutdown in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

stopMaster

public void stopMaster()

stopMaster

public MasterProtos.StopMasterResponse stopMaster(com.google.protobuf.RpcController controller,
                                                  MasterProtos.StopMasterRequest request)
                                           throws com.google.protobuf.ServiceException
Specified by:
stopMaster in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

stop

public void stop(String why)
Description copied from interface: Stoppable
Stop this service.

Specified by:
stop in interface Stoppable
Parameters:
why - Why we're stopping.

isStopped

public boolean isStopped()
Specified by:
isStopped in interface Stoppable
Returns:
True if Stoppable.stop(String) has been closed.

isAborted

public boolean isAborted()
Description copied from interface: Abortable
Check if the server or client was aborted.

Specified by:
isAborted in interface Abortable
Returns:
true if the server or client was aborted, false otherwise

isActiveMaster

public boolean isActiveMaster()
Report whether this master is currently the active master or not. If not active master, we are parked on ZK waiting to become active. This method is used for testing.

Returns:
true if active master, false if not.

isInitialized

public boolean isInitialized()
Report whether this master has completed with its initialization and is ready. If ready, the master is also the active master. A standby master is never ready. This method is used for testing.

Specified by:
isInitialized in interface MasterServices
Returns:
true if master is ready to go, false if not.

isServerShutdownHandlerEnabled

public boolean isServerShutdownHandlerEnabled()
ServerShutdownHandlerEnabled is set false before completing assignMeta to prevent processing of ServerShutdownHandler.

Specified by:
isServerShutdownHandlerEnabled in interface MasterServices
Returns:
true if assignMeta has completed;

isInitializationStartsMetaRegionAssignment

public boolean isInitializationStartsMetaRegionAssignment()
Report whether this master has started initialization and is about to do meta region assignment

Returns:
true if master is in initialization & about to assign hbase:meta regions

assignRegion

public MasterProtos.AssignRegionResponse assignRegion(com.google.protobuf.RpcController controller,
                                                      MasterProtos.AssignRegionRequest req)
                                               throws com.google.protobuf.ServiceException
Specified by:
assignRegion in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

assignRegion

public void assignRegion(HRegionInfo hri)

unassignRegion

public MasterProtos.UnassignRegionResponse unassignRegion(com.google.protobuf.RpcController controller,
                                                          MasterProtos.UnassignRegionRequest req)
                                                   throws com.google.protobuf.ServiceException
Specified by:
unassignRegion in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

getTableDescriptors

public MasterProtos.GetTableDescriptorsResponse getTableDescriptors(com.google.protobuf.RpcController controller,
                                                                    MasterProtos.GetTableDescriptorsRequest req)
                                                             throws com.google.protobuf.ServiceException
Get list of TableDescriptors for requested tables.

Specified by:
getTableDescriptors in interface MasterProtos.MasterService.BlockingInterface
Parameters:
controller - Unused (set to null).
req - GetTableDescriptorsRequest that contains: - tableNames: requested tables, or if empty, all are requested
Returns:
GetTableDescriptorsResponse
Throws:
com.google.protobuf.ServiceException

getTableNames

public MasterProtos.GetTableNamesResponse getTableNames(com.google.protobuf.RpcController controller,
                                                        MasterProtos.GetTableNamesRequest req)
                                                 throws com.google.protobuf.ServiceException
Get list of userspace table names

Specified by:
getTableNames in interface MasterProtos.MasterService.BlockingInterface
Parameters:
controller - Unused (set to null).
req - GetTableNamesRequest
Returns:
GetTableNamesResponse
Throws:
com.google.protobuf.ServiceException

getAverageLoad

public double getAverageLoad()
Compute the average load across all region servers. Currently, this uses a very naive computation - just uses the number of regions being served, ignoring stats about number of requests.

Returns:
the average load

offlineRegion

public MasterProtos.OfflineRegionResponse offlineRegion(com.google.protobuf.RpcController controller,
                                                        MasterProtos.OfflineRegionRequest request)
                                                 throws com.google.protobuf.ServiceException
Offline specified region from master's in-memory state. It will not attempt to reassign the region as in unassign. This is a special method that should be used by experts or hbck.

Specified by:
offlineRegion in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

registerService

public boolean registerService(com.google.protobuf.Service instance)
Description copied from interface: MasterServices
Registers a new protocol buffer 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.

Specified by:
registerService in interface MasterServices
Parameters:
instance - the Service subclass instance to expose as a coprocessor endpoint
Returns:
true if the registration was successful, false otherwise

execMasterService

public ClientProtos.CoprocessorServiceResponse execMasterService(com.google.protobuf.RpcController controller,
                                                                 ClientProtos.CoprocessorServiceRequest request)
                                                          throws com.google.protobuf.ServiceException
Specified by:
execMasterService in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

constructMaster

public static HMaster constructMaster(Class<? extends HMaster> masterClass,
                                      org.apache.hadoop.conf.Configuration conf)
Utility for constructing an instance of the passed HMaster class.

Parameters:
masterClass -
conf -
Returns:
HMaster instance.

main

public static void main(String[] args)
See Also:
HMasterCommandLine

getHFileCleaner

public HFileCleaner getHFileCleaner()

getSnapshotManagerForTesting

public SnapshotManager getSnapshotManagerForTesting()
Exposed for TESTING!

Returns:
the underlying snapshot manager

snapshot

public MasterProtos.SnapshotResponse snapshot(com.google.protobuf.RpcController controller,
                                              MasterProtos.SnapshotRequest request)
                                       throws com.google.protobuf.ServiceException
Triggers an asynchronous attempt to take a snapshot.

Specified by:
snapshot in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

getCompletedSnapshots

public MasterProtos.GetCompletedSnapshotsResponse getCompletedSnapshots(com.google.protobuf.RpcController controller,
                                                                        MasterProtos.GetCompletedSnapshotsRequest request)
                                                                 throws com.google.protobuf.ServiceException
List the currently available/stored snapshots. Any in-progress snapshots are ignored

Specified by:
getCompletedSnapshots in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

deleteSnapshot

public MasterProtos.DeleteSnapshotResponse deleteSnapshot(com.google.protobuf.RpcController controller,
                                                          MasterProtos.DeleteSnapshotRequest request)
                                                   throws com.google.protobuf.ServiceException
Execute Delete Snapshot operation.

Specified by:
deleteSnapshot in interface MasterProtos.MasterService.BlockingInterface
Returns:
DeleteSnapshotResponse (a protobuf wrapped void) if the snapshot existed and was deleted properly.
Throws:
com.google.protobuf.ServiceException - wrapping SnapshotDoesNotExistException if specified snapshot did not exist.

isSnapshotDone

public MasterProtos.IsSnapshotDoneResponse isSnapshotDone(com.google.protobuf.RpcController controller,
                                                          MasterProtos.IsSnapshotDoneRequest request)
                                                   throws com.google.protobuf.ServiceException
Checks if the specified snapshot is done.

Specified by:
isSnapshotDone in interface MasterProtos.MasterService.BlockingInterface
Returns:
true if the snapshot is in file system ready to use, false if the snapshot is in the process of completing
Throws:
com.google.protobuf.ServiceException - wrapping UnknownSnapshotException if invalid snapshot, or a wrapped HBaseSnapshotException with progress failure reason.

restoreSnapshot

public MasterProtos.RestoreSnapshotResponse restoreSnapshot(com.google.protobuf.RpcController controller,
                                                            MasterProtos.RestoreSnapshotRequest request)
                                                     throws com.google.protobuf.ServiceException
Execute Restore/Clone snapshot operation.

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.

Specified by:
restoreSnapshot in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

isRestoreSnapshotDone

public MasterProtos.IsRestoreSnapshotDoneResponse isRestoreSnapshotDone(com.google.protobuf.RpcController controller,
                                                                        MasterProtos.IsRestoreSnapshotDoneRequest request)
                                                                 throws com.google.protobuf.ServiceException
Returns the status of the requested snapshot restore/clone operation. This method is not exposed to the user, it is just used internally by HBaseAdmin to verify if the restore is completed. No exceptions are thrown if the restore is not running, the result will be "done".

Specified by:
isRestoreSnapshotDone in interface MasterProtos.MasterService.BlockingInterface
Returns:
done true if the restore/clone operation is completed.
Throws:
com.google.protobuf.ServiceException - if the operation failed.

execProcedure

public MasterProtos.ExecProcedureResponse execProcedure(com.google.protobuf.RpcController controller,
                                                        MasterProtos.ExecProcedureRequest request)
                                                 throws com.google.protobuf.ServiceException
Triggers an asynchronous attempt to run a distributed procedure.

Specified by:
execProcedure in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

isProcedureDone

public MasterProtos.IsProcedureDoneResponse isProcedureDone(com.google.protobuf.RpcController controller,
                                                            MasterProtos.IsProcedureDoneRequest request)
                                                     throws com.google.protobuf.ServiceException
Checks if the specified procedure is done.

Specified by:
isProcedureDone in interface MasterProtos.MasterService.BlockingInterface
Returns:
true if the procedure is done, false if the procedure is in the process of completing
Throws:
com.google.protobuf.ServiceException - if invalid procedure, or a failed procedure with progress failure reason.

modifyNamespace

public MasterProtos.ModifyNamespaceResponse modifyNamespace(com.google.protobuf.RpcController controller,
                                                            MasterProtos.ModifyNamespaceRequest request)
                                                     throws com.google.protobuf.ServiceException
Specified by:
modifyNamespace in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

createNamespace

public MasterProtos.CreateNamespaceResponse createNamespace(com.google.protobuf.RpcController controller,
                                                            MasterProtos.CreateNamespaceRequest request)
                                                     throws com.google.protobuf.ServiceException
Specified by:
createNamespace in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

deleteNamespace

public MasterProtos.DeleteNamespaceResponse deleteNamespace(com.google.protobuf.RpcController controller,
                                                            MasterProtos.DeleteNamespaceRequest request)
                                                     throws com.google.protobuf.ServiceException
Specified by:
deleteNamespace in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

getNamespaceDescriptor

public MasterProtos.GetNamespaceDescriptorResponse getNamespaceDescriptor(com.google.protobuf.RpcController controller,
                                                                          MasterProtos.GetNamespaceDescriptorRequest request)
                                                                   throws com.google.protobuf.ServiceException
Specified by:
getNamespaceDescriptor in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

listNamespaceDescriptors

public MasterProtos.ListNamespaceDescriptorsResponse listNamespaceDescriptors(com.google.protobuf.RpcController controller,
                                                                              MasterProtos.ListNamespaceDescriptorsRequest request)
                                                                       throws com.google.protobuf.ServiceException
Specified by:
listNamespaceDescriptors in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

listTableDescriptorsByNamespace

public MasterProtos.ListTableDescriptorsByNamespaceResponse listTableDescriptorsByNamespace(com.google.protobuf.RpcController controller,
                                                                                            MasterProtos.ListTableDescriptorsByNamespaceRequest request)
                                                                                     throws com.google.protobuf.ServiceException
Specified by:
listTableDescriptorsByNamespace in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

listTableNamesByNamespace

public MasterProtos.ListTableNamesByNamespaceResponse listTableNamesByNamespace(com.google.protobuf.RpcController controller,
                                                                                MasterProtos.ListTableNamesByNamespaceRequest request)
                                                                         throws com.google.protobuf.ServiceException
Specified by:
listTableNamesByNamespace in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

createNamespace

public void createNamespace(NamespaceDescriptor descriptor)
                     throws IOException
Description copied from interface: MasterServices
Create a new namespace

Specified by:
createNamespace in interface MasterServices
Parameters:
descriptor - descriptor which describes the new namespace
Throws:
IOException

modifyNamespace

public void modifyNamespace(NamespaceDescriptor descriptor)
                     throws IOException
Description copied from interface: MasterServices
Modify an existing namespace

Specified by:
modifyNamespace in interface MasterServices
Parameters:
descriptor - descriptor which updates the existing namespace
Throws:
IOException

deleteNamespace

public void deleteNamespace(String name)
                     throws IOException
Description copied from interface: MasterServices
Delete an existing namespace. Only empty namespaces (no tables) can be removed.

Specified by:
deleteNamespace in interface MasterServices
Parameters:
name - namespace name
Throws:
IOException

getNamespaceDescriptor

public NamespaceDescriptor getNamespaceDescriptor(String name)
                                           throws IOException
Description copied from interface: MasterServices
Get a namespace descriptor by name

Specified by:
getNamespaceDescriptor in interface MasterServices
Parameters:
name - name of namespace descriptor
Returns:
A descriptor
Throws:
IOException

listNamespaceDescriptors

public List<NamespaceDescriptor> listNamespaceDescriptors()
                                                   throws IOException
Description copied from interface: MasterServices
List available namespace descriptors

Specified by:
listNamespaceDescriptors in interface MasterServices
Returns:
A descriptor
Throws:
IOException

listTableDescriptorsByNamespace

public List<HTableDescriptor> listTableDescriptorsByNamespace(String name)
                                                       throws IOException
Description copied from interface: MasterServices
Get list of table descriptors by namespace

Specified by:
listTableDescriptorsByNamespace in interface MasterServices
Parameters:
name - namespace name
Returns:
descriptors
Throws:
IOException

listTableNamesByNamespace

public List<TableName> listTableNamesByNamespace(String name)
                                          throws IOException
Description copied from interface: MasterServices
Get list of table names by namespace

Specified by:
listTableNamesByNamespace in interface MasterServices
Parameters:
name - namespace name
Returns:
table names
Throws:
IOException

reportRegionStateTransition

public RegionServerStatusProtos.ReportRegionStateTransitionResponse reportRegionStateTransition(com.google.protobuf.RpcController controller,
                                                                                                RegionServerStatusProtos.ReportRegionStateTransitionRequest req)
                                                                                         throws com.google.protobuf.ServiceException
Specified by:
reportRegionStateTransition in interface RegionServerStatusProtos.RegionServerStatusService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

truncateTable

public void truncateTable(TableName tableName,
                          boolean preserveSplits)
                   throws IOException
Description copied from interface: MasterServices
Truncate a table

Specified by:
truncateTable in interface MasterServices
Parameters:
tableName - The table name
preserveSplits - True if the splits should be preserved
Throws:
IOException

truncateTable

public MasterProtos.TruncateTableResponse truncateTable(com.google.protobuf.RpcController controller,
                                                        MasterProtos.TruncateTableRequest request)
                                                 throws com.google.protobuf.ServiceException
Specified by:
truncateTable in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

isBalancerEnabled

public MasterProtos.IsBalancerEnabledResponse isBalancerEnabled(com.google.protobuf.RpcController controller,
                                                                MasterProtos.IsBalancerEnabledRequest request)
                                                         throws com.google.protobuf.ServiceException
Specified by:
isBalancerEnabled in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException

isBalancerOn

public boolean isBalancerOn()
Queries the state of the LoadBalancerTracker. If the balancer is not initialized, false is returned.

Returns:
The state of the load balancer, or false if the load balancer isn't defined.

getLoadBalancerClassName

public String getLoadBalancerClassName()
Fetch the configured LoadBalancer class name. If none is set, a default is returned.

Returns:
The name of the LoadBalancer in use.

getSecurityCapabilities

public MasterProtos.SecurityCapabilitiesResponse getSecurityCapabilities(com.google.protobuf.RpcController controller,
                                                                         MasterProtos.SecurityCapabilitiesRequest request)
                                                                  throws com.google.protobuf.ServiceException
Returns the security capabilities in effect on the cluster

Specified by:
getSecurityCapabilities in interface MasterProtos.MasterService.BlockingInterface
Throws:
com.google.protobuf.ServiceException


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.