Module org.elasticsearch.server
Record Class DataStreamAutoShardingEvent
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.metadata.DataStreamAutoShardingEvent
- All Implemented Interfaces:
Diffable<DataStreamAutoShardingEvent>,SimpleDiffable<DataStreamAutoShardingEvent>,Writeable,ToXContent,ToXContentFragment
public record DataStreamAutoShardingEvent(String triggerIndexName, int targetNumberOfShards, long timestamp)
extends Record
implements SimpleDiffable<DataStreamAutoShardingEvent>, ToXContentFragment
Represents the last auto sharding event that occured for a data stream.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.SimpleDiffable
SimpleDiffable.CompleteDiff<T extends Diffable<T>>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 ConstructingObjectParser<DataStreamAutoShardingEvent, Void> static final ParseFieldstatic final ParseFieldFields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTYFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionDataStreamAutoShardingEvent(String triggerIndexName, int targetNumberOfShards, long timestamp) Creates an instance of aDataStreamAutoShardingEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static DataStreamAutoShardingEventfromXContent(XContentParser parser) final inthashCode()Returns a hash code value for this object.intReturns the value of thetargetNumberOfShardsrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) Returns the value of thetriggerIndexNamerecord component.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diffMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
TRIGGER_INDEX_NAME
-
TARGET_NUMBER_OF_SHARDS
-
EVENT_TIME
-
EVENT_TIME_MILLIS
-
PARSER
-
-
Constructor Details
-
DataStreamAutoShardingEvent
public DataStreamAutoShardingEvent(String triggerIndexName, int targetNumberOfShards, long timestamp) Creates an instance of aDataStreamAutoShardingEventrecord class.- Parameters:
triggerIndexName- the value for thetriggerIndexNamerecord componenttargetNumberOfShards- the value for thetargetNumberOfShardsrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
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
-
getTimeSinceLastAutoShardingEvent
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
triggerIndexName
Returns the value of thetriggerIndexNamerecord component.- Returns:
- the value of the
triggerIndexNamerecord component
-
targetNumberOfShards
public int targetNumberOfShards()Returns the value of thetargetNumberOfShardsrecord component.- Returns:
- the value of the
targetNumberOfShardsrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-