use of org.apache.solr.common.cloud.ZkNodeProps in project lucene-solr by apache.
the class DeleteShardTest method setSliceState.
protected void setSliceState(String collection, String slice, State state) throws SolrServerException, IOException, KeeperException, InterruptedException {
CloudSolrClient client = cluster.getSolrClient();
// TODO can this be encapsulated better somewhere?
DistributedQueue inQueue = Overseer.getStateUpdateQueue(client.getZkStateReader().getZkClient());
Map<String, Object> propMap = new HashMap<>();
propMap.put(Overseer.QUEUE_OPERATION, OverseerAction.UPDATESHARDSTATE.toLower());
propMap.put(slice, state.toString());
propMap.put(ZkStateReader.COLLECTION_PROP, collection);
ZkNodeProps m = new ZkNodeProps(propMap);
inQueue.offer(Utils.toJSON(m));
waitForState("Expected shard " + slice + " to be in state " + state.toString(), collection, (n, c) -> {
return c.getSlice(slice).getState() == state;
});
}
Aggregations