public void close() { this.closed = true; if (closeClient) { zkClient.close(); } }
public void close() { this.closed = true; notifications.shutdown(); ExecutorUtil.shutdownAndAwaitTermination(collectionPropsNotifications); if (closeClient) { zkClient.close(); } }
protected void printLayout(String zkHost) throws Exception { SolrZkClient zkClient = new SolrZkClient(zkHost, AbstractZkTestCase.TIMEOUT); zkClient.printLayoutToStdOut(); zkClient.close(); }
public static void makeSolrZkNode(String zkHost) throws Exception { SolrZkClient zkClient = new SolrZkClient(zkHost, TIMEOUT); zkClient.makePath("/solr", false, true); zkClient.close(); }
/** * Utility method to upload a Solr config into ZooKeeper. If you don't have the config in the form of * a filesystem directory, you might want to use {@link #uploadConfig(String, byte[], byte[])}. */ public void uploadConfig(String confName, File confDir) throws IOException { SolrZkClient zkClient = new SolrZkClient(zkConnectString, 30000, 30000, new OnReconnect() { @Override public void command() { } }); new ZkConfigManager(zkClient).uploadConfigDir(confDir.toPath(), confName); zkClient.close(); }
protected void printLayout() throws Exception { SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT); zkClient.printLayoutToStdOut(); zkClient.close(); }
/** * Utility method to upload a Solr config into ZooKeeper. If you don't have the config in the form of * a filesystem directory, you might want to use {@link #uploadConfig(String, byte[], byte[])}. */ public void uploadConfig(String confName, File confDir) throws IOException { SolrZkClient zkClient = new SolrZkClient(zkConnectString, 30000, 30000, new OnReconnect() { @Override public void command() { } }); new ZkConfigManager(zkClient).uploadConfigDir(confDir.toPath(), confName); zkClient.close(); }
static void tryCleanPath(String zkHost, String path) throws Exception { SolrZkClient zkClient = new SolrZkClient(zkHost, TIMEOUT); if (zkClient.exists(path, true)) { zkClient.clean(path); } zkClient.close(); } }
public DocCollection extractDocCollection(String zkHost, String collection) { if (collection == null) { throw new IllegalArgumentException("collection must not be null"); } SolrZkClient zkClient = getZkClient(zkHost); try { ZkStateReader zkStateReader = new ZkStateReader(zkClient); try { // first check for alias collection = checkForAlias(zkClient, collection); zkStateReader.createClusterStateWatchersAndUpdate(); } catch (Exception e) { throw new IllegalArgumentException("Cannot find expected information for SolrCloud in ZooKeeper: " + zkHost, e); } try { return zkStateReader.getClusterState().getCollection(collection); } catch (SolrException e) { throw new IllegalArgumentException("Cannot find collection '" + collection + "' in ZooKeeper: " + zkHost, e); } } finally { zkClient.close(); } }
public DocCollection extractDocCollection(String zkHost, String collection) { if (collection == null) { throw new IllegalArgumentException("collection must not be null"); } SolrZkClient zkClient = getZkClient(zkHost); try (ZkStateReader zkStateReader = new ZkStateReader(zkClient)) { try { // first check for alias collection = checkForAlias(zkClient, collection); zkStateReader.createClusterStateWatchersAndUpdate(); } catch (Exception e) { throw new IllegalArgumentException("Cannot find expected information for SolrCloud in ZooKeeper: " + zkHost, e); } try { return zkStateReader.getClusterState().getCollection(collection); } catch (SolrException e) { throw new IllegalArgumentException("Cannot find collection '" + collection + "' in ZooKeeper: " + zkHost, e); } } finally { zkClient.close(); } }
options.solrHomeDir = tmpSolrHomeDir; } finally { zkClient.close();
options.solrHomeDir = tmpSolrHomeDir; } finally { zkClient.close();
options.solrHomeDir = tmpSolrHomeDir; } finally { zkClient.close();
throw new MorphlineCompilationException("Cannot download schema.xml from ZooKeeper", config, e); } finally { zkClient.close();
throw new MorphlineCompilationException("Cannot download schema.xml from ZooKeeper", config, e); } finally { zkClient.close();
throw new MorphlineCompilationException("Cannot download schema.xml from ZooKeeper", config, e); } finally { zkClient.close();
throw new MorphlineCompilationException("Cannot download schema.xml from ZooKeeper", config, e); } finally { zkClient.close();
SolrZkClient zkClient = new SolrZkClient(zkHost, AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); zkClient.makePath("/solr", false, true); zkClient.close(); putConfig("conf1", zkClient, solrhome, "old_synonyms.txt"); putConfig("conf1", zkClient, solrhome, "synonyms.txt"); zkClient.close();