mirror of https://github.com/apache/lucene.git
SOLR-5437
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1541404 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a595d71cec
commit
80ad858997
|
@ -124,18 +124,23 @@ public class DeleteReplicaTest extends AbstractFullDistribZkTestBase {
|
||||||
CloudSolrServer client = createCloudClient(null);
|
CloudSolrServer client = createCloudClient(null);
|
||||||
createColl(COLL_NAME, client);
|
createColl(COLL_NAME, client);
|
||||||
DocCollection testcoll = getCommonCloudSolrServer().getZkStateReader().getClusterState().getCollection(COLL_NAME);
|
DocCollection testcoll = getCommonCloudSolrServer().getZkStateReader().getClusterState().getCollection(COLL_NAME);
|
||||||
final Slice shard1 = testcoll.getSlices().iterator().next();
|
|
||||||
if(!shard1.getState().equals(Slice.ACTIVE)) fail("shard is not active");
|
|
||||||
boolean found = false;
|
|
||||||
Replica replica1 = null;
|
|
||||||
for (Replica replica : shard1.getReplicas()) if("active".equals(replica.getStr("state"))) replica1 =replica;
|
|
||||||
|
|
||||||
|
Slice shard1 = null;
|
||||||
|
Replica replica1 = null;
|
||||||
|
for (Slice slice : testcoll.getSlices()) {
|
||||||
|
if("active".equals( slice.getStr("state"))){
|
||||||
|
shard1 = slice;
|
||||||
|
for (Replica replica : shard1.getReplicas()) if("active".equals(replica.getStr("state"))) replica1 =replica;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// final Slice shard1 = testcoll.getSlices().iterator().next();
|
||||||
|
// if(!shard1.getState().equals(Slice.ACTIVE)) fail("shard is not active");
|
||||||
|
// for (Replica replica : shard1.getReplicas()) if("active".equals(replica.getStr("state"))) replica1 =replica;
|
||||||
if(replica1 == null) fail("no active relicas found");
|
if(replica1 == null) fail("no active relicas found");
|
||||||
|
|
||||||
removeAndWaitForReplicaGone(COLL_NAME, client, replica1, shard1.getName());
|
removeAndWaitForReplicaGone(COLL_NAME, client, replica1, shard1.getName());
|
||||||
client.shutdown();
|
client.shutdown();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeAndWaitForReplicaGone(String COLL_NAME, CloudSolrServer client, Replica replica, String shard) throws SolrServerException, IOException, InterruptedException {
|
protected void removeAndWaitForReplicaGone(String COLL_NAME, CloudSolrServer client, Replica replica, String shard) throws SolrServerException, IOException, InterruptedException {
|
||||||
|
|
Loading…
Reference in New Issue