gpt4 book ai didi

org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 13:02:56 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider.<init>()方法的一些代码示例,展示了ZkClientClusterStateProvider.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClientClusterStateProvider.<init>()方法的具体详情如下:
包路径:org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider
类名称:ZkClientClusterStateProvider
方法名:<init>

ZkClientClusterStateProvider.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apache.solr/solr-solrj

/**
 * Create a {@link CloudSolrClient} based on the provided configuration.
 */
public CloudSolrClient build() {
 if (stateProvider == null) {
  if (!zkHosts.isEmpty()) {
   stateProvider = new ZkClientClusterStateProvider(zkHosts, zkChroot);
  }
  else if (!this.solrUrls.isEmpty()) {
   try {
    stateProvider = new HttpClusterStateProvider(solrUrls, httpClient);
   } catch (Exception e) {
    throw new RuntimeException("Couldn't initialize a HttpClusterStateProvider (is/are the "
      + "Solr server(s), "  + solrUrls + ", down?)", e);
   }
  } else {
   throw new IllegalArgumentException("Both zkHosts and solrUrl cannot be null.");
  }
 }
 return new CloudSolrClient(this);
}

代码示例来源:origin: org.apache.solr/solr-solrj

this.stateProvider = new ZkClientClusterStateProvider(builder.zkHosts, builder.zkChroot);
} else if (builder.solrUrls != null && !builder.solrUrls.isEmpty()) {
 try {

代码示例来源:origin: edu.byu.hbll/solr

/**
 * Creates a SolrCloud collection if it doesn't already exist with the given config set.
 *
 * @deprecated since 1.2.0 use {@link SolrCollectionInitializer} instead.
 * @param zkHost host and optional port of one of a zookeeper instance (localhost:2181)
 * @param collectionName name of the collection to be created
 * @param configSetName name of the config set to use
 * @param configSetPath location of the config set (folder containing solr configs such as
 *     solrconfig.xml)
 * @throws IOException if something goes wrong with the upload
 * @throws SolrServerException if something goes wrong with the upload
 */
@Deprecated
public static void initSolr(
  String zkHost, String collectionName, String configSetName, Path configSetPath)
  throws IOException, SolrServerException {
 try (ZkClientClusterStateProvider provider = new ZkClientClusterStateProvider(zkHost)) {
  provider.uploadConfig(configSetPath, configSetName);
 }
 try (SolrClient solr = new CloudSolrClient.Builder().withZkHost(zkHost).build()) {
  List<String> existingCollectionNames = CollectionAdminRequest.listCollections(solr);
  if (!existingCollectionNames.contains(collectionName)) {
   solr.request(CollectionAdminRequest.createCollection(collectionName, configSetName, 1, 1));
  }
 }
}

代码示例来源:origin: edu.byu.hbll/solr

new ZkClientClusterStateProvider(zkHosts, chroot)) {
provider.uploadConfig(configsetPath, configsetName);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com