Package org.opensearch.cluster.metadata
Class IndexGraveyard
java.lang.Object
org.opensearch.cluster.metadata.IndexGraveyard
- All Implemented Interfaces:
ClusterState.FeatureAware
,Diffable<Metadata.Custom>
,Metadata.Custom
,NamedDiffable<Metadata.Custom>
,org.opensearch.core.common.io.stream.NamedWriteable
,org.opensearch.core.common.io.stream.VersionedNamedWriteable
,org.opensearch.core.common.io.stream.Writeable
,org.opensearch.core.xcontent.ToXContent
,org.opensearch.core.xcontent.ToXContentFragment
@PublicApi(since="1.0.0")
public final class IndexGraveyard
extends Object
implements Metadata.Custom
A collection of tombstones for explicitly marking indices as deleted in the cluster state.
The cluster state contains a list of index tombstones for indices that have been deleted in the cluster. Because cluster states are processed asynchronously by nodes and a node could be removed from the cluster for a period of time, the tombstones remain in the cluster state for a fixed period of time, after which they are purged.
- Opensearch.api:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A class to build an IndexGraveyard.static final class
A class representing a diff of two IndexGraveyard objects.static final class
An individual tombstone entry for representing a deleted index.Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionSetting for the maximum tombstones allowed in the cluster state; prevents the cluster state size from exploding too large, but it opens the very unlikely risk that if there are greater than MAX_TOMBSTONES index deletions while a node was offline, when it comes back online, it will have missed index deletions that it may need to process.static final String
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IndexGraveyard.Builder
builder()
static IndexGraveyard.Builder
builder
(IndexGraveyard graveyard) boolean
containsIndex
(org.opensearch.core.index.Index index) Returns true if the graveyard contains a tombstone for the given index.context()
diff
(Metadata.Custom previous) Returns serializable object representing differences between this and previousStateboolean
static IndexGraveyard
fromXContent
(org.opensearch.core.xcontent.XContentParser parser) org.opensearch.Version
Get the current unmodifiable index tombstone list.int
hashCode()
static NamedDiff
<Metadata.Custom> readDiffFrom
(org.opensearch.core.common.io.stream.StreamInput in) toString()
org.opensearch.core.xcontent.XContentBuilder
toXContent
(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) void
writeTo
(org.opensearch.core.common.io.stream.StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensearch.cluster.ClusterState.FeatureAware
getRequiredFeature
Methods inherited from interface org.opensearch.core.xcontent.ToXContentFragment
isFragment
-
Field Details
-
SETTING_MAX_TOMBSTONES
Setting for the maximum tombstones allowed in the cluster state; prevents the cluster state size from exploding too large, but it opens the very unlikely risk that if there are greater than MAX_TOMBSTONES index deletions while a node was offline, when it comes back online, it will have missed index deletions that it may need to process. -
TYPE
- See Also:
-
-
Constructor Details
-
IndexGraveyard
- Throws:
IOException
-
-
Method Details
-
getWriteableName
- Specified by:
getWriteableName
in interfaceorg.opensearch.core.common.io.stream.NamedWriteable
- Specified by:
getWriteableName
in interfaceorg.opensearch.core.common.io.stream.VersionedNamedWriteable
-
getMinimalSupportedVersion
public org.opensearch.Version getMinimalSupportedVersion()- Specified by:
getMinimalSupportedVersion
in interfaceorg.opensearch.core.common.io.stream.VersionedNamedWriteable
-
context
- Specified by:
context
in interfaceMetadata.Custom
-
equals
-
hashCode
public int hashCode() -
getTombstones
Get the current unmodifiable index tombstone list. -
containsIndex
public boolean containsIndex(org.opensearch.core.index.Index index) Returns true if the graveyard contains a tombstone for the given index. -
toXContent
public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceorg.opensearch.core.xcontent.ToXContent
- Throws:
IOException
-
fromXContent
public static IndexGraveyard fromXContent(org.opensearch.core.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
toString
-
writeTo
- Specified by:
writeTo
in interfaceorg.opensearch.core.common.io.stream.Writeable
- Throws:
IOException
-
diff
Description copied from interface:Diffable
Returns serializable object representing differences between this and previousState- Specified by:
diff
in interfaceDiffable<Metadata.Custom>
-
readDiffFrom
public static NamedDiff<Metadata.Custom> readDiffFrom(org.opensearch.core.common.io.stream.StreamInput in) throws IOException - Throws:
IOException
-
builder
-
builder
-