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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested 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 ParseFieldGENERATION_FIELDstatic ParseFieldINDICES_FIELDstatic ParseFieldNAME_FIELDstatic ParseFieldTIMESTAMP_FIELD_FIELD -
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 booleanequals(java.lang.Object o)static DataStreamfromXContent(XContentParser parser)static java.lang.StringgetBackingIndexName(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.longgetGeneration()java.util.List<Index>getIndices()java.lang.StringgetName()java.lang.StringgetTimeStampField()inthashCode()static Diff<DataStream>readDiffFrom(StreamInput in)DataStreamremoveBackingIndex(Index index)Removes the specified backing index and returns a newDataStreaminstance with the remaining backing indices.DataStreamrollover(Index newWriteIndex)Performs a rollover on aDataStreaminstance and returns a new instance containing the updated list of backing indices and incremented generation.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.
-
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
- Throws:
java.io.IOException
-
-
Method Details
-
getName
public java.lang.String getName() -
getTimeStampField
public java.lang.String getTimeStampField() -
getIndices
-
getGeneration
public long getGeneration() -
rollover
Performs a rollover on aDataStreaminstance 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. SeegetBackingIndexName(java.lang.String, long).- Returns:
- new
DataStreaminstance with the rollover operation applied
-
removeBackingIndex
Removes the specified backing index and returns a newDataStreaminstance with the remaining backing indices.- Parameters:
index- the backing index to remove- Returns:
- new
DataStreaminstance 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 streamgeneration- generation of the data stream- Returns:
- backing index name
-
readDiffFrom
- Throws:
java.io.IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
fromXContent
- Throws:
java.io.IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-