SOLR-8476: Removed Persist action and minor cleanups to CoreAdminHandlerm also moved the CHANGES entry to the correct section

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1724074 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Varun Thacker 2016-01-11 16:13:35 +00:00
parent cc0fc1eae3
commit e47edb0ebd
4 changed files with 23 additions and 62 deletions

View File

@ -210,8 +210,6 @@ Other Changes
* SOLR-8443: Change /stream handler http param from "stream" to "expr" (Joel Bernstein, Dennis Gove)
* SOLR-8476: Refactor and cleanup CoreAdminHandler (noble)
======================= 5.5.0 =======================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release
@ -247,6 +245,9 @@ Upgrading from Solr 5.4
* All protected methods from CoreAdminHandler other than handleCustomAction() is removed by SOLR-8476 and can
no more be overridden. If you still wish to override those methods, override the handleRequestBody()
* The PERSIST CoreAdmin action which was a NOOP and returned a deprecated message has been removed. See SOLR-8476
for more details. The corresponding SolrJ action has also been removed.
* bin/post now defaults application/json files to the /update/json/docs end-point. Use `-format solr` to force
files to the /update end-point. See SOLR-7042 for more details.
@ -473,6 +474,8 @@ Other Changes
* SOLR-7042: bin/post now uses /update/json/docs for application/json content types, including support for
.jsonl (JSON Lines) files. (Erik Hatcher and shalin)
* SOLR-8476: Refactor and cleanup CoreAdminHandler (noble, Varun Thacker)
================== 5.4.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

View File

@ -81,7 +81,6 @@ import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.FORC
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.INVOKE;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.MERGEINDEXES;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.OVERSEEROP;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.PERSIST;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.PREPRECOVERY;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.REJOINLEADERELECTION;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.RELOAD;
@ -95,7 +94,16 @@ import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.SPLI
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.STATUS;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.SWAP;
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.UNLOAD;
import static org.apache.solr.handler.admin.CoreAdminHandler.*;
import static org.apache.solr.handler.admin.CoreAdminHandler.COMPLETED;
import static org.apache.solr.handler.admin.CoreAdminHandler.CallInfo;
import static org.apache.solr.handler.admin.CoreAdminHandler.FAILED;
import static org.apache.solr.handler.admin.CoreAdminHandler.Invocable;
import static org.apache.solr.handler.admin.CoreAdminHandler.RESPONSE;
import static org.apache.solr.handler.admin.CoreAdminHandler.RESPONSE_MESSAGE;
import static org.apache.solr.handler.admin.CoreAdminHandler.RESPONSE_STATUS;
import static org.apache.solr.handler.admin.CoreAdminHandler.RUNNING;
import static org.apache.solr.handler.admin.CoreAdminHandler.buildCoreParams;
import static org.apache.solr.handler.admin.CoreAdminHandler.normalizePath;
enum CoreAdminOperation {
CREATE_OP(CREATE) {
@ -150,13 +158,6 @@ enum CoreAdminOperation {
}
}
},
PERSIST_OP(PERSIST) {
@Override
public void call(CallInfo callInfo) {
callInfo.rsp.add("message", "The PERSIST action has been deprecated");
}
},
STATUS_OP(STATUS) {
@Override
public void call(CallInfo callInfo) {

View File

@ -322,34 +322,6 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
}
}
//a persist core request
public static class Persist extends CoreAdminRequest {
protected String fileName = null;
public Persist() {
action = CoreAdminAction.PERSIST;
}
public void setFileName(String name) {
fileName = name;
}
public String getFileName() {
return fileName;
}
@Override
public SolrParams getParams() {
if( action == null ) {
throw new RuntimeException( "no action specified!" );
}
ModifiableSolrParams params = new ModifiableSolrParams();
params.set( CoreAdminParams.ACTION, action.toString() );
if (fileName != null) {
params.set( CoreAdminParams.FILE, fileName);
}
return params;
}
}
public static class OverrideLastPublished extends CoreAdminRequest {
protected String state;

View File

@ -19,6 +19,8 @@ package org.apache.solr.common.params;
import java.util.Locale;
import org.apache.solr.common.SolrException;
/**
* @since solr 1.3
*/
@ -29,9 +31,6 @@ public abstract class CoreAdminParams
/** Should the STATUS request include index info **/
public final static String INDEX_INFO = "indexInfo";
/** Persistent -- should it save the cores state? **/
public final static String PERSISTENT = "persistent";
/** If you rename something, what is the new name **/
public final static String NAME = "name";
@ -79,15 +78,6 @@ public abstract class CoreAdminParams
/** The shard id in solr cloud */
public final static String SHARD = "shard";
/** The shard range in solr cloud */
public final static String SHARD_RANGE = "shard.range";
/** The shard range in solr cloud */
public final static String SHARD_STATE = "shard.state";
/** The parent shard if applicable */
public final static String SHARD_PARENT = "shard.parent";
/** The target core to which a split index should be written to
* Multiple targetCores can be specified by multiple targetCore parameters */
@ -120,12 +110,10 @@ public abstract class CoreAdminParams
public static final String NODE = "node";
public enum CoreAdminAction {
STATUS,
LOAD,
STATUS,
UNLOAD,
RELOAD,
CREATE,
PERSIST,
SWAP,
RENAME,
MERGEINDEXES,
@ -133,12 +121,9 @@ public abstract class CoreAdminParams
PREPRECOVERY,
REQUESTRECOVERY,
REQUESTSYNCSHARD,
CREATEALIAS,
DELETEALIAS,
REQUESTBUFFERUPDATES,
REQUESTAPPLYUPDATES,
LOAD_ON_STARTUP,
TRANSIENT,
OVERSEEROP,
REQUESTSTATUS,
REJOINLEADERELECTION,
@ -146,13 +131,13 @@ public abstract class CoreAdminParams
FORCEPREPAREFORLEADERSHIP,
INVOKE;
public static CoreAdminAction get( String p )
{
if( p != null ) {
public static CoreAdminAction get( String p ) {
if (p != null) {
try {
return CoreAdminAction.valueOf( p.toUpperCase(Locale.ROOT) );
return CoreAdminAction.valueOf(p.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Wrong core admin action");
}
catch( Exception ex ) {}
}
return null;
}