Search in sources :

Example 1 with StatusImpl

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;
}
Also used : StatusImpl(com.hortonworks.streamline.streams.actions.StatusImpl) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

StatusImpl (com.hortonworks.streamline.streams.actions.StatusImpl)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1