/** * Get all of the supervisors with the ID as the key. */ default Map<String, SupervisorInfo> allSupervisorInfo() { return allSupervisorInfo(null); }
@Override public void run(String[] args, Map<String, Object> conf, String command) throws Exception { IStormClusterState stormClusterState = ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf)); Map<String, SupervisorInfo> infos = stormClusterState.allSupervisorInfo(); if (args.length <= 0) { for (Map.Entry<String, SupervisorInfo> entry: infos.entrySet()) { System.out.println(entry.getKey() + ":"); System.out.println(prettyPrint(entry.getValue())); } } else { for (String arg : args) { System.out.println(arg + ":"); System.out.println(prettyPrint(infos.get(arg))); } } }
private static Map<String, SupervisorDetails> basicSupervisorDetailsMap(IStormClusterState state) { Map<String, SupervisorDetails> ret = new HashMap<>(); for (Entry<String, SupervisorInfo> entry : state.allSupervisorInfo().entrySet()) { String id = entry.getKey(); SupervisorInfo info = entry.getValue(); ret.put(id, new SupervisorDetails(id, info.get_server_port(), info.get_hostname(), info.get_scheduler_meta(), null, info.get_resources_map())); } return ret; }
Map<String, SupervisorDetails> ret = new HashMap<>(); IStormClusterState state = stormClusterState; Map<String, SupervisorInfo> superInfos = state.allSupervisorInfo(); List<SupervisorDetails> superDetails = new ArrayList<>(); for (Entry<String, SupervisorInfo> entry : superInfos.entrySet()) {
getSupervisorPageInfoCalls.mark(); IStormClusterState state = stormClusterState; Map<String, SupervisorInfo> superInfos = state.allSupervisorInfo(); Map<String, List<String>> hostToSuperId = new HashMap<>(); for (Entry<String, SupervisorInfo> entry : superInfos.entrySet()) {
private ClusterSummary getClusterInfoImpl() throws Exception { IStormClusterState state = stormClusterState; Map<String, SupervisorInfo> infos = state.allSupervisorInfo(); List<SupervisorSummary> summaries = new ArrayList<>(infos.size()); for (Entry<String, SupervisorInfo> entry : infos.entrySet()) {