fix CoreAdminRequest so that it uses correct key for shard id, use same key for shard id in CoreAdminParams and ZkStateReader

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1292238 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sami Siren 2012-02-22 11:14:06 +00:00
parent 5365c14656
commit 9e1e2d40a4
3 changed files with 3 additions and 4 deletions

View File

@ -310,7 +310,6 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {
// TODO: enable when we don't falsly get slice1...
// solrj.getZkStateReader().getLeaderUrl(oneInstanceCollection2, "slice1", 30000);
// solrj.getZkStateReader().getLeaderUrl(oneInstanceCollection2, "slice2", 30000);
client2.add(getDoc(id, "1"));
client3.add(getDoc(id, "2"));
client4.add(getDoc(id, "3"));
@ -343,7 +342,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase {
zkStateReader.updateCloudState(true);
Map<String,Slice> slices = zkStateReader.getCloudState().getSlices(oneInstanceCollection2);
assertNotNull(slices);
String roles = slices.get("shard1").getShards().values().iterator().next().get(ZkStateReader.ROLES_PROP);
String roles = slices.get("slice1").getShards().values().iterator().next().get(ZkStateReader.ROLES_PROP);
assertEquals("none", roles);
}

View File

@ -105,7 +105,7 @@ public class CoreAdminRequest extends SolrRequest
params.set( ZkStateReader.NUM_SHARDS_PROP, numShards);
}
if (shardId != null) {
params.set( ZkStateReader.SHARD_ID_PROP, shardId);
params.set( CoreAdminParams.SHARD, shardId);
}
if (roles != null) {
params.set( CoreAdminParams.ROLES, roles);

View File

@ -54,7 +54,7 @@ public class ZkStateReader {
public static final String STATE_PROP = "state";
public static final String CORE_NAME_PROP = "core";
public static final String COLLECTION_PROP = "collection";
public static final String SHARD_ID_PROP = "shard_id";
public static final String SHARD_ID_PROP = "shard";
public static final String NUM_SHARDS_PROP = "numShards";
public static final String LEADER_PROP = "leader";