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 
    Modifier and Type Class Description
    static class  DataStream.TimestampField  

    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 java.lang.String BACKING_INDEX_PREFIX  
    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, DataStream.TimestampField timeStampField, java.util.List<Index> indices)  
    DataStream​(java.lang.String name, DataStream.TimestampField 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 getDefaultBackingIndexName​(java.lang.String dataStreamName, long generation)
    Generates the name of the index that conforms to the default 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()  
    DataStream.TimestampField 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 replaceBackingIndex​(Index existingBackingIndex, Index newBackingIndex)
    Replaces the specified backing index with a new index and returns a new DataStream instance with the modified 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

  • Constructor Details

  • Method Details

    • getName

      public java.lang.String getName()
    • getTimeStampField

      public DataStream.TimestampField 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 getDefaultBackingIndexName(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
    • replaceBackingIndex

      public DataStream replaceBackingIndex​(Index existingBackingIndex, Index newBackingIndex)
      Replaces the specified backing index with a new index and returns a new DataStream instance with the modified backing indices. An IllegalArgumentException is thrown if the index to be replaced is not a backing index for this data stream or if it is the DataStream's write index.
      Parameters:
      existingBackingIndex - the backing index to be replaced
      newBackingIndex - the new index that will be part of the DataStream
      Returns:
      new DataStream instance with backing indices that contain replacement index instead of the specified existing index.
    • getDefaultBackingIndexName

      public static java.lang.String getDefaultBackingIndexName​(java.lang.String dataStreamName, long generation)
      Generates the name of the index that conforms to the default 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