Package org.apache.accumulo.server.zookeeper

Examples of org.apache.accumulo.server.zookeeper.IZooReaderWriter.recursiveDelete()


          String[] parts = entry.split("/");
          String zpath = root + "/" + parts[1];
          while (true) {
            try {
              if (zk.exists(zpath)) {
                zk.recursiveDelete(zpath, NodeMissingPolicy.SKIP);
                foundEntry = true;
              }
              break;
            } catch (KeeperException e) {
              log.error(e, e);
View Full Code Here


        String root = getZookeeperLogLocation();
        while (true) {
          try {
            IZooReaderWriter zoo = ZooReaderWriter.getInstance();
            if (zoo.isLockHeld(zooLock.getLockID()))
              zoo.recursiveDelete(root + "/" + entry.filename, NodeMissingPolicy.SKIP);
            break;
          } catch (Exception e) {
            log.error(e, e);
          }
          UtilWaitThread.sleep(1000);
View Full Code Here

    uuids.remove("instances");
    for (String name : args) {
      if (instances.contains(args[0])) {
        String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + name;
        byte[] data = zk.getData(path, null);
        zk.recursiveDelete(path, NodeMissingPolicy.SKIP);
        zk.recursiveDelete(Constants.ZROOT + "/" + new String(data), NodeMissingPolicy.SKIP);
      } else if (uuids.contains(name)) {
        // look for the real instance name
        for (String instance : instances) {
          String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + instance;
View Full Code Here

    for (String name : args) {
      if (instances.contains(args[0])) {
        String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + name;
        byte[] data = zk.getData(path, null);
        zk.recursiveDelete(path, NodeMissingPolicy.SKIP);
        zk.recursiveDelete(Constants.ZROOT + "/" + new String(data), NodeMissingPolicy.SKIP);
      } else if (uuids.contains(name)) {
        // look for the real instance name
        for (String instance : instances) {
          String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + instance;
          byte[] data = zk.getData(path, null);
View Full Code Here

        // look for the real instance name
        for (String instance : instances) {
          String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + instance;
          byte[] data = zk.getData(path, null);
          if (name.equals(new String(data)))
            zk.recursiveDelete(path, NodeMissingPolicy.SKIP);
        }
        zk.recursiveDelete(Constants.ZROOT + "/" + name, NodeMissingPolicy.SKIP);
      }
    }
  }
View Full Code Here

          String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + instance;
          byte[] data = zk.getData(path, null);
          if (name.equals(new String(data)))
            zk.recursiveDelete(path, NodeMissingPolicy.SKIP);
        }
        zk.recursiveDelete(Constants.ZROOT + "/" + name, NodeMissingPolicy.SKIP);
      }
    }
  }
 
}
View Full Code Here

    try {
      log.debug("Removing " + path);
      path = relative(path);
      IZooReaderWriter zoo = ZooReaderWriter.getInstance();
      if (zoo.exists(path))
        zoo.recursiveDelete(path, NodeMissingPolicy.SKIP);
      cache.clear();
    } catch (Exception ex) {
      throw new DistributedStoreException(ex);
    }
  }
View Full Code Here

      // remove old settings from zookeeper first, if any
      IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
      synchronized (zooCache) {
        zooCache.clear();
        if (zoo.exists(ZKUserPath)) {
          zoo.recursiveDelete(ZKUserPath, NodeMissingPolicy.SKIP);
          log.info("Removed " + ZKUserPath + "/" + " from zookeeper");
        }
       
        // prep parent node of users with root username
        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(), NodeExistsPolicy.FAIL);
View Full Code Here

      try {
        if (tablePerms.remove(permission)) {
          zooCache.clear();
          IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
          if (tablePerms.size() == 0)
            zoo.recursiveDelete(ZKUserPath + "/" + user + ZKUserTablePerms + "/" + table, NodeMissingPolicy.SKIP);
          else
            zoo.putPersistentData(ZKUserPath + "/" + user + ZKUserTablePerms + "/" + table, Tool.convertTablePermissions(tablePerms),
                NodeExistsPolicy.OVERWRITE);
        }
      } catch (KeeperException e) {
View Full Code Here

    try {
      synchronized (zooCache) {
        zooCache.clear();
        IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
        for (String user : zooCache.getChildren(ZKUserPath))
          zoo.recursiveDelete(ZKUserPath + "/" + user + ZKUserTablePerms + "/" + table, NodeMissingPolicy.SKIP);
      }
    } catch (KeeperException e) {
      log.error(e, e);
      throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.CONNECTION_ERROR, e);
    } catch (InterruptedException e) {
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.