use of org.apache.storm.generated.SupervisorWorkerHeartbeats in project storm by apache.
the class ReportWorkerHeartbeats method run.
@Override
public void run() {
SupervisorWorkerHeartbeats supervisorWorkerHeartbeats = getAndResetWorkerHeartbeats();
reportWorkerHeartbeats(supervisorWorkerHeartbeats);
}
use of org.apache.storm.generated.SupervisorWorkerHeartbeats in project storm by apache.
the class ReportWorkerHeartbeats method getSupervisorWorkerHeartbeatsFromLocal.
private SupervisorWorkerHeartbeats getSupervisorWorkerHeartbeatsFromLocal(Map<String, LSWorkerHeartbeat> localHeartbeats) {
SupervisorWorkerHeartbeats supervisorWorkerHeartbeats = new SupervisorWorkerHeartbeats();
List<SupervisorWorkerHeartbeat> heartbeatList = new ArrayList<>();
for (LSWorkerHeartbeat lsWorkerHeartbeat : localHeartbeats.values()) {
// local worker heartbeat can be null cause some error/exception
if (null == lsWorkerHeartbeat) {
continue;
}
SupervisorWorkerHeartbeat supervisorWorkerHeartbeat = new SupervisorWorkerHeartbeat();
supervisorWorkerHeartbeat.set_storm_id(lsWorkerHeartbeat.get_topology_id());
supervisorWorkerHeartbeat.set_executors(lsWorkerHeartbeat.get_executors());
supervisorWorkerHeartbeat.set_time_secs(lsWorkerHeartbeat.get_time_secs());
heartbeatList.add(supervisorWorkerHeartbeat);
}
supervisorWorkerHeartbeats.set_supervisor_id(this.supervisor.getId());
supervisorWorkerHeartbeats.set_worker_heartbeats(heartbeatList);
return supervisorWorkerHeartbeats;
}
Aggregations