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.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseField
static final ParseField
static final ConstructingObjectParser<DataStreamAutoShardingEvent,
Void> static final ParseField
static final ParseField
Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTY
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionDataStreamAutoShardingEvent
(String triggerIndexName, int targetNumberOfShards, long timestamp) Creates an instance of aDataStreamAutoShardingEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static DataStreamAutoShardingEvent
fromXContent
(XContentParser parser) final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thetargetNumberOfShards
record component.long
Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, ToXContent.Params params) Returns the value of thetriggerIndexName
record component.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diff
Methods 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 aDataStreamAutoShardingEvent
record class.- Parameters:
triggerIndexName
- the value for thetriggerIndexName
record componenttargetNumberOfShards
- the value for thetargetNumberOfShards
record componenttimestamp
- the value for thetimestamp
record component
-
-
Method Details
-
fromXContent
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in 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 thetriggerIndexName
record component.- Returns:
- the value of the
triggerIndexName
record component
-
targetNumberOfShards
public int targetNumberOfShards()Returns the value of thetargetNumberOfShards
record component.- Returns:
- the value of the
targetNumberOfShards
record component
-
timestamp
public long timestamp()Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-