java.lang.Object
org.elasticsearch.cluster.block.ClusterBlocks
- All Implemented Interfaces:
Diffable<ClusterBlocks>,Writeable
Represents current cluster level blocks to block dirty operations done against the cluster.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classProjectBlocks encapsulates the project-specific ClusterBlocks.Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterBlocks.Builderbuilder()static ClusterBlocks.Builderbuilder(ClusterBlocks blocks) Convenience method, equivalent to:builder().blocks(blocks)diff(ClusterBlocks previousState) Returns serializable object representing differences between this and previousStatebooleanReturnstrueif one of the global blocks as its disable state persistence flag set.getIndexBlockWithId(ProjectId projectId, String index, int blockId) global()global(ClusterBlockLevel level) global(ProjectId projectId, ClusterBlockLevel level) globalBlockedException(ProjectId projectId, ClusterBlockLevel level) voidvoidglobalBlockedRaiseException(ProjectId projectId, ClusterBlockLevel level) booleanhasGlobalBlock(ClusterBlock block) booleanhasGlobalBlockWithId(int blockId) booleanbooleanhasGlobalBlockWithLevel(ProjectId projectId, ClusterBlockLevel level) booleanhasGlobalBlockWithStatus(RestStatus status) Is there a global block with the provided status?booleanhasIndexBlock(String index, ClusterBlock block) Deprecated, for removal: This API element is subject to removal in a future version.booleanhasIndexBlock(ProjectId projectId, String index, ClusterBlock block) booleanhasIndexBlockLevel(ProjectId projectId, String index, ClusterBlockLevel level) booleanhasIndexBlockWithId(ProjectId projectId, String index, int blockId) booleanindexBlocked(ClusterBlockLevel level, String index) Deprecated, for removal: This API element is subject to removal in a future version.booleanindexBlocked(ProjectId projectId, ClusterBlockLevel level, String index) indexBlockedException(ClusterBlockLevel level, String index) Deprecated, for removal: This API element is subject to removal in a future version.indexBlockedException(ProjectId projectId, ClusterBlockLevel level, String index) voidindexBlockedRaiseException(ProjectId projectId, ClusterBlockLevel level, String index) indices(ProjectId projectId, ClusterBlockLevel level) indicesAllowReleaseResources(ProjectId projectId, String[] indices) Returnstrueiff none of the given indices have aClusterBlockLevel.METADATA_WRITEin place where theClusterBlock.isAllowReleaseResources()returnsfalse.indicesBlockedException(ClusterBlockLevel level, String[] indices) Deprecated, for removal: This API element is subject to removal in a future version.indicesBlockedException(ProjectId projectId, ClusterBlockLevel level, String[] indices) initializeProjects(Set<ProjectId> projectIds) Ensure all projects that the ClusterBlocks contains are found in the provided projects by removing any project that does not exist in the provided set.booleanprojectBlocks(ProjectId projectId) protected Set<ClusterBlock> projectGlobal(ProjectId projectId) static Diff<ClusterBlocks> static ClusterBlocksreadFrom(StreamInput in) toString()voidwriteTo(StreamOutput out) Write this into the StreamOutput.
-
Field Details
-
EMPTY_CLUSTER_BLOCK
-
-
Method Details
-
global
-
global
-
noProjectHasAProjectBlock
public boolean noProjectHasAProjectBlock() -
indices
-
projectBlocks
-
projectGlobal
-
global
-
global
-
indices
-
disableStatePersistence
public boolean disableStatePersistence()Returnstrueif one of the global blocks as its disable state persistence flag set. -
hasGlobalBlock
-
hasGlobalBlockWithId
public boolean hasGlobalBlockWithId(int blockId) -
hasGlobalBlockWithLevel
-
hasGlobalBlockWithLevel
-
hasGlobalBlockWithStatus
Is there a global block with the provided status? -
hasIndexBlock
Deprecated, for removal: This API element is subject to removal in a future version. -
hasIndexBlock
-
hasIndexBlockLevel
-
hasIndexBlockWithId
-
getIndexBlockWithId
-
globalBlockedRaiseException
- Throws:
ClusterBlockException
-
globalBlockedRaiseException
public void globalBlockedRaiseException(ProjectId projectId, ClusterBlockLevel level) throws ClusterBlockException - Throws:
ClusterBlockException
-
globalBlockedException
-
globalBlockedException
-
indexBlockedRaiseException
public void indexBlockedRaiseException(ProjectId projectId, ClusterBlockLevel level, String index) throws ClusterBlockException - Throws:
ClusterBlockException
-
indexBlockedException
@Deprecated(forRemoval=true) public ClusterBlockException indexBlockedException(ClusterBlockLevel level, String index) Deprecated, for removal: This API element is subject to removal in a future version. -
indexBlockedException
public ClusterBlockException indexBlockedException(ProjectId projectId, ClusterBlockLevel level, String index) -
indexBlocked
Deprecated, for removal: This API element is subject to removal in a future version. -
indexBlocked
-
indicesBlockedException
@Deprecated(forRemoval=true) public ClusterBlockException indicesBlockedException(ClusterBlockLevel level, String[] indices) Deprecated, for removal: This API element is subject to removal in a future version. -
indicesBlockedException
public ClusterBlockException indicesBlockedException(ProjectId projectId, ClusterBlockLevel level, String[] indices) -
indicesAllowReleaseResources
Returnstrueiff none of the given indices have aClusterBlockLevel.METADATA_WRITEin place where theClusterBlock.isAllowReleaseResources()returnsfalse. This is used in places where resources will be released like the deletion of an index to free up resources on nodes.- Parameters:
projectId- the project that owns the indicesindices- the indices to check
-
toString
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
diff
Description copied from interface:DiffableReturns serializable object representing differences between this and previousState- Specified by:
diffin interfaceDiffable<ClusterBlocks>
-
readFrom
- Throws:
IOException
-
readDiffFrom
- Throws:
IOException
-
initializeProjects
Ensure all projects that the ClusterBlocks contains are found in the provided projects by removing any project that does not exist in the provided set.- Parameters:
projectIds- The set of project-ids fromMetadata.- Returns:
- A new ClusterBlocks is returned if there are any changes. Otherwise, the same instance of ClusterBlocks is returned.
-
builder
-
builder
Convenience method, equivalent to:builder().blocks(blocks)
-