Class DataStreamAlias
java.lang.Object
org.elasticsearch.cluster.AbstractDiffable<DataStreamAlias>
org.elasticsearch.cluster.metadata.DataStreamAlias
- All Implemented Interfaces:
Diffable<DataStreamAlias>,Writeable,ToXContent,ToXContentFragment
public class DataStreamAlias
extends AbstractDiffable<DataStreamAlias>
implements ToXContentFragment
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.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
FieldsModifier and TypeFieldDescriptionstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanstatic DataStreamAliasfromXContent(XContentParser parser) Returns the data streams that are referencedgetName()Returns the name of this data stream alias.Returns the write data stream this data stream alias is referring to.inthashCode()Returns a newDataStreamAliasinstance that contains a new intersection of data streams from this instance and the provided filter.merge(DataStreamAlias other) Returns a newDataStreamAliasinstance containing data streams referenced in this instance and the other instance.static Diff<DataStreamAlias>removeDataStream(String dataStream) Returns aDataStreamAliasinstance based on this instance but with the specified data stream no longer referenced.renameDataStreams(String renamePattern, String renameReplacement) Returns a new instance with potentially renamed data stream names and write data stream name.toString()toXContent(XContentBuilder builder, ToXContent.Params params) Returns a newDataStreamAliasinstance with the provided data stream name added to it as a new member.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.cluster.AbstractDiffable
diff, readDiffFromMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
DATA_STREAMS_FIELD
-
WRITE_DATA_STREAM_FIELD
-
FILTER_FIELD
-
-
Constructor Details
-
DataStreamAlias
-
DataStreamAlias
- Throws:
IOException
-
-
Method Details
-
getName
Returns the name of this data stream alias. -
getDataStreams
Returns the data streams that are referenced -
getWriteDataStream
Returns the write data stream this data stream alias is referring to. Write requests targeting this instance will resolve the write index of the write data stream this alias is referring to. Note that the write data stream is also included ingetDataStreams(). -
getFilter
-
filteringRequired
public boolean filteringRequired() -
update
public DataStreamAlias update(String dataStream, Boolean isWriteDataStream, Map<String, Object> filterAsMap) Returns a newDataStreamAliasinstance with the provided data stream name added to it as a new member. If the provided isWriteDataStream is set totruethen the provided data stream is also set as write data stream. If the provided isWriteDataStream is set tofalseand the provided data stream is also the write data stream of this instance then the returned data stream alias instance's write data stream is unset. If the provided filter is the same as the filter of this alias then this instance isn't updated, otherwise it is updated. The same instance is returned if the attempted addition of the provided data stream didn't change this instance. -
removeDataStream
Returns aDataStreamAliasinstance based on this instance but with the specified data stream no longer referenced. Returnsnullif because of the removal of the provided data stream name a new instance wouldn't reference to any data stream. The same instance is returned if the attempted removal of the provided data stream didn't change this instance. -
intersect
Returns a newDataStreamAliasinstance that contains a new intersection of data streams from this instance and the provided filter. The write data stream gets set to null in the returned instance if the write data stream no longer appears in the intersection. -
merge
Returns a newDataStreamAliasinstance containing data streams referenced in this instance and the other instance. If this instance doesn't have a write data stream then the write index of the other data stream becomes the write data stream of the returned instance. -
renameDataStreams
Returns a new instance with potentially renamed data stream names and write data stream name. If a data stream name matches with the provided rename pattern then it is renamed according to the provided rename replacement. -
readDiffFrom
- Throws:
IOException
-
fromXContent
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-