private Map getConfigInfo(Gondola gondola) { Map<Object, Object> map = new LinkedHashMap<>(); Config config = gondola.getConfig(); map.put("file", config.getFile()); map.put("members", config.getMembers()); map.put("shards", config.getShardIds().stream() .map(config::getAttributesForShard) .collect(Collectors.toList())); map.put("hosts", config.getHostIds().stream() .map(config::getAttributesForHost) .collect(Collectors.toList())); return map; }
private void sendActionToAll(Action action, Object... args) { for (Config.ConfigMember m : config.getMembers()) { sendAction(m.getMemberId(), action, args); } }