/** * getTopologyWorkers. * @param topologyInfo topologyInfo * @param config config * @return getTopologyWorkers. */ public static Map<String, Object> getTopologyWorkers(TopologyInfo topologyInfo, Map config) { List<Map> executorSummaries = new ArrayList(); for (ExecutorSummary executorSummary : topologyInfo.get_executors()) { Map<String, Object> executorSummaryMap = new HashMap(); executorSummaryMap.put("host", executorSummary.get_host()); executorSummaryMap.put("port", executorSummary.get_port()); executorSummaries.add(executorSummaryMap); } HashSet hashSet = new HashSet(); hashSet.addAll(executorSummaries); executorSummaries.clear(); executorSummaries.addAll(hashSet); Map<String, Object> result = new HashMap(); result.put("hostPortList", executorSummaries); addLogviewerInfo(config, result); return result; }
/** * getStatMapFromExecutorSummary. * @param executorSummary executorSummary * @return getStatMapFromExecutorSummary */ public static Map<String, Object> getStatMapFromExecutorSummary(ExecutorSummary executorSummary) { Map<String, Object> result = new HashMap(); result.put(":host", executorSummary.get_host()); result.put(":port", executorSummary.get_port()); result.put(":uptime_secs", executorSummary.get_uptime_secs()); result.put(":transferred", null); if (executorSummary.is_set_stats()) { result.put(":transferred", sanitizeTransferredStats(executorSummary.get_stats().get_transferred())); } 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(); }
String host = executorSummary.get_host(); result.put("host", host); int port = executorSummary.get_port(); result.put("port", port); result.put("emitted", nullToZero(commonAggregateStats.get_emitted()));
for (ExecutorSummary exec : info.get_executors()) { hosts.add(exec.get_host()); workers.add(exec.get_host() + exec.get_port()); executors++; if (exec.get_stats() != null && exec.get_stats().get_specific() != null
String host = executorSummary.get_host(); result.put("host", host); int port = executorSummary.get_port(); result.put("port", port); result.put("emitted", nullToZero(commonAggregateStats.get_emitted()));
if (uptime <= 0) { String key = summary.get_host() + ":" + summary.get_port(); uptime = workerToUptime.getOrDefault(key, 1); LOG.debug("Getting uptime for worker {}, {}", key, uptime);
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(); }