mirror of https://github.com/apache/lucene.git
tests: get leader to base clase
This commit is contained in:
parent
a342d6bba6
commit
38a66f5452
|
@ -830,6 +830,15 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
|
||||||
controlClient.add(doc);
|
controlClient.add(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected ZkCoreNodeProps getLeaderUrlFromZk(String collection, String slice) {
|
||||||
|
ClusterState clusterState = getCommonCloudSolrClient().getZkStateReader().getClusterState();
|
||||||
|
ZkNodeProps leader = clusterState.getLeader(collection, slice);
|
||||||
|
if (leader == null) {
|
||||||
|
throw new RuntimeException("Could not find leader:" + collection + " " + slice);
|
||||||
|
}
|
||||||
|
return new ZkCoreNodeProps(leader);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void del(String q) throws Exception {
|
protected void del(String q) throws Exception {
|
||||||
controlClient.deleteByQuery(q);
|
controlClient.deleteByQuery(q);
|
||||||
|
|
Loading…
Reference in New Issue