Package org.apache.accumulo.master
Class Master
- java.lang.Object
-
- org.apache.accumulo.core.client.impl.ClientContext
-
- org.apache.accumulo.server.AccumuloServerContext
-
- org.apache.accumulo.master.Master
-
- All Implemented Interfaces:
LiveTServerSet.Listener,CurrentState,TableObserver
public class Master extends AccumuloServerContext implements LiveTServerSet.Listener, TableObserver, CurrentState
The Master is responsible for assigning and balancing tablets to tablet servers.The master will also coordinate log recoveries and reports general status.
-
-
Field Summary
-
Fields inherited from class org.apache.accumulo.core.client.impl.ClientContext
conn, inst
-
-
Constructor Summary
Constructors Constructor Description Master(ServerConfigurationFactory config, VolumeManager fs, String hostname)
-
Method Summary
-
Methods inherited from class org.apache.accumulo.server.AccumuloServerContext
getConnector, getSaslParams, getSecretManager, getServerConfigurationFactory, getServerSslParams, getThriftServerType, setSecretManager
-
Methods inherited from class org.apache.accumulo.core.client.impl.ClientContext
convertClientConfig, getClientSslParams, getClientTimeoutInMillis, getConfiguration, getCredentials, getInstance, rpcCreds, setCredentials
-
-
-
-
Constructor Detail
-
Master
public Master(ServerConfigurationFactory config, VolumeManager fs, String hostname) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getMasterState
public MasterState getMasterState()
- Specified by:
getMasterStatein interfaceCurrentState
-
stillMaster
public boolean stillMaster()
-
mustBeOnline
public void mustBeOnline(String tableId) throws ThriftTableOperationException
- Throws:
ThriftTableOperationException
-
getConnection
public LiveTServerSet.TServerConnection getConnection(TServerInstance server)
-
setMergeState
public void setMergeState(MergeInfo info, MergeState state) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
clearMergeState
public void clearMergeState(String tableId) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
hasCycled
public boolean hasCycled(long time)
-
clearMigrations
public void clearMigrations(String tableId)
-
run
public void run() throws IOException, InterruptedException, org.apache.zookeeper.KeeperException- Throws:
IOExceptionInterruptedExceptionorg.apache.zookeeper.KeeperException
-
getMasterLock
public ZooLock getMasterLock()
-
update
public void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added)
- Specified by:
updatein interfaceLiveTServerSet.Listener
-
stateChanged
public void stateChanged(String tableId, TableState state)
- Specified by:
stateChangedin interfaceTableObserver
-
initialize
public void initialize(Map<String,TableState> tableIdToStateMap)
- Specified by:
initializein interfaceTableObserver
-
sessionExpired
public void sessionExpired()
- Specified by:
sessionExpiredin interfaceTableObserver
-
onlineTables
public Set<String> onlineTables()
- Specified by:
onlineTablesin interfaceCurrentState
-
onlineTabletServers
public Set<TServerInstance> onlineTabletServers()
- Specified by:
onlineTabletServersin interfaceCurrentState
-
merges
public Collection<MergeInfo> merges()
- Specified by:
mergesin interfaceCurrentState
-
shutdownTServer
public void shutdownTServer(TServerInstance server)
-
getEventCoordinator
public EventCoordinator getEventCoordinator()
-
getConfigurationFactory
public ServerConfigurationFactory getConfigurationFactory()
-
getFileSystem
public VolumeManager getFileSystem()
-
assignedTablet
public void assignedTablet(KeyExtent extent)
-
waitForBalance
public void waitForBalance(TInfo tinfo)
-
getMasterMonitorInfo
public MasterMonitorInfo getMasterMonitorInfo()
-
delegationTokensAvailable
public boolean delegationTokensAvailable()
Can delegation tokens be generated for users
-
migrationsSnapshot
public Set<KeyExtent> migrationsSnapshot()
- Specified by:
migrationsSnapshotin interfaceCurrentState
-
shutdownServers
public Set<TServerInstance> shutdownServers()
- Specified by:
shutdownServersin interfaceCurrentState
-
markDeadServerLogsAsClosed
public void markDeadServerLogsAsClosed(Map<TServerInstance,List<org.apache.hadoop.fs.Path>> logsForDeadServers) throws WalStateManager.WalMarkerException
-
updateBulkImportStatus
public void updateBulkImportStatus(String directory, BulkImportState state)
-
removeBulkImportStatus
public void removeBulkImportStatus(String directory)
-
getSteadyTime
public Long getSteadyTime()
Return how long (in milliseconds) there has been a master overseeing this cluster. This is an approximately monotonic clock, which will be approximately consistent between different masters or different runs of the same master.
-
-