Examples of LockWatcher


Examples of org.apache.accumulo.server.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!");
      }
     
      @Override
View Full Code Here

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

    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

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

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