Entry<Integer, String> entry = it.next();
Integer taskId = entry.getKey();
String componentId = entry.getValue();
NodePort np = (NodePort) assignment.getTaskToNodeport().get(taskId);
//���ָ��task��������Ϣ
TaskHeartbeat heartbeat = stormClusterState.task_heartbeat(topologyId, taskId);
if (np == null || heartbeat == null) {
continue;
}
String host = (String) assignment.getNodeHost().get(np.getNode());
List<TaskError> errors = stormClusterState.task_errors(topologyId, taskId);
List<ErrorInfo> newErrors = new ArrayList<ErrorInfo>();
if (errors != null) {
int size = errors.size();
for (int i = 0; i < size; i++) {
TaskError e = (TaskError) errors.get(i);
newErrors.add(new ErrorInfo(e.getError(), e.getTimSecs()));
}
}
BaseStatsData status = (BaseStatsData) heartbeat.getStats();
TaskStats tkStatus = status.getTaskStats();
int uptimeSecs = heartbeat.getUptimeSecs();
TaskSummary taskSummary = new TaskSummary(taskId, componentId,
host, np.getPort(), uptimeSecs, newErrors);
taskSummary.set_stats(tkStatus);
taskSummarys.add(taskSummary);
}