Exemplo n.º 1
0
 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");
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public static void setUnHealthy() {
   LOG.warn("Node status is unhealthy.");
   REGISTRY.bind(NodeHealth.IS_CURRENT_NODE_HEALTHY, "false");
 }
Exemplo n.º 4
0
 public static void setHealthy() {
   LOG.debug("Node status is healthy.");
   REGISTRY.bind(NodeHealth.IS_CURRENT_NODE_HEALTHY, "true");
 }