Map<String, StormBase> bases = Cluster
.topology_bases(stormClusterState);
for (Entry<String, StormBase> entry : bases.entrySet()) {
String topologyId = entry.getKey();
StormBase base = entry.getValue();
Assignment assignment = stormClusterState.assignment_info(
topologyId, null);
if (assignment == null) {
LOG.error("Failed to get assignment of " + topologyId);
continue;
}
assignments.put(topologyId, assignment);
Map<Integer, String> lastErrTimeStamp = null;
try {
lastErrTimeStamp = stormClusterState.topo_lastErr_time(topologyId);
} catch (Exception e) {
LOG.error("Failed to get last error timestamp map for "+ topologyId +
", and begin to remove the corrupt data", e);
try {
stormClusterState.remove_lastErr_time(topologyId);
} catch (Exception rmErr) {
LOG.error("Failed to remove last error timestamp in ZK for " + topologyId, rmErr);
}
}
TopologySummary topology = NimbusUtils.mkTopologySummary(
assignment, topologyId, base.getStormName(),
base.getStatusString(),
TimeUtils.time_delta(base.getLanchTimeSecs()), lastErrTimeStamp);
topologySummaries.add(topology);
}