Class DataStream

java.lang.Object
org.elasticsearch.cluster.AbstractDiffable<DataStream>
org.elasticsearch.cluster.metadata.DataStream
All Implemented Interfaces:
Diffable<DataStream>, Writeable, ToXContent, ToXContentObject

public final class DataStream
extends AbstractDiffable<DataStream>
implements ToXContentObject
  • Field Details

  • Constructor Details

    • DataStream

      public DataStream​(java.lang.String name, java.lang.String timeStampField, java.util.List<Index> indices, long generation)
    • DataStream

      public DataStream​(java.lang.String name, java.lang.String timeStampField, java.util.List<Index> indices)
    • DataStream

      public DataStream​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • getName

      public java.lang.String getName()
    • getTimeStampField

      public java.lang.String getTimeStampField()
    • getIndices

      public java.util.List<Index> getIndices()
    • getGeneration

      public long getGeneration()
    • rollover

      public DataStream rollover​(Index newWriteIndex)
      Performs a rollover on a DataStream instance and returns a new instance containing the updated list of backing indices and incremented generation.
      Parameters:
      newWriteIndex - the new write backing index. Must conform to the naming convention for backing indices on data streams. See getBackingIndexName(java.lang.String, long).
      Returns:
      new DataStream instance with the rollover operation applied
    • removeBackingIndex

      public DataStream removeBackingIndex​(Index index)
      Removes the specified backing index and returns a new DataStream instance with the remaining backing indices.
      Parameters:
      index - the backing index to remove
      Returns:
      new DataStream instance with the remaining backing indices
    • getBackingIndexName

      public static java.lang.String getBackingIndexName​(java.lang.String dataStreamName, long generation)
      Generates the name of the index that conforms to the naming convention for backing indices on data streams given the specified data stream name and generation.
      Parameters:
      dataStreamName - name of the data stream
      generation - generation of the data stream
      Returns:
      backing index name
    • readDiffFrom

      public static Diff<DataStream> readDiffFrom​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      java.io.IOException
    • fromXContent

      public static DataStream fromXContent​(XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • toXContent

      public XContentBuilder toXContent​(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      java.io.IOException
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object