Class CoreAdminRequest
- java.lang.Object
-
- org.apache.solr.client.solrj.SolrRequest<CoreAdminResponse>
-
- org.apache.solr.client.solrj.request.CoreAdminRequest
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CoreAdminRequest.Create,CoreAdminRequest.CreateSnapshot,CoreAdminRequest.DeleteSnapshot,CoreAdminRequest.ListSnapshots,CoreAdminRequest.MergeIndexes,CoreAdminRequest.OverrideLastPublished,CoreAdminRequest.RequestRecovery,CoreAdminRequest.RequestSyncShard,CoreAdminRequest.Unload,CoreAdminRequest.WaitForState
public class CoreAdminRequest extends SolrRequest<CoreAdminResponse>
This class is experimental and subject to change.- Since:
- solr 1.3
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCoreAdminRequest.Createstatic classCoreAdminRequest.CreateSnapshotstatic classCoreAdminRequest.DeleteSnapshotstatic classCoreAdminRequest.ListSnapshotsstatic classCoreAdminRequest.MergeIndexesstatic classCoreAdminRequest.OverrideLastPublishedstatic classCoreAdminRequest.RequestRecoverystatic classCoreAdminRequest.RequestSyncShardstatic classCoreAdminRequest.Unloadstatic classCoreAdminRequest.WaitForState-
Nested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrRequest
SolrRequest.METHOD, SolrRequest.SolrClientContext, SolrRequest.SolrRequestType
-
-
Field Summary
Fields Modifier and Type Field Description protected CoreAdminParams.CoreAdminActionactionprotected Stringcoreprotected booleanisIndexInfoNeededprotected Stringother-
Fields inherited from class org.apache.solr.client.solrj.SolrRequest
SUPPORTED_METHODS, useBinaryV2, usev2
-
-
Constructor Summary
Constructors Constructor Description CoreAdminRequest()CoreAdminRequest(String path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CoreAdminResponsecreateCore(String name, String instanceDir, SolrClient client)static CoreAdminResponsecreateCore(String name, String instanceDir, SolrClient client, String configFile, String schemaFile)static CoreAdminResponsecreateCore(String name, String instanceDir, SolrClient client, String configFile, String schemaFile, String dataDir, String tlogDir)protected CoreAdminResponsecreateResponse(SolrClient client)Create a new SolrResponse to hold the response from the serverstatic CoreStatusgetCoreStatus(String coreName, boolean getIndexInfo, SolrClient client)static CoreStatusgetCoreStatus(String coreName, SolrClient client)SolrParamsgetParams()StringgetRequestType()This method defines the type of this Solr request.static CoreAdminResponsegetStatus(String name, SolrClient client)static CoreAdminResponsemergeIndexes(String name, String[] indexDirs, String[] srcCores, SolrClient client)static CoreAdminResponsereloadCore(String name, SolrClient client)static CoreAdminResponserenameCore(String coreName, String newName, SolrClient client)Rename an existing core.voidsetAction(CoreAdminParams.CoreAdminAction action)voidsetCoreName(String coreName)voidsetIndexInfoNeeded(boolean isIndexInfoNeeded)voidsetOtherCoreName(String otherCoreName)static CoreAdminResponseswapCore(String core1, String core2, SolrClient client)Swap two existing cores.static CoreAdminResponseunloadCore(String name, boolean deleteIndex, boolean deleteInstanceDir, SolrClient client)static CoreAdminResponseunloadCore(String name, boolean deleteIndex, SolrClient client)static CoreAdminResponseunloadCore(String name, SolrClient client)-
Methods inherited from class org.apache.solr.client.solrj.SolrRequest
addHeader, addHeaders, getBasePath, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getHeaders, getMethod, getPath, getPreferredNodes, getQueryParams, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, requiresCollection, setBasePath, setBasicAuthCredentials, setMethod, setPath, setPreferredNodes, setQueryParams, setResponseParser, setStreamingResponseCallback, setUseBinaryV2, setUserPrincipal, setUseV2
-
-
-
-
Field Detail
-
core
protected String core
-
other
protected String other
-
isIndexInfoNeeded
protected boolean isIndexInfoNeeded
-
action
protected CoreAdminParams.CoreAdminAction action
-
-
Constructor Detail
-
CoreAdminRequest
public CoreAdminRequest()
-
CoreAdminRequest
public CoreAdminRequest(String path)
-
-
Method Detail
-
getRequestType
public String getRequestType()
Description copied from class:SolrRequestThis method defines the type of this Solr request.- Specified by:
getRequestTypein classSolrRequest<CoreAdminResponse>
-
setCoreName
public void setCoreName(String coreName)
-
setOtherCoreName
public final void setOtherCoreName(String otherCoreName)
-
setIndexInfoNeeded
public final void setIndexInfoNeeded(boolean isIndexInfoNeeded)
-
setAction
public void setAction(CoreAdminParams.CoreAdminAction action)
-
getParams
public SolrParams getParams()
- Specified by:
getParamsin classSolrRequest<CoreAdminResponse>
-
createResponse
protected CoreAdminResponse createResponse(SolrClient client)
Description copied from class:SolrRequestCreate a new SolrResponse to hold the response from the server- Specified by:
createResponsein classSolrRequest<CoreAdminResponse>- Parameters:
client- theSolrClientthe request will be sent to
-
reloadCore
public static CoreAdminResponse reloadCore(String name, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
unloadCore
public static CoreAdminResponse unloadCore(String name, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
unloadCore
public static CoreAdminResponse unloadCore(String name, boolean deleteIndex, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
unloadCore
public static CoreAdminResponse unloadCore(String name, boolean deleteIndex, boolean deleteInstanceDir, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
renameCore
public static CoreAdminResponse renameCore(String coreName, String newName, SolrClient client) throws SolrServerException, IOException
Rename an existing core.- Throws:
IllegalArgumentException- if the new core name contains invalid characters.SolrServerExceptionIOException
-
swapCore
public static CoreAdminResponse swapCore(String core1, String core2, SolrClient client) throws SolrServerException, IOException
Swap two existing cores.- Parameters:
core1- name of the first corecore2- name of the other coreclient- SolrClient to use- Returns:
- response
- Throws:
SolrServerException- if one or both cores don't existIOException- on IO errors
-
getCoreStatus
public static CoreStatus getCoreStatus(String coreName, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
getCoreStatus
public static CoreStatus getCoreStatus(String coreName, boolean getIndexInfo, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
getStatus
public static CoreAdminResponse getStatus(String name, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
createCore
public static CoreAdminResponse createCore(String name, String instanceDir, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
createCore
public static CoreAdminResponse createCore(String name, String instanceDir, SolrClient client, String configFile, String schemaFile) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
createCore
public static CoreAdminResponse createCore(String name, String instanceDir, SolrClient client, String configFile, String schemaFile, String dataDir, String tlogDir) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
mergeIndexes
public static CoreAdminResponse mergeIndexes(String name, String[] indexDirs, String[] srcCores, SolrClient client) throws SolrServerException, IOException
- Throws:
SolrServerExceptionIOException
-
-