Package org.apache.accumulo.master
Class Master
- java.lang.Object
-
- org.apache.accumulo.server.AbstractServer
-
- org.apache.accumulo.master.Master
-
- All Implemented Interfaces:
AutoCloseable,Runnable,HighlyAvailableService,LiveTServerSet.Listener,CurrentState,TableObserver
public class Master extends AbstractServer implements LiveTServerSet.Listener, TableObserver, CurrentState, HighlyAvailableService
The Master is responsible for assigning and balancing tablets to tablet servers.The master will also coordinate log recoveries and reports general status.
-
-
Method Summary
-
Methods inherited from class org.apache.accumulo.server.AbstractServer
close, getConfiguration, getContext, getHostname, getMetricsSystem, runServer
-
-
-
-
Method Detail
-
getMasterState
public MasterState getMasterState()
- Specified by:
getMasterStatein interfaceCurrentState
-
stillMaster
public boolean stillMaster()
-
mustBeOnline
public void mustBeOnline(TableId tableId) throws ThriftTableOperationException
- Throws:
ThriftTableOperationException
-
getTableManager
public TableManager getTableManager()
-
getInstanceID
public String getInstanceID()
-
getZooKeeperRoot
public String getZooKeeperRoot()
-
getConnection
public LiveTServerSet.TServerConnection getConnection(TServerInstance server)
-
setMergeState
public void setMergeState(MergeInfo info, MergeState state) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
clearMergeState
public void clearMergeState(TableId tableId) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
hasCycled
public boolean hasCycled(long time)
-
clearMigrations
public void clearMigrations(TableId tableId)
-
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(TableId tableId, TableState state)
- Specified by:
stateChangedin interfaceTableObserver
-
initialize
public void initialize()
- Specified by:
initializein interfaceTableObserver
-
sessionExpired
public void sessionExpired()
- Specified by:
sessionExpiredin interfaceTableObserver
-
onlineTables
public Set<TableId> 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()
-
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.
-
isActiveService
public boolean isActiveService()
- Specified by:
isActiveServicein interfaceHighlyAvailableService
-
getOutputStream
public org.apache.hadoop.fs.FSDataOutputStream getOutputStream(String path) throws IOException
- Throws:
IOException
-
getInputStream
public org.apache.hadoop.fs.FSDataInputStream getInputStream(String path) throws IOException
- Throws:
IOException
-
-