org.apache.accumulo.server.master
Class Master

java.lang.Object
  extended by org.apache.accumulo.server.master.Master
All Implemented Interfaces:
LiveTServerSet.Listener, CurrentState, TableObserver

public class Master
extends Object
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.


Constructor Summary
Master(ServerConfiguration config, org.apache.hadoop.fs.FileSystem fs, String hostname)
           
 
Method Summary
 void clearMergeState(org.apache.hadoop.io.Text tableId)
           
 void clearMigrations(String tableId)
           
static
<T> T
createInstanceFromPropertyName(AccumuloConfiguration conf, Property property, Class<T> base, T defaultInstance)
           
 ServerConfiguration getConfiguration()
           
 LiveTServerSet.TServerConnection getConnection(TServerInstance server)
           
 Connector getConnector()
           
 EventCoordinator getEventCoordinator()
           
 org.apache.hadoop.fs.FileSystem getFileSystem()
           
 Instance getInstance()
           
 ZooLock getMasterLock()
           
 MergeInfo getMergeInfo(KeyExtent tablet)
           
 MergeInfo getMergeInfo(org.apache.hadoop.io.Text tableId)
           
 AccumuloConfiguration getSystemConfiguration()
           
 boolean hasCycled(long time)
           
 void initialize(Map<String,TableState> tableIdToStateMap)
           
 void killTServer(TServerInstance server)
           
static void main(String[] args)
           
 Collection<MergeInfo> merges()
           
 void mustBeOnline(String tableId)
           
 Set<String> onlineTables()
           
 Set<TServerInstance> onlineTabletServers()
           
 void run()
           
 void sessionExpired()
           
 void setMergeState(MergeInfo info, MergeState state)
           
 void shutdownTServer(TServerInstance server)
           
 void stateChanged(String tableId, TableState state)
           
 boolean stillMaster()
           
 void update(LiveTServerSet current, Set<TServerInstance> deleted, Set<TServerInstance> added)
           
 void updateRecoveryInProgress(String file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Master

public Master(ServerConfiguration config,
              org.apache.hadoop.fs.FileSystem fs,
              String hostname)
       throws IOException
Throws:
IOException
Method Detail

stillMaster

public boolean stillMaster()

mustBeOnline

public void mustBeOnline(String tableId)
                  throws ThriftTableOperationException
Throws:
ThriftTableOperationException

getConnector

public Connector getConnector()
                       throws AccumuloException,
                              AccumuloSecurityException
Throws:
AccumuloException
AccumuloSecurityException

createInstanceFromPropertyName

public static <T> T createInstanceFromPropertyName(AccumuloConfiguration conf,
                                                   Property property,
                                                   Class<T> base,
                                                   T defaultInstance)

getConnection

public LiveTServerSet.TServerConnection getConnection(TServerInstance server)

getMergeInfo

public MergeInfo getMergeInfo(KeyExtent tablet)

getMergeInfo

public MergeInfo getMergeInfo(org.apache.hadoop.io.Text tableId)

setMergeState

public void setMergeState(MergeInfo info,
                          MergeState state)
                   throws IOException,
                          org.apache.zookeeper.KeeperException,
                          InterruptedException
Throws:
IOException
org.apache.zookeeper.KeeperException
InterruptedException

clearMergeState

public void clearMergeState(org.apache.hadoop.io.Text tableId)
                     throws IOException,
                            org.apache.zookeeper.KeeperException,
                            InterruptedException
Throws:
IOException
org.apache.zookeeper.KeeperException
InterruptedException

hasCycled

public boolean hasCycled(long time)

clearMigrations

public void clearMigrations(String tableId)

run

public void run()
         throws IOException,
                InterruptedException,
                org.apache.zookeeper.KeeperException
Throws:
IOException
InterruptedException
org.apache.zookeeper.KeeperException

getMasterLock

public ZooLock getMasterLock()

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

update

public void update(LiveTServerSet current,
                   Set<TServerInstance> deleted,
                   Set<TServerInstance> added)
Specified by:
update in interface LiveTServerSet.Listener

stateChanged

public void stateChanged(String tableId,
                         TableState state)
Specified by:
stateChanged in interface TableObserver

initialize

public void initialize(Map<String,TableState> tableIdToStateMap)
Specified by:
initialize in interface TableObserver

sessionExpired

public void sessionExpired()
Specified by:
sessionExpired in interface TableObserver

onlineTables

public Set<String> onlineTables()
Specified by:
onlineTables in interface CurrentState

onlineTabletServers

public Set<TServerInstance> onlineTabletServers()
Specified by:
onlineTabletServers in interface CurrentState

merges

public Collection<MergeInfo> merges()
Specified by:
merges in interface CurrentState

killTServer

public void killTServer(TServerInstance server)

shutdownTServer

public void shutdownTServer(TServerInstance server)

getEventCoordinator

public EventCoordinator getEventCoordinator()

getInstance

public Instance getInstance()

getSystemConfiguration

public AccumuloConfiguration getSystemConfiguration()

getConfiguration

public ServerConfiguration getConfiguration()

getFileSystem

public org.apache.hadoop.fs.FileSystem getFileSystem()

updateRecoveryInProgress

public void updateRecoveryInProgress(String file)


Copyright © 2013 Apache Accumulo Project. All Rights Reserved.