Package org.apache.accumulo.core.zookeeper.ZooLock

Examples of org.apache.accumulo.core.zookeeper.ZooLock.LockWatcher


 
  private void getZooLock(InetSocketAddress addr) throws KeeperException, InterruptedException {
    String address = addr.getHostName() + ":" + addr.getPort();
    String path = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZGC_LOCK;
   
    LockWatcher lockWatcher = new LockWatcher() {
      public void lostLock(LockLossReason reason) {
        Halt.halt("GC lock in zookeeper lost (reason = " + reason + "), exiting!");
      }
    };
   
View Full Code Here


     
      ZooUtil.putPersistentData(zPath, new byte[] {}, NodeExistsPolicy.SKIP);
     
      tabletServerLock = new ZooLock(zPath);
     
      LockWatcher lw = new LockWatcher() {
       
        @Override
        public void lostLock(final LockLossReason reason) {
          Halt.halt(0, new Runnable() {
            public void run() {
View Full Code Here

    return tserverCount;
  }
 
  private void getMasterLock(final String zMasterLoc) throws KeeperException, InterruptedException {
    log.info("trying to get master lock");
    LockWatcher masterLockWatcher = new ZooLock.LockWatcher() {
      public void lostLock(LockLossReason reason) {
        Halt.halt("Master lock in zookeeper lost (reason = " + reason + "), exiting!", -1);
      }
    };
    long current = System.currentTimeMillis();
View Full Code Here

     
      ZooUtil.putPersistentData(zPath, new byte[] {}, NodeExistsPolicy.SKIP);
     
      tabletServerLock = new ZooLock(zPath);
     
      LockWatcher lw = new LockWatcher() {
       
        @Override
        public void lostLock(final LockLossReason reason) {
          Halt.halt(0, new Runnable() {
            public void run() {
View Full Code Here

  @Override
  public void run() throws Exception {
    String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + "/testLock";
    ZooSession.getSession().create(zPath, "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    ZooLock zl = new ZooLock(zPath);
    boolean gotLock = zl.tryLock(new LockWatcher() {
     
      @Override
      public void lostLock(LockLossReason reason) {
        System.exit(-1);
       
View Full Code Here

 
  private void getZooLock(InetSocketAddress addr) throws KeeperException, InterruptedException {
    String address = addr.getHostName() + ":" + addr.getPort();
    String path = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZGC_LOCK;
   
    LockWatcher lockWatcher = new LockWatcher() {
      public void lostLock(LockLossReason reason) {
        Halt.halt("GC lock in zookeeper lost (reason = " + reason + "), exiting!");
      }
    };
   
View Full Code Here

    return tserverCount;
  }
 
  private void getMasterLock(final String zMasterLoc) throws KeeperException, InterruptedException {
    log.info("trying to get master lock");
    LockWatcher masterLockWatcher = new ZooLock.LockWatcher() {
      public void lostLock(LockLossReason reason) {
        Halt.halt("Master lock in zookeeper lost (reason = " + reason + "), exiting!", -1);
      }
    };
    long current = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.zookeeper.ZooLock.LockWatcher

Copyright © 2018 www.massapicom. 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.