当前位置: 首页>>代码示例>>Java>>正文


Java CollectionAdminResponse.isSuccess方法代码示例

本文整理汇总了Java中org.apache.solr.client.solrj.response.CollectionAdminResponse.isSuccess方法的典型用法代码示例。如果您正苦于以下问题:Java CollectionAdminResponse.isSuccess方法的具体用法?Java CollectionAdminResponse.isSuccess怎么用?Java CollectionAdminResponse.isSuccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.solr.client.solrj.response.CollectionAdminResponse的用法示例。


在下文中一共展示了CollectionAdminResponse.isSuccess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCollectionIfNotExists

import org.apache.solr.client.solrj.response.CollectionAdminResponse; //导入方法依赖的package包/类
private static void createCollectionIfNotExists(CloudSolrClient client, Configuration config, String collection)
        throws IOException, SolrServerException, KeeperException, InterruptedException {
    if (!checkIfCollectionExists(client, collection)) {
        Integer numShards = config.get(NUM_SHARDS);
        Integer maxShardsPerNode = config.get(MAX_SHARDS_PER_NODE);
        Integer replicationFactor = config.get(REPLICATION_FACTOR);

        CollectionAdminRequest.Create createRequest = new CollectionAdminRequest.Create();

        createRequest.setConfigName(collection);
        createRequest.setCollectionName(collection);
        createRequest.setNumShards(numShards);
        createRequest.setMaxShardsPerNode(maxShardsPerNode);
        createRequest.setReplicationFactor(replicationFactor);

        CollectionAdminResponse createResponse = createRequest.process(client);
        if (createResponse.isSuccess()) {
            logger.trace("Collection {} successfully created.", collection);
        } else {
            throw new SolrServerException(Joiner.on("\n").join(createResponse.getErrorMessages()));
        }
    }

    waitForRecoveriesToFinish(client, collection);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:26,代码来源:Solr5Index.java

示例2: createCollectionIfNotExists

import org.apache.solr.client.solrj.response.CollectionAdminResponse; //导入方法依赖的package包/类
private static void createCollectionIfNotExists(CloudSolrServer server, Configuration config, String collection)
        throws IOException, SolrServerException, KeeperException, InterruptedException {
    if (!checkIfCollectionExists(server, collection)) {
        Integer numShards = config.get(NUM_SHARDS);
        Integer maxShardsPerNode = config.get(MAX_SHARDS_PER_NODE);
        Integer replicationFactor = config.get(REPLICATION_FACTOR);

        CollectionAdminRequest.Create createRequest = new CollectionAdminRequest.Create();

        createRequest.setConfigName(collection);
        createRequest.setCollectionName(collection);
        createRequest.setNumShards(numShards);
        createRequest.setMaxShardsPerNode(maxShardsPerNode);
        createRequest.setReplicationFactor(replicationFactor);

        CollectionAdminResponse createResponse = createRequest.process(server);
        if (createResponse.isSuccess()) {
            logger.trace("Collection {} successfully created.", collection);
        } else {
            throw new SolrServerException(Joiner.on("\n").join(createResponse.getErrorMessages()));
        }
    }

    waitForRecoveriesToFinish(server, collection);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:26,代码来源:SolrIndex.java

示例3: createCollectionIfNotExists

import org.apache.solr.client.solrj.response.CollectionAdminResponse; //导入方法依赖的package包/类
private static void createCollectionIfNotExists(CloudSolrClient client, Configuration config, String collection)
        throws IOException, SolrServerException, KeeperException, InterruptedException {
    if (!checkIfCollectionExists(client, collection)) {
        Integer numShards = config.get(NUM_SHARDS);
        Integer maxShardsPerNode = config.get(MAX_SHARDS_PER_NODE);
        Integer replicationFactor = config.get(REPLICATION_FACTOR);


        // Ideally this property used so a new configset is not uploaded for every single
        // index (collection) created in solr.
        // if a generic configSet is not set, make the configset name the same as the collection.
        // This was the default behavior before a default configSet could be specified 
        String  genericConfigSet = config.has(SOLR_DEFAULT_CONFIG) ? config.get(SOLR_DEFAULT_CONFIG):collection;

        CollectionAdminRequest.Create createRequest = new CollectionAdminRequest.Create();

        createRequest.setConfigName(genericConfigSet);
        createRequest.setCollectionName(collection);
        createRequest.setNumShards(numShards);
        createRequest.setMaxShardsPerNode(maxShardsPerNode);
        createRequest.setReplicationFactor(replicationFactor);

        CollectionAdminResponse createResponse = createRequest.process(client);
        if (createResponse.isSuccess()) {
            logger.trace("Collection {} successfully created.", collection);
        } else {
            throw new SolrServerException(Joiner.on("\n").join(createResponse.getErrorMessages()));
        }
    }

    waitForRecoveriesToFinish(client, collection);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:33,代码来源:SolrIndex.java


注:本文中的org.apache.solr.client.solrj.response.CollectionAdminResponse.isSuccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。