Class Supervisor
java.lang.Object
org.apache.storm.daemon.supervisor.Supervisor
- All Implemented Interfaces:
AutoCloseable
,DaemonCommon
-
Constructor Summary
ConstructorDescriptionSupervisor
(Map<String, Object> conf, IContext sharedContext, ISupervisor iSupervisor, StormMetricsRegistry metricsRegistry) Constructor for supervisor daemon. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkAuthorization
(String operation) void
void
checkAuthorization
(String topoName, Map<String, Object> topoConf, String operation, ReqContext context) void
close()
getConf()
Get the executor service that is supposed to be used for heart-beats.getId()
int
boolean
void
launch()
Launch the supervisor.void
start distribute supervisor.static void
supervisor daemon enter entrance.void
sendSupervisorAssignments
(SupervisorAssignments assignments) Used for local cluster assignments distribution.void
setLocalNimbus
(Nimbus.Iface nimbus) void
shutdownAllWorkers
(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
-IContext
iSupervisor
-ISupervisor
- Throws:
IOException
IllegalAccessException
ClassNotFoundException
InstantiationException
-
-
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:
close
in interfaceAutoCloseable
-
shutdownAllWorkers
-
isWaiting
public boolean isWaiting()- Specified by:
isWaiting
in interfaceDaemonCommon
-