本文整理汇总了Java中org.apache.solr.client.solrj.impl.HttpSolrServer.RemoteSolrException类的典型用法代码示例。如果您正苦于以下问题:Java RemoteSolrException类的具体用法?Java RemoteSolrException怎么用?Java RemoteSolrException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RemoteSolrException类属于org.apache.solr.client.solrj.impl.HttpSolrServer包,在下文中一共展示了RemoteSolrException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteCollectionRemovesStaleZkCollectionsNode
import org.apache.solr.client.solrj.impl.HttpSolrServer.RemoteSolrException; //导入依赖的package包/类
private void deleteCollectionRemovesStaleZkCollectionsNode() throws Exception {
// we can use this client because we just want base url
final String baseUrl = getBaseUrl((HttpSolrServer) clients.get(0));
String collectionName = "out_of_sync_collection";
List<Integer> numShardsNumReplicaList = new ArrayList<>();
numShardsNumReplicaList.add(2);
numShardsNumReplicaList.add(1);
cloudClient.getZkStateReader().getZkClient().makePath(ZkStateReader.COLLECTIONS_ZKNODE + "/" + collectionName, true);
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("action", CollectionAction.DELETE.toString());
params.set("name", collectionName);
QueryRequest request = new QueryRequest(params);
request.setPath("/admin/collections");
try {
NamedList<Object> resp = createNewSolrServer("", baseUrl)
.request(request);
fail("Expected to fail, because collection is not in clusterstate");
} catch (RemoteSolrException e) {
}
checkForMissingCollection(collectionName);
assertFalse(cloudClient.getZkStateReader().getZkClient().exists(ZkStateReader.COLLECTIONS_ZKNODE + "/" + collectionName, true));
}