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 Classes
    Modifier and Type
    Class
    Description
    static 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

    Fields
    Modifier and Type
    Field
    Description
    static final Setting<Integer>
    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.
    static final String
     

    Fields inherited from interface org.opensearch.core.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    IndexGraveyard(org.opensearch.core.common.io.stream.StreamInput in)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    boolean
    containsIndex(org.opensearch.core.index.Index index)
    Returns true if the graveyard contains a tombstone for the given index.
     
    Returns serializable object representing differences between this and previousState
    boolean
     
    fromXContent(org.opensearch.core.xcontent.XContentParser parser)
     
    org.opensearch.Version
     
    Get the current unmodifiable index tombstone list.
     
    int
     
    readDiffFrom(org.opensearch.core.common.io.stream.StreamInput in)
     
     
    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

      public static final Setting<Integer> 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

      public static final String TYPE
      See Also:
  • Constructor Details

    • IndexGraveyard

      public IndexGraveyard(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface org.opensearch.core.common.io.stream.NamedWriteable
      Specified by:
      getWriteableName in interface org.opensearch.core.common.io.stream.VersionedNamedWriteable
    • getMinimalSupportedVersion

      public org.opensearch.Version getMinimalSupportedVersion()
      Specified by:
      getMinimalSupportedVersion in interface org.opensearch.core.common.io.stream.VersionedNamedWriteable
    • context

      public EnumSet<Metadata.XContentContext> context()
      Specified by:
      context in interface Metadata.Custom
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getTombstones

      public List<IndexGraveyard.Tombstone> 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 interface org.opensearch.core.xcontent.ToXContent
      Throws:
      IOException
    • fromXContent

      public static IndexGraveyard fromXContent(org.opensearch.core.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Throws:
      IOException
    • diff

      public Diff<Metadata.Custom> diff(Metadata.Custom previous)
      Description copied from interface: Diffable
      Returns serializable object representing differences between this and previousState
      Specified by:
      diff in interface Diffable<Metadata.Custom>
    • readDiffFrom

      public static NamedDiff<Metadata.Custom> readDiffFrom(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
    • builder

      public static IndexGraveyard.Builder builder()
    • builder

      public static IndexGraveyard.Builder builder(IndexGraveyard graveyard)