tests: get leader to base clase

This commit is contained in:
markrmiller 2016-12-12 10:56:51 -05:00
parent a342d6bba6
commit 38a66f5452
1 changed files with 9 additions and 0 deletions

View File

@ -829,6 +829,15 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
// add to control second in case adding to shards fails
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
protected void del(String q) throws Exception {