public static String getTopologyId(String name, Nimbus.Iface client) { try { ClusterSummary summary = client.getClusterInfo(); for (TopologySummary s : summary.get_topologies()) { if (s.get_name().equals(name)) { return s.get_id(); } } } catch (Exception e) { throw new RuntimeException(e); } return null; }
@Override public void run(Nimbus.Iface nimbus) throws Exception { List<TopologySummary> topologies = nimbus.getClusterInfo().get_topologies(); if (topologies == null || topologies.isEmpty()) { System.out.println("No topologies running."); } else { System.out.printf(MSG_FORMAT, "Topology_name", "Status", "Num_tasks", "Num_workers", "Uptime_secs", "Topology_Id", "Owner"); System.out.println("----------------------------------------------------------------------------------------"); for (TopologySummary topology : topologies) { System.out.printf(MSG_FORMAT, topology.get_name(), topology.get_status(), topology.get_num_tasks(), topology.get_num_workers(), topology.get_uptime_secs(), topology.get_id(), topology.get_owner()); } } } });
if (topologyName.equals(topo.get_name())) { String topologyId = topo.get_id(); topologyConf = (Map<String, Object>) JSONValue.parse(client.getTopologyConf(topologyId)); LOG.info("Using topology conf from {} as basis for getting new creds", topologyId);
private HashSet<String> getComponents(Nimbus.Iface client, String topology) throws Exception { HashSet<String> components = new HashSet<>(); ClusterSummary clusterSummary = client.getClusterInfo(); TopologySummary topologySummary = null; for (TopologySummary ts : clusterSummary.get_topologies()) { if (topology.equals(ts.get_name())) { topologySummary = ts; break; } } if (topologySummary == null) { throw new IllegalArgumentException("topology: " + topology + " not found"); } else { String id = topologySummary.get_id(); GetInfoOptions getInfoOpts = new GetInfoOptions(); getInfoOpts.set_num_err_choice(NumErrorsChoice.NONE); TopologyInfo info = client.getTopologyInfoWithOpts(id, getInfoOpts); for (ExecutorSummary es : info.get_executors()) { components.add(es.get_component_id()); } } return components; }
for (TopologySummary ts : summary.get_topologies()) { if (name.equals(ts.get_name())) { id = ts.get_id();
public static String topoNameToId(String topoName, ILocalCluster cluster) throws TException { for (TopologySummary topoSum : cluster.getClusterInfo().get_topologies()) { if (topoSum.get_name().equals(topoName)) { return topoSum.get_id(); } } return null; }
for (TopologySummary ts : summary.get_topologies()) { if (name.equals(ts.get_name())) { id = ts.get_id();
for (TopologySummary ts : summary.get_topologies()) { if (name.equals(ts.get_name())) { id = ts.get_id();
throw new IllegalArgumentException("topology: " + _topology + " not found"); } else { String id = topologySummary.get_id(); GetInfoOptions getInfoOpts = new GetInfoOptions(); getInfoOpts.set_num_err_choice(NumErrorsChoice.NONE);
static TopologyLoadConf captureTopology(Nimbus.Iface client, TopologySummary topologySummary) throws Exception { String topologyName = topologySummary.get_name(); LOG.info("Capturing {}...", topologyName); String topologyId = topologySummary.get_id(); TopologyInfo info = client.getTopologyInfo(topologyId); TopologyPageInfo tpinfo = client.getTopologyPageInfo(topologyId, ":all-time", false);
for (TopologySummary ts: summary.get_topologies()) { if (names.contains(ts.get_name())) { ids.add(ts.get_id());
public static MetricsSample factory(Nimbus.Iface client, String topologyName) throws Exception { // "************ Sampling Metrics ***************** ClusterSummary clusterSummary = client.getClusterInfo(); // get topology info TopologySummary topSummary = getTopologySummary(clusterSummary, topologyName); int topologyExecutors = topSummary.get_num_executors(); int topologyWorkers = topSummary.get_num_workers(); int topologyTasks = topSummary.get_num_tasks(); TopologyInfo topInfo = client.getTopologyInfo(topSummary.get_id()); MetricsSample sample = getMetricsSample(topInfo); sample.numWorkers = topologyWorkers; sample.numExecutors = topologyExecutors; sample.numTasks = topologyTasks; return sample; }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ID: return get_id();
public static String getTopologyId(String name, Nimbus.Client client) { try { ClusterSummary summary = client.getClusterInfo(); for(TopologySummary s : summary.get_topologies()) { if(s.get_name().equals(name)) { return s.get_id(); } } } catch(Exception e) { throw new RuntimeException(e); } return null; }
private HashSet<String> getComponents(Nimbus.Client client, String topology) throws Exception{ HashSet<String> components = new HashSet<>(); ClusterSummary clusterSummary = client.getClusterInfo(); TopologySummary topologySummary = null; for (TopologySummary ts: clusterSummary.get_topologies()) { if (topology.equals(ts.get_name())) { topologySummary = ts; break; } } if (topologySummary == null) { throw new IllegalArgumentException("topology: " + topology + " not found"); } else { String id = topologySummary.get_id(); GetInfoOptions getInfoOpts = new GetInfoOptions(); getInfoOpts.set_num_err_choice(NumErrorsChoice.NONE); TopologyInfo info = client.getTopologyInfoWithOpts(id, getInfoOpts); for (ExecutorSummary es: info.get_executors()) { components.add(es.get_component_id()); } } return components; }
throw new IllegalArgumentException("topology: " + _topology + " not found"); } else { String id = topologySummary.get_id(); GetInfoOptions getInfoOpts = new GetInfoOptions(); getInfoOpts.set_num_err_choice(NumErrorsChoice.NONE);
int totalFailed = 0; for (TopologySummary ts: summary.get_topologies()) { String id = ts.get_id(); TopologyInfo info = client.getTopologyInfo(id); for (ExecutorSummary es: info.get_executors()) {
public Object getFieldValue(_Fields field) { switch (field) { case ID: return get_id();