Class Supervisor
- java.lang.Object
-
- org.apache.storm.daemon.supervisor.Supervisor
-
- All Implemented Interfaces:
AutoCloseable
,DaemonCommon
public class Supervisor extends Object implements DaemonCommon, AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description Supervisor(Map<String,Object> conf, IContext sharedContext, ISupervisor iSupervisor, StormMetricsRegistry metricsRegistry)
Constructor for supervisor daemon.
-
Method Summary
-
-
-
Constructor Detail
-
Supervisor
public Supervisor(Map<String,Object> conf, IContext sharedContext, ISupervisor iSupervisor, StormMetricsRegistry metricsRegistry) throws IOException, IllegalAccessException, ClassNotFoundException, InstantiationException
Constructor for supervisor daemon.- Parameters:
conf
- configsharedContext
-IContext
iSupervisor
-ISupervisor
- Throws:
IOException
IllegalAccessException
ClassNotFoundException
InstantiationException
-
-
Method Detail
-
main
public static void main(String[] args) throws Exception
supervisor daemon enter entrance.- Throws:
Exception
-
getHeartbeatExecutor
public ExecutorService getHeartbeatExecutor()
Get the executor service that is supposed to be used for heart-beats.
-
getId
public String getId()
-
getMetricsRegistry
public StormMetricsRegistry getMetricsRegistry()
-
getiSupervisor
public ISupervisor getiSupervisor()
-
getUpTime
public Utils.UptimeComputer getUpTime()
-
getStormVersion
public String getStormVersion()
-
getStormClusterState
public IStormClusterState getStormClusterState()
-
getReadClusterState
public ReadClusterState getReadClusterState()
-
getAssignmentId
public String getAssignmentId()
-
getThriftServerPort
public int getThriftServerPort()
-
getHostName
public String getHostName()
-
getCurrAssignment
public AtomicReference<Map<Long,LocalAssignment>> getCurrAssignment()
-
getLocalNimbus
public Nimbus.Iface getLocalNimbus()
-
setLocalNimbus
public void setLocalNimbus(Nimbus.Iface nimbus)
-
launchDaemon
public void launchDaemon()
start distribute supervisor.
-
checkAuthorization
public void checkAuthorization(String operation) throws AuthorizationException
- Throws:
AuthorizationException
-
checkAuthorization
public void checkAuthorization(String topoName, Map<String,Object> topoConf, String operation) throws AuthorizationException
- Throws:
AuthorizationException
-
checkAuthorization
public void checkAuthorization(String topoName, Map<String,Object> topoConf, String operation, ReqContext context) throws AuthorizationException
- Throws:
AuthorizationException
-
getSupervisorThriftInterface
public Supervisor.Iface getSupervisorThriftInterface()
-
sendSupervisorAssignments
public void sendSupervisorAssignments(SupervisorAssignments assignments)
Used for local cluster assignments distribution.- Parameters:
assignments
-SupervisorAssignments
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdownAllWorkers
public void shutdownAllWorkers(BiConsumer<Slot,Long> onWarnTimeout, UniFunc<Slot> onErrorTimeout)
-
isWaiting
public boolean isWaiting()
- Specified by:
isWaiting
in interfaceDaemonCommon
-
-