Example usage for org.apache.solr.common.cloud ZkNodeProps ZkNodeProps

List of usage examples for org.apache.solr.common.cloud ZkNodeProps ZkNodeProps

Introduction

In this page you can find the example usage for org.apache.solr.common.cloud ZkNodeProps ZkNodeProps.

Prototype

public ZkNodeProps(String... keyVals) 

Source Link

Document

Constructor that populates the from array of Strings in form key1, value1, key2, value2, ..., keyN, valueN

Usage

From source file:org.apache.camel.component.solr.SolrCloudFixture.java

License:Apache License

public void buildZooKeeper(String zkHost, String zkAddress, File solrhome, String config, String schema)
        throws Exception {
    zkClient = new SolrZkClient(zkAddress, 60000);

    Map<String, Object> props = new HashMap<String, Object>();
    props.put("configName", "conf1");
    final ZkNodeProps zkProps = new ZkNodeProps(props);

    // zkClient.makePath("/collections/collection1",
    // ZkStateReader.toJSON(zkProps), CreateMode.PERSISTENT, true);
    // zkClient.makePath("/collections/collection1/shards",
    // CreateMode.PERSISTENT, true);
    // zkClient.makePath("/collections/control_collection",
    // ZkStateReader.toJSON(zkProps), CreateMode.PERSISTENT, true);
    // zkClient.makePath("/collections/control_collection/shards",
    // CreateMode.PERSISTENT, true);

    // for now, always upload the config and schema to the canonical names
    putConfig("conf1", zkClient, solrhome, config, "solrconfig.xml");
    putConfig("conf1", zkClient, solrhome, schema, "schema.xml");

    // putConfig("conf1", zkClient, solrhome,
    // "solrconfig.snippet.randomindexconfig.xml");
    putConfig("conf1", zkClient, solrhome, "stopwords.txt");
    putConfig("conf1", zkClient, solrhome, "stopwords_en.txt");
    putConfig("conf1", zkClient, solrhome, "protwords.txt");
    putConfig("conf1", zkClient, solrhome, "currency.xml");
    putConfig("conf1", zkClient, solrhome, "enumsConfig.xml");
    putConfig("conf1", zkClient, solrhome, "open-exchange-rates.json");
    putConfig("conf1", zkClient, solrhome, "mapping-ISOLatin1Accent.txt");
    putConfig("conf1", zkClient, solrhome, "old_synonyms.txt");
    putConfig("conf1", zkClient, solrhome, "synonyms.txt");
    putConfig("conf1", zkClient, solrhome, "elevate.xml");
    zkClient.close();/*from   w w w.j a  v a  2s .  c o  m*/
}