Package org.apache.accumulo.server.zookeeper.ZooLock

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


    // Before we try anything, check to see if we can read users/root out of Zookeeper, as it should be guaranteed to exist and ACLed
    // This is to ensure we have the right secret before we can muck around with anything
    ZooReaderWriter.validateSecret();
   
    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);
      }
     
      @Override
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!");
      }
     
      @Override
View Full Code Here

      zoo.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() {
            @Override
View Full Code Here

     
      zoo.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 masterLock;
  }
 
  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);
      }
     
      @Override
View Full Code Here

    return masterLock;
  }
 
  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

    ZooReaderWriter zoo = ZooReaderWriter.getInstance();
    zoo.putPersistentData(zPath, new byte[] {}, NodeExistsPolicy.SKIP);
   
    ZooLock zlock = new ZooLock(zPath);
   
    LockWatcher lw = new LockWatcher() {
      @Override
      public void lostLock(final LockLossReason reason) {
        try {
          tch.halt(null, null, null);
        } catch (Exception ex) {
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

     
      zoo.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

  public void run() throws Exception {
    String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + "/testLock";
    IZooReaderWriter zoo = ZooReaderWriter.getInstance();
    zoo.putPersistentData(zPath, "".getBytes(), NodeExistsPolicy.OVERWRITE);
    ZooLock zl = new ZooLock(zPath);
    boolean gotLock = zl.tryLock(new LockWatcher() {
     
      @Override
      public void lostLock(LockLossReason reason) {
        System.exit(-1);
       
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.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.