Package org.apache.helix

Examples of org.apache.helix.HelixManager.disconnect()


      e.printStackTrace();
    } finally
    {
      if (controllerManager != null)
      {
        controllerManager.disconnect();
      }
      for (Thread process : processArray)
      {
        if (process != null)
        {
View Full Code Here


        "Failed to update live instance node");

    instances = changeList.poll(1, TimeUnit.SECONDS);
    Assert.assertNotNull(instances, "Expecting a list of live instance");
    Assert.assertEquals(instances.get(0).getRecord().getMapField("test"), map, "Wrong map data.");
    manager.disconnect();
    Thread.sleep(1000); // wait for callback finish

    instances = changeList.poll(1, TimeUnit.SECONDS);
    Assert.assertNotNull(instances, "Expecting a list of live instance");
    Assert.assertTrue(instances.isEmpty(), "Expecting an empty list of live instance");
View Full Code Here

      Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
          System.out.println("Shutting down cluster manager: " + manager.getInstanceName());
          manager.disconnect();
        }
      });

      Thread.currentThread().join();
    } catch (Exception e) {
View Full Code Here

  }

  public void deregister(final String serviceId) {
    HelixManager helixManager = serviceMap.get(serviceId);
    if (helixManager != null && helixManager.isConnected()) {
      helixManager.disconnect();
    }
  }

  public boolean register(final String serviceId, final ServiceMetadata serviceMetadata)
      throws Exception {
View Full Code Here

      Thread.currentThread().join();
    } catch (Exception e) {
      LOG.error(e);
    } finally {
      if (manager != null && manager.isConnected()) {
        manager.disconnect();
      }
    }
  }
}
View Full Code Here

      Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
          System.out.println("Shutting down cluster manager: " + manager.getInstanceName());
          manager.disconnect();
        }
      });

      Thread.currentThread().join();
    } catch (Exception e) {
View Full Code Here

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } finally {
      if (manager != null) {
        manager.disconnect();
      }
    }
  }
}
View Full Code Here

            _testResults.put(_command, true);
            break;
          } else if (_command._commandType == CommandType.STOP) {
            // TODO add data trigger for STOP command
            HelixManager manager = _command._nodeOpArg._manager;
            manager.disconnect();
            Thread thread = _command._nodeOpArg._thread;
            thread.interrupt();

            // System.err.println("stop " +
            // _command._nodeOpArg._manager.getInstanceName());
View Full Code Here

      Thread.currentThread().join();
    } catch (InterruptedException e) {
      logger.info("controller:" + controllerName + ", " + Thread.currentThread().getName()
          + " interrupted");
    } finally {
      manager.disconnect();
      ZKPropertyTransferServer.getInstance().shutdown();
    }

  }
}
View Full Code Here

      Thread.currentThread().join();
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (controllerManager != null) {
        controllerManager.disconnect();
      }
      for (Thread process : processArray) {
        if (process != null) {
          process.interrupt();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.