public static TopologySummary getTopologySummary(ClusterSummary cs, String name) { for (TopologySummary ts : cs.get_topologies()) { if (name.equals(ts.get_name())) { return ts; } } return null; }
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; }
if (topologyNames.isEmpty() || topologyNames.contains(topologySummary.get_name())) { TopologyLoadConf capturedConf = captureTopology(client, topologySummary); if (cmd.hasOption('a')) {
if (topologyNames.isEmpty() || topologyNames.contains(topologySummary.get_name())) { TopologyLoadConf capturedConf = CaptureLoad.captureTopology(client, topologySummary); if (capturedConf.looksLikeTrident()) {
@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()); } } } });
ClusterSummary summary = client.getClusterInfo(); for (TopologySummary topo : summary.get_topologies()) { if (topologyName.equals(topo.get_name())) {
public boolean checkTopologyUp(String topoName, ILocalCluster cluster) throws TException { ClusterSummary sum = cluster.getClusterInfo(); for (TopologySummary topoSum : sum.get_topologies()) { if (topoSum.get_name().equals(topoName)) { return true; } } return false; } }
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; }
result.put("encodedId", URLEncoder.encode(topologySummary.get_id())); result.put("owner", topologySummary.get_owner()); result.put("name", topologySummary.get_name()); result.put("status", topologySummary.get_status()); result.put("uptime", UIHelpers.prettyUptimeSec(topologySummary.get_uptime_secs()));
String id = null; for (TopologySummary ts : summary.get_topologies()) { if (name.equals(ts.get_name())) { id = ts.get_id();
String id = null; for (TopologySummary ts : summary.get_topologies()) { if (name.equals(ts.get_name())) { id = ts.get_id();
String id = null; 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; }
TopologySummary topologySummary = null; for (TopologySummary ts : clusterSummary.get_topologies()) { if (_topology.equals(ts.get_name())) { topologySummary = ts; break;
public boolean checkTopologyScheduled(String topoName, ILocalCluster cluster) throws TException { if (checkTopologyUp(topoName, cluster)) { ClusterSummary sum = cluster.getClusterInfo(); for (TopologySummary topoSum : sum.get_topologies()) { if (topoSum.get_name().equals(topoName)) { String status = topoSum.get_status(); String sched_status = topoSum.get_sched_status(); if (status.equals("ACTIVE") && (sched_status != null && !sched_status.equals(""))) { return true; } } } } return false; }
Set<String> ids = new HashSet<>(); for (TopologySummary ts: summary.get_topologies()) { if (names.contains(ts.get_name())) { ids.add(ts.get_id());
static TopologyLoadConf captureTopology(Nimbus.Iface client, TopologySummary topologySummary) throws Exception { String topologyName = topologySummary.get_name(); LOG.info("Capturing {}...", topologyName); String topologyId = topologySummary.get_id();
return get_name();
private boolean isApplicationExistsAfterKilled(List<TopologySummary> list) { boolean isFound = false; for (TopologySummary ts : list) { if (ts.get_name().equals(getAppName())) { isFound = true; break; } } return isFound; }
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; }