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
-
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 newDataStream
instance with the remaining backing indices.DataStream
rollover(Index newWriteIndex)
Performs a rollover on aDataStream
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.
-
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
- 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 aDataStream
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. SeegetBackingIndexName(java.lang.String, long)
.- Returns:
- new
DataStream
instance with the rollover operation applied
-
removeBackingIndex
Removes the specified backing index and returns a newDataStream
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 streamgeneration
- generation of the data stream- Returns:
- backing index name
-
readDiffFrom
- Throws:
java.io.IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
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 interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-