Class DataStream

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

public final class DataStream
extends AbstractDiffable<DataStream>
implements org.elasticsearch.common.xcontent.ToXContentObject
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    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 org.elasticsearch.common.ParseField GENERATION_FIELD  
    static org.elasticsearch.common.ParseField INDICES_FIELD  
    static org.elasticsearch.common.ParseField NAME_FIELD  
    static org.elasticsearch.common.ParseField TIMESTAMP_FIELD_FIELD  

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors 
    Constructor Description
    DataStream​(java.lang.String name, java.lang.String timeStampField, java.util.List<Index> indices)  
    DataStream​(java.lang.String name, java.lang.String timeStampField, java.util.List<Index> indices, long generation)  
    DataStream​(StreamInput in)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    static DataStream fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)  
    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.
    long getGeneration()  
    java.util.List<Index> getIndices()  
    java.lang.String getName()  
    java.lang.String getTimeStampField()  
    int hashCode()  
    static Diff<DataStream> readDiffFrom​(StreamInput in)  
    DataStream removeBackingIndex​(Index index)
    Removes the specified backing index and returns a new DataStream instance with the remaining backing indices.
    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.
    org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  
    void writeTo​(StreamOutput out)
    Write this into the StreamOutput.

    Methods inherited from class org.elasticsearch.cluster.AbstractDiffable

    diff, get, readDiffFrom

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject

    isFragment
  • Field Details

    • NAME_FIELD

      public static final org.elasticsearch.common.ParseField NAME_FIELD
    • TIMESTAMP_FIELD_FIELD

      public static final org.elasticsearch.common.ParseField TIMESTAMP_FIELD_FIELD
    • INDICES_FIELD

      public static final org.elasticsearch.common.ParseField INDICES_FIELD
    • GENERATION_FIELD

      public static final org.elasticsearch.common.ParseField GENERATION_FIELD
  • 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​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.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