Class Supervisor
java.lang.Object
org.apache.storm.daemon.supervisor.Supervisor
- All Implemented Interfaces:
AutoCloseable,DaemonCommon
-
Constructor Summary
ConstructorsConstructorDescriptionSupervisor(Map<String, Object> conf, IContext sharedContext, ISupervisor iSupervisor, StormMetricsRegistry metricsRegistry) Constructor for supervisor daemon. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAuthorization(String operation) voidvoidcheckAuthorization(String topoName, Map<String, Object> topoConf, String operation, ReqContext context) voidclose()getConf()Get the executor service that is supposed to be used for heart-beats.getId()intbooleanvoidlaunch()Launch the supervisor.voidstart distribute supervisor.static voidsupervisor daemon enter entrance.voidsendSupervisorAssignments(SupervisorAssignments assignments) Used for local cluster assignments distribution.voidsetLocalNimbus(Nimbus.Iface nimbus) voidshutdownAllWorkers(BiConsumer<Slot, Long> onWarnTimeout, UniFunc<Slot> onErrorTimeout)
-
Constructor Details
-
Supervisor
public Supervisor(Map<String, Object> conf, IContext sharedContext, ISupervisor iSupervisor, StormMetricsRegistry metricsRegistry) throws IOException, IllegalAccessException, ClassNotFoundException, InstantiationExceptionConstructor for supervisor daemon.- Parameters:
conf- configsharedContext-IContextiSupervisor-ISupervisor- Throws:
IOExceptionIllegalAccessExceptionClassNotFoundExceptionInstantiationException
-
-
Method Details
-
main
supervisor daemon enter entrance.- Throws:
Exception
-
getHeartbeatExecutor
Get the executor service that is supposed to be used for heart-beats. -
getId
-
getMetricsRegistry
-
getConf
-
getiSupervisor
-
getUpTime
-
getStormVersion
-
getStormClusterState
-
getReadClusterState
-
getAssignmentId
-
getThriftServerPort
public int getThriftServerPort() -
getHostName
-
getCurrAssignment
-
getLocalNimbus
-
setLocalNimbus
-
launch
Launch the supervisor.- Throws:
Exception
-
launchDaemon
public void launchDaemon()start distribute supervisor. -
checkAuthorization
- 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
-
sendSupervisorAssignments
Used for local cluster assignments distribution.- Parameters:
assignments-SupervisorAssignments
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
shutdownAllWorkers
-
isWaiting
public boolean isWaiting()- Specified by:
isWaitingin interfaceDaemonCommon
-