public class Supervisor extends Object implements DaemonCommon, AutoCloseable
Constructor and Description |
---|
Supervisor(Map<String,Object> conf,
IContext sharedContext,
ISupervisor iSupervisor,
StormMetricsRegistry metricsRegistry)
Constructor for supervisor daemon.
|
public Supervisor(Map<String,Object> conf, IContext sharedContext, ISupervisor iSupervisor, StormMetricsRegistry metricsRegistry) throws IOException, IllegalAccessException, ClassNotFoundException, InstantiationException
Constructor for supervisor daemon.
conf
- configsharedContext
- IContext
iSupervisor
- ISupervisor
IOException
IllegalAccessException
ClassNotFoundException
InstantiationException
public static void main(String[] args) throws Exception
supervisor daemon enter entrance.
args
- Exception
public ExecutorService getHeartbeatExecutor()
Get the executor service that is supposed to be used for heart-beats.
public String getId()
public ISupervisor getiSupervisor()
public Utils.UptimeComputer getUpTime()
public String getStormVersion()
public IStormClusterState getStormClusterState()
public ReadClusterState getReadClusterState()
public String getAssignmentId()
public int getThriftServerPort()
public String getHostName()
public AtomicReference<Map<Long,LocalAssignment>> getCurrAssignment()
public Nimbus.Iface getLocalNimbus()
public void setLocalNimbus(Nimbus.Iface nimbus)
public void launchDaemon()
start distribute supervisor.
public void checkAuthorization(String operation) throws AuthorizationException
AuthorizationException
public void checkAuthorization(String topoName, Map<String,Object> topoConf, String operation) throws AuthorizationException
AuthorizationException
public void checkAuthorization(String topoName, Map<String,Object> topoConf, String operation, ReqContext context) throws AuthorizationException
AuthorizationException
public void sendSupervisorAssignments(SupervisorAssignments assignments)
Used for local cluster assignments distribution.
assignments
- SupervisorAssignments
public void close()
close
in interface AutoCloseable
public void shutdownAllWorkers(BiConsumer<Slot,Long> onWarnTimeout, UniFunc<Slot> onErrorTimeout)
public boolean isWaiting()
isWaiting
in interface DaemonCommon
Copyright © 2019 The Apache Software Foundation. All rights reserved.