mirror of https://github.com/apache/lucene.git
SOLR-7202: Remove deprecated string action types in Overseer, OverseerCollectionProcessor - deletecollection, createcollection, reloadcollection, removecollection, removeshard
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1669748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
421897ea3c
commit
c7427a2fd1
|
@ -1242,6 +1242,10 @@ Other Changes
|
|||
* SOLR-6227: Avoid spurious failures of ChaosMonkeySafeLeaderTest by ensuring there's
|
||||
at least one jetty to kill. (shalin)
|
||||
|
||||
* SOLR-7202: Remove deprecated string action types in Overseer and OverseerCollectionProcessor -
|
||||
"deletecollection", "createcollection", "reloadcollection", "removecollection", "removeshard".
|
||||
(Varun Thacker, shalin)
|
||||
|
||||
================== 4.10.4 ==================
|
||||
|
||||
Bug Fixes
|
||||
|
|
|
@ -74,18 +74,6 @@ import static org.apache.solr.common.params.CollectionParams.CollectionAction.BA
|
|||
public class Overseer implements Closeable {
|
||||
public static final String QUEUE_OPERATION = "operation";
|
||||
|
||||
/**
|
||||
* @deprecated use {@link org.apache.solr.common.params.CollectionParams.CollectionAction#DELETE}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String REMOVECOLLECTION = "removecollection";
|
||||
|
||||
/**
|
||||
* @deprecated use {@link org.apache.solr.common.params.CollectionParams.CollectionAction#DELETESHARD}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String REMOVESHARD = "removeshard";
|
||||
|
||||
public static final int STATE_UPDATE_DELAY = 1500; // delay between cloud state updates
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(Overseer.class);
|
||||
|
@ -375,7 +363,9 @@ public class Overseer implements Closeable {
|
|||
}
|
||||
} else {
|
||||
OverseerAction overseerAction = OverseerAction.get(operation);
|
||||
if (overseerAction != null) {
|
||||
if (overseerAction == null) {
|
||||
throw new RuntimeException("unknown operation:" + operation + " contents:" + message.getProperties());
|
||||
}
|
||||
switch (overseerAction) {
|
||||
case STATE:
|
||||
return new ReplicaMutator(getZkStateReader()).setState(clusterState, message);
|
||||
|
@ -399,23 +389,7 @@ public class Overseer implements Closeable {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("unknown operation:" + operation
|
||||
+ " contents:" + message.getProperties());
|
||||
}
|
||||
} else {
|
||||
// merely for back-compat where overseer action names were different from the ones
|
||||
// specified in CollectionAction. See SOLR-6115. Remove this in 5.0
|
||||
switch (operation) {
|
||||
case OverseerCollectionProcessor.CREATECOLLECTION:
|
||||
return new ClusterStateMutator(getZkStateReader()).createCollection(clusterState, message);
|
||||
case REMOVECOLLECTION:
|
||||
return new ClusterStateMutator(getZkStateReader()).deleteCollection(clusterState, message);
|
||||
case REMOVESHARD:
|
||||
return new CollectionMutator(getZkStateReader()).deleteShard(clusterState, message);
|
||||
default:
|
||||
throw new RuntimeException("unknown operation:" + operation
|
||||
+ " contents:" + message.getProperties());
|
||||
}
|
||||
throw new RuntimeException("unknown operation:" + operation + " contents:" + message.getProperties());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,24 +132,6 @@ public class OverseerCollectionProcessor implements Runnable, Closeable {
|
|||
public static final String CREATE_NODE_SET_SHUFFLE = "createNodeSet.shuffle";
|
||||
public static final String CREATE_NODE_SET = "createNodeSet";
|
||||
|
||||
/**
|
||||
* @deprecated use {@link org.apache.solr.common.params.CollectionParams.CollectionAction#DELETE}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String DELETECOLLECTION = "deletecollection";
|
||||
|
||||
/**
|
||||
* @deprecated use {@link org.apache.solr.common.params.CollectionParams.CollectionAction#CREATE}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String CREATECOLLECTION = "createcollection";
|
||||
|
||||
/**
|
||||
* @deprecated use {@link org.apache.solr.common.params.CollectionParams.CollectionAction#RELOAD}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String RELOADCOLLECTION = "reloadcollection";
|
||||
|
||||
public static final String ROUTER = "router";
|
||||
|
||||
public static final String SHARDS_PROP = "shards";
|
||||
|
@ -587,24 +569,8 @@ public class OverseerCollectionProcessor implements Runnable, Closeable {
|
|||
zkStateReader.updateClusterState(true);
|
||||
CollectionParams.CollectionAction action = CollectionParams.CollectionAction.get(operation);
|
||||
if (action == null) {
|
||||
// back-compat because we used strings different than enum values before SOLR-6115
|
||||
switch (operation) {
|
||||
case CREATECOLLECTION:
|
||||
createCollection(zkStateReader.getClusterState(), message, results);
|
||||
break;
|
||||
case DELETECOLLECTION:
|
||||
deleteCollection(message, results);
|
||||
break;
|
||||
case RELOADCOLLECTION:
|
||||
ModifiableSolrParams params = new ModifiableSolrParams();
|
||||
params.set(CoreAdminParams.ACTION, CoreAdminAction.RELOAD.toString());
|
||||
collectionCmd(zkStateReader.getClusterState(), message, params, results, ZkStateReader.ACTIVE);
|
||||
break;
|
||||
default:
|
||||
throw new SolrException(ErrorCode.BAD_REQUEST, "Unknown operation:"
|
||||
+ operation);
|
||||
throw new SolrException(ErrorCode.BAD_REQUEST, "Unknown operation:" + operation);
|
||||
}
|
||||
} else {
|
||||
switch (action) {
|
||||
case CREATE:
|
||||
createCollection(zkStateReader.getClusterState(), message, results);
|
||||
|
@ -669,7 +635,6 @@ public class OverseerCollectionProcessor implements Runnable, Closeable {
|
|||
throw new SolrException(ErrorCode.BAD_REQUEST, "Unknown operation:"
|
||||
+ operation);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String collName = message.getStr("collection");
|
||||
if (collName == null) collName = message.getStr("name");
|
||||
|
|
Loading…
Reference in New Issue