use of com.hortonworks.streamline.streams.actions.StatusImpl in project streamline by hortonworks.
the class StormTopologyActionsImpl method status.
@Override
public Status status(TopologyLayout topology, String asUser) throws Exception {
String stormTopologyId = getRuntimeTopologyId(topology, asUser);
Map topologyStatus = client.getTopology(stormTopologyId, asUser);
StatusImpl status = new StatusImpl();
status.setStatus((String) topologyStatus.get("status"));
status.putExtra("Num_tasks", String.valueOf(topologyStatus.get("workersTotal")));
status.putExtra("Num_workers", String.valueOf(topologyStatus.get("tasksTotal")));
status.putExtra("Uptime_secs", String.valueOf(topologyStatus.get("uptimeSeconds")));
return status;
}
Aggregations