Java Code Examples for org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper#delete()
The following examples show how to use
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper#delete() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZkUtils.java From spliceengine with GNU Affero General Public License v3.0 | 6 votes |
/** * Deletes just the splice-specific paths in zookeeper. Does not delete hbase paths. */ public static void cleanZookeeper() throws InterruptedException, KeeperException{ RecoverableZooKeeper rzk=getRecoverableZooKeeper(); String rootPath=HConfiguration.getConfiguration().getSpliceRootPath(); for(String path : HConfiguration.zookeeperPaths){ path=rootPath+path; if(rzk.exists(path,false)!=null){ for(String child : rzk.getChildren(path,false)){ for(String grandChild : rzk.getChildren(path+"/"+child,false)){ rzk.delete(path+"/"+child+"/"+grandChild,-1); } rzk.delete(path+"/"+child,-1); } rzk.delete(path,-1); } } }
Example 2
Source File: ZkUtils.java From spliceengine with GNU Affero General Public License v3.0 | 5 votes |
public static boolean safeDelete(String path,int version, RecoverableZooKeeper rzk) throws KeeperException, InterruptedException{ try{ rzk.delete(path,version); return true; }catch(KeeperException e){ if(e.code()!=KeeperException.Code.NONODE) throw e; else return false; } }
Example 3
Source File: ZkUtils.java From spliceengine with GNU Affero General Public License v3.0 | 4 votes |
public static void delete(String path) throws InterruptedException, KeeperException{ RecoverableZooKeeper rzk=getRecoverableZooKeeper(); rzk.delete(path,-1); }
Example 4
Source File: ZkUtils.java From spliceengine with GNU Affero General Public License v3.0 | 4 votes |
public static void delete(String path, RecoverableZooKeeper rzk) throws InterruptedException, KeeperException{ rzk.delete(path,-1); }