public abstract class CollectionAdminRequest<T extends CollectionAdminResponse> extends SolrRequest<T> implements V2RequestSupport, MapWriter
SolrRequest.METHOD
MapWriter.EntryWriter
Modifier and Type | Field and Description |
---|---|
protected CollectionParams.CollectionAction |
action |
static List<String> |
MODIFIABLE_COLLECTION_PROPERTIES
The set of modifiable collection properties
|
static String |
PROPERTY_PREFIX |
SUPPORTED_METHODS, useBinaryV2, usev2
Constructor and Description |
---|
CollectionAdminRequest(CollectionParams.CollectionAction action) |
CollectionAdminRequest(String path,
CollectionParams.CollectionAction action) |
Modifier and Type | Method and Description |
---|---|
protected void |
addProperties(ModifiableSolrParams params,
Properties props) |
static CollectionAdminRequest.AddReplica |
addReplicaByRouteKey(String collection,
String routeKey)
Returns a SolrRequest to add a replica to a collection using a route key
|
static CollectionAdminRequest.AddReplicaProp |
addReplicaProperty(String collection,
String shard,
String replica,
String propertyName,
String propertyValue)
Returns a SolrRequest to add a property to a specific replica
|
static CollectionAdminRequest.AddReplica |
addReplicaToShard(String collection,
String shard)
Returns a SolrRequest to add a replica of type
Replica.Type.NRT to a shard in a collection |
static CollectionAdminRequest.AddReplica |
addReplicaToShard(String collection,
String shard,
Replica.Type replicaType)
Returns a SolrRequest to add a replica of the specified type to a shard in a collection.
|
static CollectionAdminRequest.AddRole |
addRole(String node,
String role)
Returns a SolrRequest to add a role to a node
|
static CollectionAdminRequest.Backup |
backupCollection(String collection,
String backupName) |
static CollectionAdminRequest.BalanceShardUnique |
balanceReplicaProperty(String collection,
String propertyName)
Returns a SolrRequest to balance a replica property across the shards of a collection
|
static CollectionAdminRequest.ColStatus |
collectionStatus(String collection)
Return a SolrRequest for low-level detailed status of the specified collection.
|
static CollectionAdminRequest.ColStatus |
collectionStatuses()
Return a SolrRequest for low-level detailed status of all collections on the cluster.
|
static CollectionAdminRequest.CreateAlias |
createAlias(String aliasName,
String aliasedCollections)
Returns a SolrRequest to create a new alias
|
static CollectionAdminRequest.CreateCategoryRoutedAlias |
createCategoryRoutedAlias(String aliasName,
String routerField,
int maxCardinality,
CollectionAdminRequest.Create createCollTemplate)
Returns a SolrRequest to create a category routed alias.
|
static CollectionAdminRequest.Create |
createCollection(String collection,
int numShards,
int numReplicas)
Returns a SolrRequest for creating a collection using a default configSet
This requires that there is either a single configset configured in the cluster, or
that there is a configset with the same name as the collection
|
static CollectionAdminRequest.Create |
createCollection(String collection,
String config,
Integer numShards,
Integer numNrtReplicas,
Integer numTlogReplicas,
Integer numPullReplicas)
Returns a SolrRequest for creating a collection
|
static CollectionAdminRequest.Create |
createCollection(String collection,
String config,
int numShards,
int numReplicas)
Returns a SolrRequest for creating a collection
|
static CollectionAdminRequest.Create |
createCollectionWithImplicitRouter(String collection,
String config,
String shards,
int numReplicas)
Returns a SolrRequest for creating a collection with the implicit router
|
static CollectionAdminRequest.Create |
createCollectionWithImplicitRouter(String collection,
String config,
String shards,
int numNrtReplicas,
int numTlogReplicas,
int numPullReplicas)
Returns a SolrRequest for creating a collection with the implicit router and specific types of replicas
|
static CollectionAdminRequest.DimensionalRoutedAlias |
createDimensionalRoutedAlias(String aliasName,
CollectionAdminRequest.Create createCollTemplate,
CollectionAdminRequest.RoutedAliasAdminRequest... dims)
Create a Dimensional Routed alias from two or more routed alias types.
|
static CollectionAdminRequest.CreateShard |
createShard(String collection,
String shard)
Returns a SolrRequest to create a new shard in a collection
|
static CollectionAdminRequest.CreateTimeRoutedAlias |
createTimeRoutedAlias(String aliasName,
String start,
String interval,
String routerField,
CollectionAdminRequest.Create createCollTemplate)
Returns a SolrRequest to create a time routed alias.
|
static CollectionAdminRequest.DeleteAlias |
deleteAlias(String aliasName)
Returns a SolrRequest to delete an alias
|
static CollectionAdminRequest.DeleteStatus |
deleteAllAsyncIds()
Returns a SolrRequest to delete a all asynchronous request statuses
|
static CollectionAdminRequest.DeleteStatus |
deleteAsyncId(String requestId)
Returns a SolrRequest to delete an asynchronous request status
|
static CollectionAdminRequest.DeleteBackup |
deleteBackupById(String backupName,
int backupId)
Configure a
SolrRequest object to delete a single backup-point by it's Backup ID. |
static CollectionAdminRequest.DeleteBackup |
deleteBackupByRecency(String backupName,
int numRecentBackupPointsToRetain)
Create a
SolrRequest object to delete all backup-points after the most recent 'N'
The created request object is only valid on backup locations that use the new "incremental" backup file-format
introduced in Solr 8.9. |
static CollectionAdminRequest.DeleteBackup |
deleteBackupPurgeUnusedFiles(String backupName)
Create a
SolrRequest object to delete all unused-files at the backup location. |
static CollectionAdminRequest.Delete |
deleteCollection(String collection)
Returns a SolrRequest to delete a collection
|
static CollectionAdminRequest.DeleteNode |
deleteNode(String node)
Returns a SolrRequest to delete a node.
|
static CollectionAdminRequest.DeleteReplica |
deleteReplica(String collection,
String shard,
int count) |
static CollectionAdminRequest.DeleteReplica |
deleteReplica(String collection,
String shard,
String replica)
Returns a SolrRequest to delete a replica from a shard in a collection
|
static CollectionAdminRequest.DeleteReplicaProp |
deleteReplicaProperty(String collection,
String shard,
String replica,
String propertyName)
Returns a SolrRequest to delete a property from a specific replica
|
static CollectionAdminRequest.DeleteReplica |
deleteReplicasFromAllShards(String collection,
int count) |
static CollectionAdminRequest.DeleteReplica |
deleteReplicasFromShard(String collection,
String shard,
int count)
Returns a SolrRequest to remove a number of replicas from a specific shard
|
static CollectionAdminRequest.DeleteShard |
deleteShard(String collection,
String shard)
Returns a SolrRequest to delete a shard from a collection
|
static CollectionAdminRequest.ForceLeader |
forceLeaderElection(String collection,
String shard)
Returns a SolrRequest to force a leader election for a shard in a collection
WARNING: This may cause data loss if the new leader does not contain updates
acknowledged by the old leader.
|
static CollectionAdminRequest.ClusterStatus |
getClusterStatus()
Return a SolrRequest to get the Cluster status
|
static CollectionAdminRequest.OverseerStatus |
getOverseerStatus()
Return a SolrRequest to get the Overseer status
|
SolrParams |
getParams() |
SolrRequest |
getV2Request()
Deprecated.
because several "collection-admin" APIs have been reimplemented and no longer use the "JSON-spec"
driven approach that this method relies on. Use
V2Request directly instead if V2 admin functionality is
desired. |
static CollectionAdminRequest.ListBackup |
listBackup(String backupName)
Create a
SolrRequest object to list information about all backup points with the specified name. |
static List<String> |
listCollections(SolrClient client)
Returns a SolrRequest to get a list of collections in the cluster
|
static CollectionAdminRequest.MigrateClusterState |
migrateCollectionFormat(String collection)
Returns a SolrRequest to migrate a collection state format
This is an expert-level request, and should not generally be necessary.
|
static CollectionAdminRequest.Migrate |
migrateData(String collection,
String targetCollection,
String splitKey)
Returns a SolrRequest to migrate data matching a split key to another collection
|
static CollectionAdminRequest.Modify |
modifyCollection(String collection,
Map<String,Object> properties)
Returns a SolrRequest for modifying a collection with the given properties
|
static CollectionAdminRequest.MoveReplica |
moveReplica(String collection,
String replica,
String targetNode) |
static CollectionAdminRequest.RebalanceLeaders |
rebalanceLeaders(String collection) |
static CollectionAdminRequest.ReindexCollection |
reindexCollection(String collection)
Returns a SolrRequest to reindex a collection
|
static CollectionAdminRequest.Reload |
reloadCollection(String collection)
Returns a SolrRequest to reload a collection
|
static CollectionAdminRequest.RemoveRole |
removeRole(String node,
String role)
Returns a SolrRequest to remove a role from a node
|
static CollectionAdminRequest.Rename |
renameCollection(String collection,
String target) |
static CollectionAdminRequest.RequestStatus |
requestStatus(String requestId)
Returns a SolrRequest for checking the status of an asynchronous request
|
static CollectionAdminRequest.Restore |
restoreCollection(String collection,
String backupName) |
static CollectionAdminRequest.SetAliasProperty |
setAliasProperty(String aliasName)
Returns a SolrRequest to add or remove properties from an alias
|
static CollectionAdminRequest.ClusterProp |
setClusterProperty(String propertyName,
String propertyValue)
Returns a SolrRequest to set (or unset) a cluster property
|
static CollectionAdminRequest.CollectionProp |
setCollectionProperty(String collection,
String propertyName,
String propertyValue) |
static CollectionAdminRequest.SplitShard |
splitShard(String collection)
Returns a SolrRequest to split a shard in a collection
|
String |
toString() |
static void |
waitForAsyncRequest(String requestId,
SolrClient client,
long timeout) |
void |
writeMap(MapWriter.EntryWriter ew) |
addHeader, createResponse, getBasePath, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getHeaders, getMethod, getPath, getQueryParams, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, setBasePath, setBasicAuthCredentials, setMethod, setPath, setQueryParams, setResponseParser, setStreamingResponseCallback, setUseBinaryV2, setUserPrincipal, setUseV2
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
public static final List<String> MODIFIABLE_COLLECTION_PROPERTIES
protected final CollectionParams.CollectionAction action
public static String PROPERTY_PREFIX
public CollectionAdminRequest(CollectionParams.CollectionAction action)
public CollectionAdminRequest(String path, CollectionParams.CollectionAction action)
@Deprecated public SolrRequest getV2Request()
V2Request
directly instead if V2 admin functionality is
desired.V2RequestSupport
getV2Request
in interface V2RequestSupport
public SolrParams getParams()
getParams
in class SolrRequest<T extends CollectionAdminResponse>
protected void addProperties(ModifiableSolrParams params, Properties props)
public void writeMap(MapWriter.EntryWriter ew) throws IOException
writeMap
in interface MapWriter
IOException
public static CollectionAdminRequest.Create createCollection(String collection, String config, Integer numShards, Integer numNrtReplicas, Integer numTlogReplicas, Integer numPullReplicas)
collection
- the collection nameconfig
- the collection confignumShards
- the number of shards in the collectionnumNrtReplicas
- the number of Replica.Type.NRT
replicasnumTlogReplicas
- the number of Replica.Type.TLOG
replicasnumPullReplicas
- the number of Replica.Type.PULL
replicaspublic static CollectionAdminRequest.Create createCollection(String collection, String config, int numShards, int numReplicas)
collection
- the collection nameconfig
- the collection confignumShards
- the number of shards in the collectionnumReplicas
- the replication factor of the collection (same as numNrtReplicas)public static CollectionAdminRequest.Create createCollection(String collection, int numShards, int numReplicas)
collection
- the collection namenumShards
- the number of shards in the collectionnumReplicas
- the replication factor of the collectionpublic static CollectionAdminRequest.Create createCollectionWithImplicitRouter(String collection, String config, String shards, int numReplicas)
collection
- the collection nameconfig
- the collection configshards
- a shard definition stringnumReplicas
- the replication factor of the collectionpublic static CollectionAdminRequest.Create createCollectionWithImplicitRouter(String collection, String config, String shards, int numNrtReplicas, int numTlogReplicas, int numPullReplicas)
collection
- the collection nameconfig
- the collection configshards
- a shard definition stringnumNrtReplicas
- the number of replicas of type Replica.Type.NRT
numTlogReplicas
- the number of replicas of type Replica.Type.TLOG
numPullReplicas
- the number of replicas of type Replica.Type.PULL
public static CollectionAdminRequest.Modify modifyCollection(String collection, Map<String,Object> properties)
collection
- the collection nameproperties
- a map of key and values with which the collection is to be modifiedpublic static CollectionAdminRequest.Reload reloadCollection(String collection)
public static CollectionAdminRequest.Rename renameCollection(String collection, String target)
public static CollectionAdminRequest.DeleteNode deleteNode(String node)
public static CollectionAdminRequest.MoveReplica moveReplica(String collection, String replica, String targetNode)
public static CollectionAdminRequest.RebalanceLeaders rebalanceLeaders(String collection)
public static CollectionAdminRequest.ReindexCollection reindexCollection(String collection)
public static CollectionAdminRequest.ColStatus collectionStatus(String collection)
collection
- the collection to get the status of.public static CollectionAdminRequest.ColStatus collectionStatuses()
public static CollectionAdminRequest.Delete deleteCollection(String collection)
public static CollectionAdminRequest.Backup backupCollection(String collection, String backupName)
public static CollectionAdminRequest.Restore restoreCollection(String collection, String backupName)
public static CollectionAdminRequest.CreateShard createShard(String collection, String shard)
public static CollectionAdminRequest.SplitShard splitShard(String collection)
public static CollectionAdminRequest.DeleteShard deleteShard(String collection, String shard)
public static CollectionAdminRequest.ForceLeader forceLeaderElection(String collection, String shard)
public static CollectionAdminRequest.RequestStatus requestStatus(String requestId)
public static void waitForAsyncRequest(String requestId, SolrClient client, long timeout) throws SolrServerException, InterruptedException, IOException
public static CollectionAdminRequest.DeleteStatus deleteAsyncId(String requestId)
public static CollectionAdminRequest.DeleteStatus deleteAllAsyncIds()
public static CollectionAdminRequest.SetAliasProperty setAliasProperty(String aliasName)
aliasName
- the alias to modifypublic static CollectionAdminRequest.CreateAlias createAlias(String aliasName, String aliasedCollections)
aliasName
- the alias namealiasedCollections
- the collections to aliaspublic static CollectionAdminRequest.CreateTimeRoutedAlias createTimeRoutedAlias(String aliasName, String start, String interval, String routerField, CollectionAdminRequest.Create createCollTemplate)
aliasName
- the name of the alias to create.start
- the start of the routing. A standard Solr date: ISO-8601 or NOW with date math.interval
- date math representing the time duration of each collection (e.g. +1DAY
)routerField
- the document field to contain the timestamp to route oncreateCollTemplate
- Holds options to create a collection. The "name" is ignored.public static CollectionAdminRequest.CreateCategoryRoutedAlias createCategoryRoutedAlias(String aliasName, String routerField, int maxCardinality, CollectionAdminRequest.Create createCollTemplate)
aliasName
- the name of the alias to create.routerField
- the document field to contain the timestamp to route onmaxCardinality
- the maximum number of collections under this CRAcreateCollTemplate
- Holds options to create a collection. The "name" is ignored.public static CollectionAdminRequest.DimensionalRoutedAlias createDimensionalRoutedAlias(String aliasName, CollectionAdminRequest.Create createCollTemplate, CollectionAdminRequest.RoutedAliasAdminRequest... dims)
aliasName
- The name of the aliascreateCollTemplate
- a create command that will be used for all collections createddims
- Routed Alias requests. Note that the aliasName and collection templates inside dimensions
will be ignored and may be safely set to nullpublic static CollectionAdminRequest.DeleteAlias deleteAlias(String aliasName)
public static CollectionAdminRequest.AddReplica addReplicaToShard(String collection, String shard)
Replica.Type.NRT
to a shard in a collectionpublic static CollectionAdminRequest.AddReplica addReplicaToShard(String collection, String shard, Replica.Type replicaType)
public static CollectionAdminRequest.AddReplica addReplicaByRouteKey(String collection, String routeKey)
public static CollectionAdminRequest.DeleteReplica deleteReplica(String collection, String shard, String replica)
public static CollectionAdminRequest.DeleteReplica deleteReplica(String collection, String shard, int count)
public static CollectionAdminRequest.DeleteReplica deleteReplicasFromShard(String collection, String shard, int count)
public static CollectionAdminRequest.DeleteReplica deleteReplicasFromAllShards(String collection, int count)
public static CollectionAdminRequest.ClusterProp setClusterProperty(String propertyName, String propertyValue)
public static CollectionAdminRequest.CollectionProp setCollectionProperty(String collection, String propertyName, String propertyValue)
public static CollectionAdminRequest.Migrate migrateData(String collection, String targetCollection, String splitKey)
public static CollectionAdminRequest.AddRole addRole(String node, String role)
public static CollectionAdminRequest.RemoveRole removeRole(String node, String role)
public static CollectionAdminRequest.OverseerStatus getOverseerStatus()
public static CollectionAdminRequest.ClusterStatus getClusterStatus()
public static List<String> listCollections(SolrClient client) throws IOException, SolrServerException
IOException
SolrServerException
public static CollectionAdminRequest.DeleteBackup deleteBackupById(String backupName, int backupId)
SolrRequest
object to delete a single backup-point by it's Backup ID.
The created request object is only valid on backup locations that use the new "incremental" backup file-format
introduced in Solr 8.9. It should not be used on locations holding "non-incremental" backups (those created prior
to 8.9, or after 8.9 using the advanced "incremental=false" flag).backupName
- the name of the backup that this request should delete a single backup-point from.backupId
- the ID of the backup-point for this request to deletepublic static CollectionAdminRequest.DeleteBackup deleteBackupByRecency(String backupName, int numRecentBackupPointsToRetain)
SolrRequest
object to delete all backup-points after the most recent 'N'
The created request object is only valid on backup locations that use the new "incremental" backup file-format
introduced in Solr 8.9. It should not be used on locations holding "non-incremental" backups (those created prior
to 8.9, or after 8.9 using the advanced "incremental=false" flag).backupName
- the name of the backup that this request should delete backup-points from.numRecentBackupPointsToRetain
- the number of "most-recent" backup-points to retain.public static CollectionAdminRequest.DeleteBackup deleteBackupPurgeUnusedFiles(String backupName)
SolrRequest
object to delete all unused-files at the backup location.
The created request object is only valid on backup locations that use the new "incremental" backup file-format
introduced in Solr 8.9. It should not be used on locations holding "non-incremental" backups (those created prior
to 8.9, or after 8.9 using the advanced "incremental=false" flag).backupName
- the name of the backup that this request should delete unused files from.public static CollectionAdminRequest.ListBackup listBackup(String backupName)
SolrRequest
object to list information about all backup points with the specified name.backupName
- the name of the backup that this request should list information aboutpublic static CollectionAdminRequest.AddReplicaProp addReplicaProperty(String collection, String shard, String replica, String propertyName, String propertyValue)
public static CollectionAdminRequest.DeleteReplicaProp deleteReplicaProperty(String collection, String shard, String replica, String propertyName)
public static CollectionAdminRequest.MigrateClusterState migrateCollectionFormat(String collection)
public static CollectionAdminRequest.BalanceShardUnique balanceReplicaProperty(String collection, String propertyName)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.