Java Code Examples for org.apache.solr.client.solrj.response.CollectionAdminResponse#getErrorMessages()

The following examples show how to use org.apache.solr.client.solrj.response.CollectionAdminResponse#getErrorMessages() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestSolrCloudWithSecureImpersonation.java    From lucene-solr with Apache License 2.0 6 votes vote down vote up
private void create1ShardCollection(String name, String config, MiniSolrCloudCluster solrCluster) throws Exception {
  CollectionAdminResponse response;
  CollectionAdminRequest.Create create = new CollectionAdminRequest.Create(name,config,1,1,0,0) {
    @Override
    public SolrParams getParams() {
      ModifiableSolrParams msp = new ModifiableSolrParams(super.getParams());
      msp.set(USER_PARAM, "user");
      return msp;
    }
  };
  create.setMaxShardsPerNode(1);
  response = create.process(solrCluster.getSolrClient());

  miniCluster.waitForActiveCollection(name, 1, 1);
  
  if (response.getStatus() != 0 || response.getErrorMessages() != null) {
    fail("Could not create collection. Response" + response.toString());
  }
}
 
Example 2
Source File: TestLTROnSolrCloud.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
private void createCollection(String name, String config, int numShards, int numReplicas, int maxShardsPerNode)
    throws Exception {
  CollectionAdminResponse response;
  CollectionAdminRequest.Create create =
      CollectionAdminRequest.createCollection(name, config, numShards, numReplicas);
  create.setMaxShardsPerNode(maxShardsPerNode);
  response = create.process(solrCluster.getSolrClient());

  if (response.getStatus() != 0 || response.getErrorMessages() != null) {
    fail("Could not create collection. Response" + response.toString());
  }
  ZkStateReader zkStateReader = solrCluster.getSolrClient().getZkStateReader();
  solrCluster.waitForActiveCollection(name, numShards, numShards * numReplicas);
}
 
Example 3
Source File: TestRequestForwarding.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
private void createCollection(String name, String config) throws Exception {
  CollectionAdminResponse response;
  CollectionAdminRequest.Create create = CollectionAdminRequest.createCollection(name,config,2,1);
  create.setMaxShardsPerNode(1);
  response = create.process(solrCluster.getSolrClient());
  
  if (response.getStatus() != 0 || response.getErrorMessages() != null) {
    fail("Could not create collection. Response" + response.toString());
  }
  ZkStateReader zkStateReader = solrCluster.getSolrClient().getZkStateReader();
  solrCluster.waitForActiveCollection(name, 2, 2);
}