Interface IndicesClusterStateService.AllocatedIndices<T extends IndicesClusterStateService.Shard,​U extends IndicesClusterStateService.AllocatedIndex<T>>

All Superinterfaces:
All Known Implementing Classes:
Enclosing class:

public static interface IndicesClusterStateService.AllocatedIndices<T extends IndicesClusterStateService.Shard,​U extends IndicesClusterStateService.AllocatedIndex<T>>
extends java.lang.Iterable<U>
  • Method Details

    • createIndex

      U createIndex​(IndexMetaData indexMetaData, java.util.List<IndexEventListener> builtInIndexListener, boolean writeDanglingIndices) throws
      Creates a new IndexService for the given metadata.
      indexMetaData - the index metadata to create the index for
      builtInIndexListener - a list of built-in lifecycle IndexEventListener that should should be used along side with the per-index listeners
      writeDanglingIndices - whether dangling indices information should be written
      ResourceAlreadyExistsException - if the index already exists.
    • 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.
      index - Index to make sure its deleted from disk
      clusterState - ClusterState to ensure the index is not part of it
      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 call removeIndex(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.
      index - the index to remove
      reason - the reason to remove the index
      extraInfo - 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 returns null.
    • 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, RetentionLeaseSyncer retentionLeaseSyncer) throws
      Creates a shard for the specified shard routing and starts recovery.
      shardRouting - the shard routing
      recoveryState - the recovery state
      recoveryTargetService - recovery service for the target
      recoveryListener - a callback when recovery changes state (finishes or fails)
      repositoriesService - service responsible for snapshot/restore
      onShardFailure - a callback when this shard fails
      globalCheckpointSyncer - a callback when this shard syncs the global checkpoint
      retentionLeaseSyncer - a callback when this shard syncs retention leases
      a new shard
      Throws: - if an I/O exception occurs when creating the shard
    • getShardOrNull

      default T getShardOrNull​(ShardId shardId)
      Returns shard for the specified id if it exists otherwise returns null.
    • processPendingDeletes

      void processPendingDeletes​(Index index, IndexSettings indexSettings, TimeValue timeValue) throws, java.lang.InterruptedException, ShardLockObtainFailedException