/** * Creates the path in ZooKeeper, creating each node as necessary. * * e.g. If <code>path=/solr/group/node</code> and none of the nodes, solr, * group, node exist, each will be created. * * @param data to set on the last zkNode */ public void makePath(String path, byte[] data, CreateMode createMode, Watcher watcher, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, data, createMode, watcher, true, retryOnConnLoss, 0); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * @param data to set on the last zkNode */ public void makePath(String path, byte[] data, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, data, CreateMode.PERSISTENT, retryOnConnLoss); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * e.g. If <code>path=/solr/group/node</code> and none of the nodes, solr, * group, node exist, each will be created. */ public void makePath(String path, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, null, CreateMode.PERSISTENT, retryOnConnLoss); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * e.g. If <code>path=/solr/group/node</code> and none of the nodes, solr, * group, node exist, each will be created. * * @param data to set on the last zkNode */ public void makePath(String path, byte[] data, CreateMode createMode, Watcher watcher, boolean failOnExists, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, data, createMode, watcher, failOnExists, retryOnConnLoss, 0); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * @param data to set on the last zkNode */ public void makePath(String path, byte[] data, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, data, CreateMode.PERSISTENT, retryOnConnLoss); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * e.g. If <code>path=/solr/group/node</code> and none of the nodes, solr, * group, node exist, each will be created. * * @param data to set on the last zkNode */ public void makePath(String path, byte[] data, CreateMode createMode, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, data, createMode, null, retryOnConnLoss); }
public void makePath(String path, CreateMode createMode, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, null, createMode, retryOnConnLoss); }
public void makePath(String zkPath, CreateMode createMode, Watcher watcher, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(zkPath, null, createMode, watcher, retryOnConnLoss); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * e.g. If <code>path=/solr/group/node</code> and none of the nodes, solr, * group, node exist, each will be created. */ public void makePath(String path, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, null, CreateMode.PERSISTENT, retryOnConnLoss); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * e.g. If <code>path=/solr/group/node</code> and none of the nodes, solr, * group, node exist, each will be created. * * @param data to set on the last zkNode */ public void makePath(String path, byte[] data, CreateMode createMode, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, data, createMode, null, retryOnConnLoss); }
/** * Creates the path in ZooKeeper, creating each node as necessary. * * e.g. If <code>path=/solr/group/node</code> and none of the nodes, solr, * group, node exist, each will be created. * * @param data to set on the last zkNode */ public void makePath(String path, byte[] data, CreateMode createMode, Watcher watcher, boolean retryOnConnLoss) throws KeeperException, InterruptedException { makePath(path, data, createMode, watcher, true, retryOnConnLoss); }
public void makePath(String path, File file, boolean failOnExists, boolean retryOnConnLoss) throws IOException, KeeperException, InterruptedException { makePath(path, FileUtils.readFileToByteArray(file), CreateMode.PERSISTENT, null, failOnExists, retryOnConnLoss, 0); }
public void makePath(String path, File file, boolean failOnExists, boolean retryOnConnLoss) throws IOException, KeeperException, InterruptedException { makePath(path, FileUtils.readFileToByteArray(file), CreateMode.PERSISTENT, null, failOnExists, retryOnConnLoss); }
@Override public void makePath(String path) throws AlreadyExistsException, IOException, KeeperException, InterruptedException { try { zkClient.makePath(path, true); } catch (KeeperException.NodeExistsException e) { throw new AlreadyExistsException(path); } catch (InterruptedException e) { throw e; } }
public void ensureExists(final String path, final byte[] data, CreateMode createMode, final SolrZkClient zkClient, int skipPathParts) throws KeeperException, InterruptedException { if (zkClient.exists(path, true)) { return; } try { zkClient.makePath(path, data, createMode, null, true, true, skipPathParts); } catch (NodeExistsException e) { // it's okay if another beats us creating the node } }
@Override public void makePath(String path, byte[] data, CreateMode createMode, boolean failOnExists) throws AlreadyExistsException, IOException, KeeperException, InterruptedException { try { zkClient.makePath(path, data, createMode, null, failOnExists, true); } catch (KeeperException.NodeExistsException e) { throw new AlreadyExistsException(path); } catch (InterruptedException e) { throw e; } }
public void ensureExists(final String path, final byte[] data, CreateMode createMode, final SolrZkClient zkClient) throws KeeperException, InterruptedException { if (zkClient.exists(path, true)) { return; } try { zkClient.makePath(path, data, createMode, true); } catch (NodeExistsException e) { // it's okay if another beats us creating the node } }
@Override public void visit(String path) throws InterruptedException, KeeperException { String finalDestination = dest; if (path.equals(source) == false) finalDestination += "/" + path.substring(source.length() + 1); zkClient.makePath(finalDestination, false, true); zkClient.setData(finalDestination, zkClient.getData(path, null, null, true), true); } }
public static void makeSolrZkNode(String zkHost) throws Exception { SolrZkClient zkClient = new SolrZkClient(zkHost, TIMEOUT); zkClient.makePath("/solr", false, true); zkClient.close(); }
public static void moveZnode(SolrZkClient zkClient, String src, String dst) throws SolrServerException, KeeperException, InterruptedException { String destName = normalizeDest(src, dst, true, true); // Special handling if the source has no children, i.e. copying just a single file. if (zkClient.getChildren(src, null, true).size() == 0) { zkClient.makePath(destName, false, true); zkClient.setData(destName, zkClient.getData(src, null, null, true), true); } else { traverseZkTree(zkClient, src, VISIT_ORDER.VISIT_PRE, new ZkCopier(zkClient, src, destName)); } // Insure all source znodes are present in dest before deleting the source. // throws error if not all there so the source is left intact. Throws error if source and dest don't match. checkAllZnodesThere(zkClient, src, destName); clean(zkClient, src); }