Search in sources :

Example 1 with SupervisorWorkerHeartbeats

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);
}
Also used : SupervisorWorkerHeartbeats(org.apache.storm.generated.SupervisorWorkerHeartbeats)

Example 2 with 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;
}
Also used : LSWorkerHeartbeat(org.apache.storm.generated.LSWorkerHeartbeat) SupervisorWorkerHeartbeats(org.apache.storm.generated.SupervisorWorkerHeartbeats) SupervisorWorkerHeartbeat(org.apache.storm.generated.SupervisorWorkerHeartbeat) ArrayList(java.util.ArrayList)

Aggregations

SupervisorWorkerHeartbeats (org.apache.storm.generated.SupervisorWorkerHeartbeats)2 ArrayList (java.util.ArrayList)1 LSWorkerHeartbeat (org.apache.storm.generated.LSWorkerHeartbeat)1 SupervisorWorkerHeartbeat (org.apache.storm.generated.SupervisorWorkerHeartbeat)1