Interface IndicesClusterStateService.AllocatedIndices<T extends IndicesClusterStateService.Shard,U extends IndicesClusterStateService.AllocatedIndex<T>>
-
- All Superinterfaces:
java.lang.Iterable<U>
- All Known Implementing Classes:
IndicesService
- Enclosing class:
- IndicesClusterStateService
public static interface IndicesClusterStateService.AllocatedIndices<T extends IndicesClusterStateService.Shard,U extends IndicesClusterStateService.AllocatedIndex<T>> extends java.lang.Iterable<U>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIndicesClusterStateService.AllocatedIndices.IndexRemovalReason
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description UcreateIndex(IndexMetaData indexMetaData, java.util.List<IndexEventListener> builtInIndexListener)Creates a newIndexServicefor the given metadata.TcreateShard(ShardRouting shardRouting, RecoveryState recoveryState, PeerRecoveryTargetService recoveryTargetService, PeerRecoveryTargetService.RecoveryListener recoveryListener, RepositoriesService repositoriesService, java.util.function.Consumer<IndexShard.ShardFailure> onShardFailure, java.util.function.Consumer<ShardId> globalCheckpointSyncer)Creates shard for the specified shard routing and starts recovery,voiddeleteUnassignedIndex(java.lang.String reason, IndexMetaData metaData, ClusterState clusterState)Deletes an index that is not assigned to this node.default TgetShardOrNull(ShardId shardId)Returns shard for the specified id if it exists otherwise returnsnull.UindexService(Index index)Returns an IndexService for the specified index if exists otherwise returnsnull.voidprocessPendingDeletes(Index index, IndexSettings indexSettings, TimeValue timeValue)voidremoveIndex(Index index, IndicesClusterStateService.AllocatedIndices.IndexRemovalReason reason, java.lang.String extraInfo)Removes the given index from this service and releases all associated resources.IndexMetaDataverifyIndexIsDeleted(Index index, ClusterState clusterState)Verify that the contents on disk for the given index is deleted; if not, delete the contents.
-
-
-
Method Detail
-
createIndex
U createIndex(IndexMetaData indexMetaData, java.util.List<IndexEventListener> builtInIndexListener) throws java.io.IOException
Creates a newIndexServicefor the given metadata.- Parameters:
indexMetaData- the index metadata to create the index forbuiltInIndexListener- a list of built-in lifecycleIndexEventListenerthat should should be used along side with the per-index listeners- Throws:
ResourceAlreadyExistsException- if the index already exists.java.io.IOException
-
verifyIndexIsDeleted
IndexMetaData verifyIndexIsDeleted(Index index, ClusterState clusterState)
Verify that the contents on disk for the given index is deleted; if not, delete the contents. This method assumes that an index is already deleted in the cluster state and/or explicitly through index tombstones.- Parameters:
index-Indexto make sure its deleted from diskclusterState-ClusterStateto ensure the index is not part of it- Returns:
- IndexMetaData for the index loaded from disk
-
deleteUnassignedIndex
void deleteUnassignedIndex(java.lang.String reason, IndexMetaData metaData, ClusterState clusterState)Deletes an index that is not assigned to this node. This method cleans up all disk folders relating to the index but does not deal with in-memory structures. For those callremoveIndex(Index, IndexRemovalReason, String)
-
removeIndex
void removeIndex(Index index, IndicesClusterStateService.AllocatedIndices.IndexRemovalReason reason, java.lang.String extraInfo)
Removes the given index from this service and releases all associated resources. Persistent parts of the index like the shards files, state and transaction logs are kept around in the case of a disaster recovery.- Parameters:
index- the index to removereason- the reason to remove the indexextraInfo- extra information that will be used for logging and reporting
-
indexService
@Nullable U indexService(Index index)
Returns an IndexService for the specified index if exists otherwise returnsnull.
-
createShard
T createShard(ShardRouting shardRouting, RecoveryState recoveryState, PeerRecoveryTargetService recoveryTargetService, PeerRecoveryTargetService.RecoveryListener recoveryListener, RepositoriesService repositoriesService, java.util.function.Consumer<IndexShard.ShardFailure> onShardFailure, java.util.function.Consumer<ShardId> globalCheckpointSyncer) throws java.io.IOException
Creates shard for the specified shard routing and starts recovery,- Throws:
java.io.IOException
-
getShardOrNull
default T getShardOrNull(ShardId shardId)
Returns shard for the specified id if it exists otherwise returnsnull.
-
processPendingDeletes
void processPendingDeletes(Index index, IndexSettings indexSettings, TimeValue timeValue) throws java.io.IOException, java.lang.InterruptedException, ShardLockObtainFailedException
- Throws:
java.io.IOExceptionjava.lang.InterruptedExceptionShardLockObtainFailedException
-
-