@Override public Void run() throws KeeperException, InterruptedException { ZKUtil.deleteRecursive(zkClient, znodeWorkingDir); return null; } });
@Override public boolean exec() throws CliException { printDeprecatedWarning(); String path = args[1]; try { ZKUtil.deleteRecursive(zk, path); } catch (IllegalArgumentException ex) { throw new MalformedPathException(ex.getMessage()); } catch (KeeperException|InterruptedException ex) { throw new CliWrapperException(ex); } return false; }
try { LOG.info("Delete the path associated with the log {}, ZK Path {}", name, zkPath); ZKUtil.deleteRecursive(writerZKC.get(), zkPath); } catch (InterruptedException ie) { LOG.error("Interrupted while accessing ZK", ie);
@Override public void onComponentRemoved(final String componentId) throws IOException { try { ZKUtil.deleteRecursive(getZooKeeper(), getComponentPath(componentId)); } catch (final KeeperException ke) { // Node doesn't exist so just ignore final Code exceptionCode = ke.code(); if (Code.NONODE == exceptionCode) { return; } if (Code.SESSIONEXPIRED == exceptionCode) { invalidateClient(); onComponentRemoved(componentId); return; } throw new IOException("Unable to remove state for component with ID '" + componentId + " with exception code " + exceptionCode, ke); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException("Failed to remove state for component with ID '" + componentId + "' from ZooKeeper due to being interrupted", e); } }
public void deleteLog() throws IOException { lock.checkOwnershipAndReacquire(); FutureUtils.result(purgeLogSegmentsOlderThanTxnId(-1)); try { Utils.closeQuietly(lock); zooKeeperClient.get().exists(logMetadata.getLogSegmentsPath(), false); zooKeeperClient.get().exists(logMetadata.getMaxTxIdPath(), false); if (logMetadata.getLogRootPath().toLowerCase().contains("distributedlog")) { ZKUtil.deleteRecursive(zooKeeperClient.get(), logMetadata.getLogRootPath()); } else { LOG.warn("Skip deletion of unrecognized ZK Path {}", logMetadata.getLogRootPath()); } } catch (InterruptedException ie) { LOG.error("Interrupted while deleting log znodes", ie); throw new DLInterruptedException("Interrupted while deleting " + logMetadata.getLogRootPath(), ie); } catch (KeeperException ke) { LOG.error("Error deleting" + logMetadata.getLogRootPath() + " in zookeeper", ke); } }
ZKUtil.deleteRecursive(zk, "/a", cb, ctx); synchronized (ctx) { ctx.wait();
} else if (cmd.equals("rmr") && args.length >= 2) { path = args[1]; ZKUtil.deleteRecursive(zk, path); } else if (cmd.equals("set") && args.length >= 3) { path = args[1];
@Override public Void run() throws KeeperException, InterruptedException { ZKUtil.deleteRecursive(zkClient, znodeWorkingDir); return null; } });
@Override public Void run() throws KeeperException, InterruptedException { ZKUtil.deleteRecursive(zkClient, znodeWorkingDir); return null; } });
@Override public Void run() throws KeeperException, InterruptedException { ZKUtil.deleteRecursive(zkClient, znodeWorkingDir); return null; } });
@Override public Void run() throws KeeperException, InterruptedException { ZKUtil.deleteRecursive(zkClient, znodeWorkingDir); return null; } });
@Override public void init(Map<String, String> conf, InetAddress selfAddress) throws Exception { zkRoot = conf.getOrDefault(LINEA_ZK_ROOT, DEFAULT_ZK_ROOT); zkConnectionString = conf.getOrDefault(LINEA_ZK_CONNECTION_STRING, DEFAULT_ZK_CONNECTION_STRNG); try { zk = new ZooKeeper(zkConnectionString, 60000, this); logger.info("Connected to zookeeper using connection string:" + zkConnectionString); } catch (IOException e) { throw new RuntimeException(e); } if (autoResetZk) { Stat exists = zk.exists(zkRoot, false); if (exists != null) { ZKUtil.deleteRecursive(zk, zkRoot); } } Stat exists = zk.exists(zkRoot, false); if (exists == null) { logger.info("Missing ZkRoot, creating it:" + zkRoot); zk.create(zkRoot, null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } }
ZKUtil.deleteRecursive(zk, ZkLedgerUnderreplicationManager.getBasePath(ledgersRootPath) + BookKeeperConstants.DEFAULT_ZK_LEDGERS_ROOT_PATH); } catch (KeeperException.NoNodeException e) { ZKUtil.deleteRecursive(zk, ZkLedgerUnderreplicationManager.getBasePath(ledgersRootPath) + '/' + BookKeeperConstants.UNDER_REPLICATION_LOCK); } catch (KeeperException.NoNodeException e) { ZKUtil.deleteRecursive(zk, cookiePath); } catch (KeeperException.NoNodeException e) { if (log.isDebugEnabled()) {
try { String recursiveDeletePath = ZKPaths.makePath(curatorClient.getNamespace(), path); ZKUtil.deleteRecursive(curatorClient.getZookeeperClient().getZooKeeper(), recursiveDeletePath); } catch (Exception e) { log.trace("Problem deleting " + path + " (this may be ok): " + e.getMessage(), e);
/** * Sends an eviction message for {@code messagePath} to all other shared cache coordinators that are listening. */ public void sendEvictMessage(String messagePath) throws Exception { ArgumentChecker.notNull(messagePath); String rootPath = ZKPaths.makePath("/", "evictions"); String evictMessagePath = ZKPaths.makePath(rootPath, ZKPaths.makePath(messagePath, localName)); Stat nodeData = curatorClient.checkExists().forPath(evictMessagePath); boolean shouldCreate = true; if (nodeData != null) { long delta = System.currentTimeMillis() - nodeData.getCtime(); if (delta > EVICT_MESSAGE_TIMEOUT) { log.debug("Attempting to delete " + evictMessagePath + " since it was created " + delta + "ms ago and hasn't been cleaned up."); ZKUtil.deleteRecursive(curatorClient.getZookeeperClient().getZooKeeper(), evictMessagePath); } else { shouldCreate = false; } } if (shouldCreate) curatorClient.create().creatingParentsIfNeeded().forPath(evictMessagePath); }
for (String ledgersRootPathChildren : ledgersRootPathChildrenList) { if (MsLedgerManager.isSpecialZnode(ledgersRootPathChildren)) { ZKUtil.deleteRecursive(zk, zkLedgersRootPath + "/" + ledgersRootPathChildren); } else { log.error("Found unexpected znode : {} under ledgersRootPath : {} so exiting nuke operation",
for (String ledgersRootPathChildren : ledgersRootPathChildrenList) { if (AbstractZkLedgerManager.isSpecialZnode(ledgersRootPathChildren)) { ZKUtil.deleteRecursive(zk, zkLedgersRootPath + "/" + ledgersRootPathChildren); } else { log.error("Found unexpected znode : {} under ledgersRootPath : {} so exiting nuke operation",
@SuppressWarnings("deprecation") @Override public void format(AbstractConfiguration<?> conf, LayoutManager layoutManager) throws InterruptedException, KeeperException, IOException { try (AbstractZkLedgerManager ledgerManager = (AbstractZkLedgerManager) newLedgerManager()) { String ledgersRootPath = ZKMetadataDriverBase.resolveZkLedgersRootPath(conf); List<String> children = zk.getChildren(ledgersRootPath, false); for (String child : children) { if (!AbstractZkLedgerManager.isSpecialZnode(child) && ledgerManager.isLedgerParentNode(child)) { ZKUtil.deleteRecursive(zk, ledgersRootPath + "/" + child); } } } Class<? extends LedgerManagerFactory> factoryClass; try { factoryClass = conf.getLedgerManagerFactoryClass(); } catch (ConfigurationException e) { throw new IOException("Failed to get ledger manager factory class from configuration : ", e); } layoutManager.deleteLedgerLayout(); // Create new layout information again. createNewLMFactory(conf, layoutManager, factoryClass); }
try { String streamPath = LogMetadata.getLogStreamPath(uri, logName); ZKUtil.deleteRecursive(zooKeeperClient.get(), streamPath, new AsyncCallback.VoidCallback() { @Override public void processResult(int rc, String path, Object ctx) {