From 76e71522a251ae5dbdfcf8e9830c7483e1ed7cbb Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Tue, 18 Feb 2014 00:39:53 +0000 Subject: [PATCH] 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 --- .../apache/solr/cloud/CloudDescriptor.java | 30 ------------------- .../cloud/OverseerCollectionProcessor.java | 3 -- .../org/apache/solr/cloud/ZkController.java | 3 -- .../org/apache/solr/core/CoreDescriptor.java | 3 +- .../solr/handler/admin/CoreAdminHandler.java | 3 -- .../org/apache/solr/cloud/ShardSplitTest.java | 1 - 6 files changed, 1 insertion(+), 42 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/CloudDescriptor.java b/solr/core/src/java/org/apache/solr/cloud/CloudDescriptor.java index e19ae117adc..02f358af87f 100644 --- a/solr/core/src/java/org/apache/solr/cloud/CloudDescriptor.java +++ b/solr/core/src/java/org/apache/solr/cloud/CloudDescriptor.java @@ -44,10 +44,7 @@ public class CloudDescriptor { volatile boolean isLeader = false; volatile String lastPublished = ZkStateReader.ACTIVE; - public static final String SHARD_STATE = "shardState"; 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) { this.cd = cd; @@ -56,10 +53,7 @@ public class CloudDescriptor { this.collectionName = props.getProperty(CoreDescriptor.CORE_COLLECTION, coreName); this.roles = props.getProperty(CoreDescriptor.CORE_ROLES, null); 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.shardRange = props.getProperty(CloudDescriptor.SHARD_RANGE, null); - this.shardParent = props.getProperty(CloudDescriptor.SHARD_PARENT, null); } public String getLastPublished() { @@ -125,28 +119,4 @@ public class CloudDescriptor { if(nodeName==null) cd.getPersistableStandardProperties().remove(CoreDescriptor.CORE_NODE_NAME); 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; - } } diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java index 7dc66033fd5..8d135f4316b 100644 --- a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java +++ b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java @@ -966,9 +966,6 @@ public class OverseerCollectionProcessor implements Runnable, ClosableThread { params.set(CoreAdminParams.NAME, subShardName); params.set(CoreAdminParams.COLLECTION, collectionName); 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); sendShardRequest(nodeName, params); } diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java index a6dcf814d68..796b9f5a6d1 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java @@ -1034,9 +1034,6 @@ public final class ZkController { ZkStateReader.ROLES_PROP, cd.getCloudDescriptor().getRoles(), ZkStateReader.NODE_NAME_PROP, getNodeName(), 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() .getCollectionName(), ZkStateReader.NUM_SHARDS_PROP, numShards != null ? numShards.toString() diff --git a/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java b/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java index 9dab534585f..582c46397b2 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java +++ b/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java @@ -105,8 +105,7 @@ public class CoreDescriptor { CORE_COLLECTION, CORE_ROLES, CORE_NODE_NAME, - CloudDescriptor.NUM_SHARDS, - CloudDescriptor.SHARD_STATE + CloudDescriptor.NUM_SHARDS ); private final CoreContainer coreContainer; diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java index 709c3cd9d73..689af98a7b0 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java @@ -440,9 +440,6 @@ public class CoreAdminHandler extends RequestHandlerBase { .put(CoreAdminParams.COLLECTION, CoreDescriptor.CORE_COLLECTION) .put(CoreAdminParams.ROLES, CoreDescriptor.CORE_ROLES) .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) .build(); diff --git a/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java b/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java index 91dfaf1f381..b1315218930 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java @@ -38,7 +38,6 @@ import org.apache.solr.common.cloud.ZkNodeProps; import org.apache.solr.common.cloud.ZkStateReader; import org.apache.solr.common.params.CollectionParams; import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.handler.admin.CollectionsHandler; import org.apache.solr.update.DirectUpdateHandler2; import org.junit.After; import org.junit.Before;