/** * getSpoutExecutors. * @param executorSummaries executorSummaries * @param stormTopology stormTopology * @return getSpoutExecutors. */ public static Map<String, List<ExecutorSummary>> getSpoutExecutors(List<ExecutorSummary> executorSummaries, StormTopology stormTopology) { Map<String, List<ExecutorSummary>> result = new HashMap(); for (ExecutorSummary executorSummary : executorSummaries) { if (StatsUtil.componentType(stormTopology, executorSummary.get_component_id()).equals("spout")) { List<ExecutorSummary> executorSummaryList = result.getOrDefault(executorSummary.get_component_id(), new ArrayList()); executorSummaryList.add(executorSummary); result.put(executorSummary.get_component_id(), executorSummaryList); } } return result; }
/** * getBoltExecutors. * @param executorSummaries executorSummaries * @param stormTopology stormTopology * @param sys sys * @return getBoltExecutors. */ public static Map<String, List<ExecutorSummary>> getBoltExecutors(List<ExecutorSummary> executorSummaries, StormTopology stormTopology, boolean sys) { Map<String, List<ExecutorSummary>> result = new HashMap(); for (ExecutorSummary executorSummary : executorSummaries) { if (StatsUtil.componentType(stormTopology, executorSummary.get_component_id()).equals("bolt") && (sys || !Utils.isSystemId(executorSummary.get_component_id()))) { List<ExecutorSummary> executorSummaryList = result.getOrDefault(executorSummary.get_component_id(), new ArrayList()); executorSummaryList.add(executorSummary); result.put(executorSummary.get_component_id(), executorSummaryList); } } return result; }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case EXECUTOR_INFO: return get_executor_info(); case COMPONENT_ID: return get_component_id(); case HOST: return get_host(); case PORT: return get_port(); case UPTIME_SECS: return get_uptime_secs(); case STATS: return get_stats(); } throw new java.lang.IllegalStateException(); }
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; }
double weightedAvgTotal = 0.0; for (ExecutorSummary exec : info.get_executors()) { if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time");
double weightedAvgTotal = 0.0; for (ExecutorSummary exec : info.get_executors()) { if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time");
double weightedAvgTotal = 0.0; for (ExecutorSummary exec : info.get_executors()) { if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time");
TopologyInfo info = client.getTopologyInfoWithOpts(id, getInfoOpts); for (ExecutorSummary es : info.get_executors()) { if (_component.equals(es.get_component_id())) { componentParallelism++; ExecutorStats stats = es.get_stats();
String component = executor.get_component_id(); List<ExecutorSummary> list = byComponent.get(component); if (list == null) {
public Object getFieldValue(_Fields field) { switch (field) { case EXECUTOR_INFO: return get_executor_info(); case COMPONENT_ID: return get_component_id(); case HOST: return get_host(); case PORT: return get_port(); case UPTIME_SECS: return get_uptime_secs(); case STATS: return get_stats(); } throw new IllegalStateException(); }
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; }
TopologyInfo info = client.getTopologyInfoWithOpts(id, getInfoOpts); for (ExecutorSummary es: info.get_executors()) { if (_component.equals(es.get_component_id())) { componentParallelism ++; ExecutorStats stats = es.get_stats();