Search in sources :

Example 1 with ExecutorBeat

use of org.apache.storm.cluster.ExecutorBeat in project storm by apache.

the class StatsUtil method convertExecutorBeats.

// =====================================================================================
// convert thrift stats to java maps
// =====================================================================================
/**
     * convert thrift executor heartbeats into a java HashMap
     */
public static Map<List<Integer>, Map<String, Object>> convertExecutorBeats(Map<ExecutorInfo, ExecutorBeat> beats) {
    Map<List<Integer>, Map<String, Object>> ret = new HashMap<>();
    for (Map.Entry<ExecutorInfo, ExecutorBeat> beat : beats.entrySet()) {
        ExecutorInfo executorInfo = beat.getKey();
        ExecutorBeat executorBeat = beat.getValue();
        ret.put(Lists.newArrayList(executorInfo.get_task_start(), executorInfo.get_task_end()), convertZkExecutorHb(executorBeat));
    }
    return ret;
}
Also used : ExecutorInfo(org.apache.storm.generated.ExecutorInfo) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) ExecutorBeat(org.apache.storm.cluster.ExecutorBeat) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 ExecutorBeat (org.apache.storm.cluster.ExecutorBeat)1 ExecutorInfo (org.apache.storm.generated.ExecutorInfo)1