Package org.elasticsearch.cluster.block
Class ClusterBlocks
java.lang.Object
org.elasticsearch.cluster.AbstractDiffable<ClusterBlocks>
org.elasticsearch.cluster.block.ClusterBlocks
- All Implemented Interfaces:
Diffable<ClusterBlocks>,Writeable
public class ClusterBlocks extends AbstractDiffable<ClusterBlocks>
Represents current cluster level blocks to block dirty operations done against the cluster.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClusterBlocks.BuilderNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description static ClusterBlocksEMPTY_CLUSTER_BLOCK -
Constructor Summary
Constructors Constructor Description ClusterBlocks(StreamInput in) -
Method Summary
Modifier and Type Method Description static ClusterBlocks.Builderbuilder()booleandisableStatePersistence()Returnstrueif one of the global blocks as its disable state persistence flag set.ClusterBlockgetIndexBlockWithId(java.lang.String index, int blockId)java.util.Set<ClusterBlock>global()java.util.Set<ClusterBlock>global(ClusterBlockLevel level)ClusterBlockExceptionglobalBlockedException(ClusterBlockLevel level)voidglobalBlockedRaiseException(ClusterBlockLevel level)booleanhasGlobalBlock(ClusterBlock block)booleanhasGlobalBlockWithId(int blockId)booleanhasGlobalBlockWithLevel(ClusterBlockLevel level)booleanhasGlobalBlockWithStatus(RestStatus status)Is there a global block with the provided status?booleanhasIndexBlock(java.lang.String index, ClusterBlock block)booleanhasIndexBlockWithId(java.lang.String index, int blockId)booleanindexBlocked(ClusterBlockLevel level, java.lang.String index)ClusterBlockExceptionindexBlockedException(ClusterBlockLevel level, java.lang.String index)voidindexBlockedRaiseException(ClusterBlockLevel level, java.lang.String index)ImmutableOpenMap<java.lang.String,java.util.Set<ClusterBlock>>indices()ImmutableOpenMap<java.lang.String,java.util.Set<ClusterBlock>>indices(ClusterBlockLevel level)ClusterBlockExceptionindicesAllowReleaseResources(java.lang.String[] indices)Returnstrueiff non of the given have aClusterBlockLevel.METADATA_WRITEin place where theClusterBlock.isAllowReleaseResources()returnsfalse.ClusterBlockExceptionindicesBlockedException(ClusterBlockLevel level, java.lang.String[] indices)static Diff<ClusterBlocks>readDiffFrom(StreamInput in)java.lang.StringtoString()voidwriteTo(StreamOutput out)Write this into the StreamOutput.
-
Field Details
-
Constructor Details
-
ClusterBlocks
- Throws:
java.io.IOException
-
-
Method Details
-
global
-
indices
-
global
-
indices
public ImmutableOpenMap<java.lang.String,java.util.Set<ClusterBlock>> indices(ClusterBlockLevel level) -
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
-
hasGlobalBlockWithStatus
Is there a global block with the provided status? -
hasIndexBlock
-
hasIndexBlockWithId
public boolean hasIndexBlockWithId(java.lang.String index, int blockId) -
getIndexBlockWithId
-
globalBlockedRaiseException
- Throws:
ClusterBlockException
-
globalBlockedException
-
indexBlockedRaiseException
public void indexBlockedRaiseException(ClusterBlockLevel level, java.lang.String index) throws ClusterBlockException- Throws:
ClusterBlockException
-
indexBlockedException
public ClusterBlockException indexBlockedException(ClusterBlockLevel level, java.lang.String index) -
indexBlocked
-
indicesBlockedException
public ClusterBlockException indicesBlockedException(ClusterBlockLevel level, java.lang.String[] indices) -
indicesAllowReleaseResources
Returnstrueiff non of the given 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:
indices- the indices to check
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
java.io.IOException
-
readDiffFrom
- Throws:
java.io.IOException
-
builder
-