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 and loggers to tablet servers. The master will also coordinate log recoveries and reports general status.


Constructor Summary
Master(String[] args)
           
 
Method Summary
 void clearMergeState(org.apache.hadoop.io.Text tableId)
           
 void clearMigrations(String tableId)
           
static
<T> T
createInstanceFromPropertyName(Property property, Class<T> base, T defaultInstance)
           
 void deadLogger(String address)
           
 void finished(org.apache.accumulo.server.master.CoordinateRecoveryTask.LogFile entry)
           
 LiveTServerSet.TServerConnection getConnection(TServerInstance server)
           
 EventCoordinator getEventCoordinator()
           
 Instance getInstance()
           
 Map<String,String> getLoggers()
           
 ZooLock getMasterLock()
           
 MergeInfo getMergeInfo(org.apache.hadoop.io.Text tableId)
           
 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)
           
 void newLogger(String address)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Master

public Master(String[] args)
       throws IOException
Throws:
IOException
Method Detail

stillMaster

public boolean stillMaster()

mustBeOnline

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

createInstanceFromPropertyName

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

getConnection

public LiveTServerSet.TServerConnection getConnection(TServerInstance server)

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

newLogger

public void newLogger(String address)

deadLogger

public void deadLogger(String address)

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

getLoggers

public Map<String,String> getLoggers()

merges

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

finished

public void finished(org.apache.accumulo.server.master.CoordinateRecoveryTask.LogFile entry)

killTServer

public void killTServer(TServerInstance server)

shutdownTServer

public void shutdownTServer(TServerInstance server)

getEventCoordinator

public EventCoordinator getEventCoordinator()

getInstance

public Instance getInstance()


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.