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 - IContextiSupervisor - ISupervisorIOExceptionIllegalAccessExceptionClassNotFoundExceptionInstantiationExceptionpublic static void main(String[] args) throws Exception
supervisor daemon enter entrance.
args - Exceptionpublic 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
AuthorizationExceptionpublic void checkAuthorization(String topoName, Map<String,Object> topoConf, String operation) throws AuthorizationException
AuthorizationExceptionpublic void checkAuthorization(String topoName, Map<String,Object> topoConf, String operation, ReqContext context) throws AuthorizationException
AuthorizationExceptionpublic Supervisor.Iface getSupervisorThriftInterface()
public void sendSupervisorAssignments(SupervisorAssignments assignments)
Used for local cluster assignments distribution.
assignments - SupervisorAssignmentspublic void close()
close in interface AutoCloseablepublic void shutdownAllWorkers(BiConsumer<Slot,Long> onWarnTimeout, UniFunc<Slot> onErrorTimeout)
public boolean isWaiting()
isWaiting in interface DaemonCommonCopyright © 2022 The Apache Software Foundation. All rights reserved.