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 class
ClusterBlocks.Builder
-
Nested 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 ClusterBlocks
EMPTY_CLUSTER_BLOCK
-
Constructor Summary
Constructors Constructor Description ClusterBlocks(StreamInput in)
-
Method Summary
Modifier and Type Method Description static ClusterBlocks.Builder
builder()
boolean
disableStatePersistence()
Returnstrue
if one of the global blocks as its disable state persistence flag set.ClusterBlock
getIndexBlockWithId(java.lang.String index, int blockId)
java.util.Set<ClusterBlock>
global()
java.util.Set<ClusterBlock>
global(ClusterBlockLevel level)
ClusterBlockException
globalBlockedException(ClusterBlockLevel level)
void
globalBlockedRaiseException(ClusterBlockLevel level)
boolean
hasGlobalBlock(ClusterBlock block)
boolean
hasGlobalBlockWithId(int blockId)
boolean
hasGlobalBlockWithLevel(ClusterBlockLevel level)
boolean
hasGlobalBlockWithStatus(RestStatus status)
Is there a global block with the provided status?boolean
hasIndexBlock(java.lang.String index, ClusterBlock block)
boolean
hasIndexBlockWithId(java.lang.String index, int blockId)
boolean
indexBlocked(ClusterBlockLevel level, java.lang.String index)
ClusterBlockException
indexBlockedException(ClusterBlockLevel level, java.lang.String index)
void
indexBlockedRaiseException(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)
ClusterBlockException
indicesAllowReleaseResources(java.lang.String[] indices)
Returnstrue
iff non of the given have aClusterBlockLevel.METADATA_WRITE
in place where theClusterBlock.isAllowReleaseResources()
returnsfalse
.ClusterBlockException
indicesBlockedException(ClusterBlockLevel level, java.lang.String[] indices)
static Diff<ClusterBlocks>
readDiffFrom(StreamInput in)
java.lang.String
toString()
void
writeTo(StreamOutput out)
Write this into the StreamOutput.-
Methods inherited from class org.elasticsearch.cluster.AbstractDiffable
diff, get, readDiffFrom
-
-
-
-
Field Detail
-
EMPTY_CLUSTER_BLOCK
public static final ClusterBlocks EMPTY_CLUSTER_BLOCK
-
-
Constructor Detail
-
ClusterBlocks
public ClusterBlocks(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
global
public java.util.Set<ClusterBlock> global()
-
indices
public ImmutableOpenMap<java.lang.String,java.util.Set<ClusterBlock>> indices()
-
global
public java.util.Set<ClusterBlock> global(ClusterBlockLevel level)
-
indices
public ImmutableOpenMap<java.lang.String,java.util.Set<ClusterBlock>> indices(ClusterBlockLevel level)
-
disableStatePersistence
public boolean disableStatePersistence()
Returnstrue
if one of the global blocks as its disable state persistence flag set.
-
hasGlobalBlock
public boolean hasGlobalBlock(ClusterBlock block)
-
hasGlobalBlockWithId
public boolean hasGlobalBlockWithId(int blockId)
-
hasGlobalBlockWithLevel
public boolean hasGlobalBlockWithLevel(ClusterBlockLevel level)
-
hasGlobalBlockWithStatus
public boolean hasGlobalBlockWithStatus(RestStatus status)
Is there a global block with the provided status?
-
hasIndexBlock
public boolean hasIndexBlock(java.lang.String index, ClusterBlock block)
-
hasIndexBlockWithId
public boolean hasIndexBlockWithId(java.lang.String index, int blockId)
-
getIndexBlockWithId
@Nullable public ClusterBlock getIndexBlockWithId(java.lang.String index, int blockId)
-
globalBlockedRaiseException
public void globalBlockedRaiseException(ClusterBlockLevel level) throws ClusterBlockException
- Throws:
ClusterBlockException
-
globalBlockedException
public ClusterBlockException globalBlockedException(ClusterBlockLevel level)
-
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
public boolean indexBlocked(ClusterBlockLevel level, java.lang.String index)
-
indicesBlockedException
public ClusterBlockException indicesBlockedException(ClusterBlockLevel level, java.lang.String[] indices)
-
indicesAllowReleaseResources
public ClusterBlockException indicesAllowReleaseResources(java.lang.String[] indices)
Returnstrue
iff non of the given have aClusterBlockLevel.METADATA_WRITE
in 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:
toString
in classjava.lang.Object
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.- Throws:
java.io.IOException
-
readDiffFrom
public static Diff<ClusterBlocks> readDiffFrom(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
builder
public static ClusterBlocks.Builder builder()
-
-