SOLR-5739: Removed shard state, range and parent from CoreAdmin calls and CoreDescriptor

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1569154 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2014-02-18 00:39:53 +00:00
parent bd527329ff
commit 76e71522a2
6 changed files with 1 additions and 42 deletions

View File

@ -44,10 +44,7 @@ public class CloudDescriptor {
volatile boolean isLeader = false; volatile boolean isLeader = false;
volatile String lastPublished = ZkStateReader.ACTIVE; volatile String lastPublished = ZkStateReader.ACTIVE;
public static final String SHARD_STATE = "shardState";
public static final String NUM_SHARDS = "numShards"; public static final String NUM_SHARDS = "numShards";
public static final String SHARD_RANGE = "shardRange";
public static final String SHARD_PARENT = "shardParent";
public CloudDescriptor(String coreName, Properties props, CoreDescriptor cd) { public CloudDescriptor(String coreName, Properties props, CoreDescriptor cd) {
this.cd = cd; this.cd = cd;
@ -56,10 +53,7 @@ public class CloudDescriptor {
this.collectionName = props.getProperty(CoreDescriptor.CORE_COLLECTION, coreName); this.collectionName = props.getProperty(CoreDescriptor.CORE_COLLECTION, coreName);
this.roles = props.getProperty(CoreDescriptor.CORE_ROLES, null); this.roles = props.getProperty(CoreDescriptor.CORE_ROLES, null);
this.nodeName = props.getProperty(CoreDescriptor.CORE_NODE_NAME); this.nodeName = props.getProperty(CoreDescriptor.CORE_NODE_NAME);
this.shardState = props.getProperty(CloudDescriptor.SHARD_STATE, Slice.ACTIVE);
this.numShards = PropertiesUtil.toInteger(props.getProperty(CloudDescriptor.NUM_SHARDS), null); this.numShards = PropertiesUtil.toInteger(props.getProperty(CloudDescriptor.NUM_SHARDS), null);
this.shardRange = props.getProperty(CloudDescriptor.SHARD_RANGE, null);
this.shardParent = props.getProperty(CloudDescriptor.SHARD_PARENT, null);
} }
public String getLastPublished() { public String getLastPublished() {
@ -125,28 +119,4 @@ public class CloudDescriptor {
if(nodeName==null) cd.getPersistableStandardProperties().remove(CoreDescriptor.CORE_NODE_NAME); if(nodeName==null) cd.getPersistableStandardProperties().remove(CoreDescriptor.CORE_NODE_NAME);
else cd.getPersistableStandardProperties().setProperty(CoreDescriptor.CORE_NODE_NAME, nodeName); else cd.getPersistableStandardProperties().setProperty(CoreDescriptor.CORE_NODE_NAME, nodeName);
} }
public String getShardRange() {
return shardRange;
}
public void setShardRange(String shardRange) {
this.shardRange = shardRange;
}
public String getShardState() {
return shardState;
}
public void setShardState(String shardState) {
this.shardState = shardState;
}
public String getShardParent() {
return shardParent;
}
public void setShardParent(String shardParent) {
this.shardParent = shardParent;
}
} }

View File

@ -966,9 +966,6 @@ public class OverseerCollectionProcessor implements Runnable, ClosableThread {
params.set(CoreAdminParams.NAME, subShardName); params.set(CoreAdminParams.NAME, subShardName);
params.set(CoreAdminParams.COLLECTION, collectionName); params.set(CoreAdminParams.COLLECTION, collectionName);
params.set(CoreAdminParams.SHARD, subSlice); params.set(CoreAdminParams.SHARD, subSlice);
params.set(CoreAdminParams.SHARD_RANGE, subRange.toString());
params.set(CoreAdminParams.SHARD_STATE, Slice.CONSTRUCTION);
params.set(CoreAdminParams.SHARD_PARENT, parentSlice.getName());
addPropertyParams(message, params); addPropertyParams(message, params);
sendShardRequest(nodeName, params); sendShardRequest(nodeName, params);
} }

View File

@ -1034,9 +1034,6 @@ public final class ZkController {
ZkStateReader.ROLES_PROP, cd.getCloudDescriptor().getRoles(), ZkStateReader.ROLES_PROP, cd.getCloudDescriptor().getRoles(),
ZkStateReader.NODE_NAME_PROP, getNodeName(), ZkStateReader.NODE_NAME_PROP, getNodeName(),
ZkStateReader.SHARD_ID_PROP, cd.getCloudDescriptor().getShardId(), ZkStateReader.SHARD_ID_PROP, cd.getCloudDescriptor().getShardId(),
ZkStateReader.SHARD_RANGE_PROP, cd.getCloudDescriptor().getShardRange(),
ZkStateReader.SHARD_STATE_PROP, cd.getCloudDescriptor().getShardState(),
ZkStateReader.SHARD_PARENT_PROP, cd.getCloudDescriptor().getShardParent(),
ZkStateReader.COLLECTION_PROP, cd.getCloudDescriptor() ZkStateReader.COLLECTION_PROP, cd.getCloudDescriptor()
.getCollectionName(), .getCollectionName(),
ZkStateReader.NUM_SHARDS_PROP, numShards != null ? numShards.toString() ZkStateReader.NUM_SHARDS_PROP, numShards != null ? numShards.toString()

View File

@ -105,8 +105,7 @@ public class CoreDescriptor {
CORE_COLLECTION, CORE_COLLECTION,
CORE_ROLES, CORE_ROLES,
CORE_NODE_NAME, CORE_NODE_NAME,
CloudDescriptor.NUM_SHARDS, CloudDescriptor.NUM_SHARDS
CloudDescriptor.SHARD_STATE
); );
private final CoreContainer coreContainer; private final CoreContainer coreContainer;

View File

@ -440,9 +440,6 @@ public class CoreAdminHandler extends RequestHandlerBase {
.put(CoreAdminParams.COLLECTION, CoreDescriptor.CORE_COLLECTION) .put(CoreAdminParams.COLLECTION, CoreDescriptor.CORE_COLLECTION)
.put(CoreAdminParams.ROLES, CoreDescriptor.CORE_ROLES) .put(CoreAdminParams.ROLES, CoreDescriptor.CORE_ROLES)
.put(CoreAdminParams.CORE_NODE_NAME, CoreDescriptor.CORE_NODE_NAME) .put(CoreAdminParams.CORE_NODE_NAME, CoreDescriptor.CORE_NODE_NAME)
.put(CoreAdminParams.SHARD_STATE, CloudDescriptor.SHARD_STATE)
.put(CoreAdminParams.SHARD_RANGE, CloudDescriptor.SHARD_RANGE)
.put(CoreAdminParams.SHARD_PARENT, CloudDescriptor.SHARD_PARENT)
.put(ZkStateReader.NUM_SHARDS_PROP, CloudDescriptor.NUM_SHARDS) .put(ZkStateReader.NUM_SHARDS_PROP, CloudDescriptor.NUM_SHARDS)
.build(); .build();

View File

@ -38,7 +38,6 @@ import org.apache.solr.common.cloud.ZkNodeProps;
import org.apache.solr.common.cloud.ZkStateReader; import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.CollectionParams; import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.handler.admin.CollectionsHandler;
import org.apache.solr.update.DirectUpdateHandler2; import org.apache.solr.update.DirectUpdateHandler2;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;