本文整理匯總了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));
}