static { RegistryFactory regFactory = new RegistryFactory(); regFactory.init(); REGISTRY = regFactory.getRegistry(); LOG.debug("Node status is healthy by default."); REGISTRY.bind(NodeHealth.IS_CURRENT_NODE_HEALTHY, "true"); }
public static boolean isNodeHealthy() { Object isCurrentNodeHealthy = REGISTRY.lookup(NodeHealth.IS_CURRENT_NODE_HEALTHY); if (Boolean.parseBoolean(isCurrentNodeHealthy.toString())) { LOG.debug("Node is healthy"); return true; } LOG.debug("Node is unhealthy"); return false; }
public static void setUnHealthy() { LOG.warn("Node status is unhealthy."); REGISTRY.bind(NodeHealth.IS_CURRENT_NODE_HEALTHY, "false"); }
public static void setHealthy() { LOG.debug("Node status is healthy."); REGISTRY.bind(NodeHealth.IS_CURRENT_NODE_HEALTHY, "true"); }