Class MetaDataIndexStateService
java.lang.Object
org.elasticsearch.cluster.metadata.MetaDataIndexStateService
public class MetaDataIndexStateService
extends java.lang.Object
Service responsible for submitting open/close index requests
-
Field Summary
Fields Modifier and Type Field Description static ClusterBlockINDEX_CLOSED_BLOCKstatic intINDEX_CLOSED_BLOCK_IDstatic Setting<java.lang.Boolean>VERIFIED_BEFORE_CLOSE_SETTING -
Constructor Summary
Constructors Constructor Description MetaDataIndexStateService(ClusterService clusterService, AllocationService allocationService, MetaDataIndexUpgradeService metaDataIndexUpgradeService, IndicesService indicesService, ThreadPool threadPool, TransportVerifyShardBeforeCloseAction transportVerifyShardBeforeCloseAction) -
Method Summary
Modifier and Type Method Description voidcloseIndices(CloseIndexClusterStateUpdateRequest request, ActionListener<CloseIndexResponse> listener)Closes one or more indices.static ClusterBlockcreateIndexClosingBlock()static booleanisIndexVerifiedBeforeClosed(IndexMetaData indexMetaData)voidopenIndex(OpenIndexClusterStateUpdateRequest request, ActionListener<OpenIndexClusterStateUpdateResponse> listener)
-
Field Details
-
INDEX_CLOSED_BLOCK_ID
public static final int INDEX_CLOSED_BLOCK_ID- See Also:
- Constant Field Values
-
INDEX_CLOSED_BLOCK
-
VERIFIED_BEFORE_CLOSE_SETTING
-
-
Constructor Details
-
MetaDataIndexStateService
@Inject public MetaDataIndexStateService(ClusterService clusterService, AllocationService allocationService, MetaDataIndexUpgradeService metaDataIndexUpgradeService, IndicesService indicesService, ThreadPool threadPool, TransportVerifyShardBeforeCloseAction transportVerifyShardBeforeCloseAction)
-
-
Method Details
-
closeIndices
public void closeIndices(CloseIndexClusterStateUpdateRequest request, ActionListener<CloseIndexResponse> listener)Closes one or more indices. Closing indices is a 3 steps process: it first adds a write block to every indices to close, then waits for the operations on shards to be terminated and finally closes the indices by moving their state to CLOSE. -
openIndex
public void openIndex(OpenIndexClusterStateUpdateRequest request, ActionListener<OpenIndexClusterStateUpdateResponse> listener) -
createIndexClosingBlock
- Returns:
- Generates a
ClusterBlockthat blocks read and write operations on soon-to-be-closed indices. The cluster block is generated with the id value equals toINDEX_CLOSED_BLOCK_IDand a unique UUID.
-
isIndexVerifiedBeforeClosed
-