Example usage for org.apache.solr.common.cloud SolrZkClient create

List of usage examples for org.apache.solr.common.cloud SolrZkClient create

Introduction

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

Prototype

public String create(final String path, final byte[] data, final CreateMode createMode, boolean retryOnConnLoss)
        throws KeeperException, InterruptedException 

Source Link

Document

Returns path of created node

Usage

From source file:com.doculibre.constellio.services.SolrServicesImpl.java

License:Open Source License

public static void writePlainConfigInCloud(String fileName, byte[] ouput) {
    try {//from w  w  w.  ja  va 2  s  .  c o  m
        SolrZkClient zkClient = SolrCoreContext.getSolrZkClient();
        if (!zkClient.exists(ZkController.CONFIGS_ZKNODE + "/" + fileName, true)) {
            zkClient.create(ZkController.CONFIGS_ZKNODE + "/" + fileName, ouput, CreateMode.PERSISTENT, true);
        } else {
            zkClient.setData(ZkController.CONFIGS_ZKNODE + "/" + fileName, ouput, true);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}