@SuppressWarnings("unchecked") @Test public void testGetControllerStatus() throws BlurException, IOException, TException { Map<String, Object> nodeStatus = NodeUtil.getControllerStatus(); assertEquals(2, ((Collection<String>) nodeStatus.get("online")).size()); assertEquals(0, ((Collection<String>) nodeStatus.get("offline")).size()); }
public static Map<String, Object> getControllerStatus() throws IOException, TException { CachingBlurClient client = Config.getCachingBlurClient(); List<String> currentControllers = client.controllerList(); Collection<String> newControllers = subtract(currentControllers, onlineControllers); Collection<String> missingControllers = subtract(onlineControllers, currentControllers); onlineControllers.addAll(newControllers); Map<String, Object> data = new HashMap<String, Object>(); data.put("online", onlineControllers); data.put("offline", missingControllers); return data; }
NodeUtil { public static Map<String, Object> getControllerStatus() throws IOException, TException { CachingBlurClient client = Config.getCachingBlurClient(); List<String> currentControllers = client.controllerList(); Collection<String> newControllers = subtract(currentControllers, onlineControllers); Collection<String> missingControllers = subtract(onlineControllers, currentControllers); onlineControllers.addAll(newControllers); Map<String, Object> data = new HashMap<String, Object>(); data.put("online", onlineControllers); data.put("offline", missingControllers); return data; } }
NodeUtil { public static Map<String, Object> getControllerStatus() throws IOException, TException { CachingBlurClient client = Config.getCachingBlurClient(); List<String> currentControllers = client.controllerList(); Collection<String> newControllers = subtract(currentControllers, onlineControllers); Collection<String> missingControllers = subtract(onlineControllers, currentControllers); onlineControllers.addAll(newControllers); Map<String, Object> data = new HashMap<String, Object>(); data.put("online", onlineControllers); data.put("offline", missingControllers); return data; }  }
NodeUtil { public static Map<String, Object> getControllerStatus() throws IOException, TException { CachingBlurClient client = Config.getCachingBlurClient(); List<String> currentControllers = client.controllerList(); Collection<String> newControllers = subtract(currentControllers, onlineControllers); Collection<String> missingControllers = subtract(onlineControllers, currentControllers); onlineControllers.addAll(newControllers); Map<String, Object> data = new HashMap<String, Object>(); data.put("online", onlineControllers); data.put("offline", missingControllers); return data; }  static Map<String, Object> getControllerStatus(); static Collection<String> subtract(final Collection<String> a, final Collection<String> b); @SuppressWarnings("unchecked") static List<Map<String, Object>> getClusterStatus(); static Map<String, Object> getZookeeperStatus(); }
NodeUtil { public static Map<String, Object> getControllerStatus() throws IOException, TException { CachingBlurClient client = Config.getCachingBlurClient(); List<String> currentControllers = client.controllerList(); Collection<String> newControllers = subtract(currentControllers, onlineControllers); Collection<String> missingControllers = subtract(onlineControllers, currentControllers); onlineControllers.addAll(newControllers); Map<String, Object> data = new HashMap<String, Object>(); data.put("online", onlineControllers); data.put("offline", missingControllers); return data; }  static Map<String, Object> getControllerStatus(); static Collection<String> subtract(final Collection<String> a, final Collection<String> b); @SuppressWarnings("unchecked") static List<Map<String, Object>> getClusterStatus(); static Map<String, Object> getZookeeperStatus();  }