@@ -143,7 +143,7 @@ public static boolean isDataStreamsLifecycleOnlyMode(final Settings settings) {
143143 @ Nullable
144144 private final TimeValue dataRetention ;
145145 @ Nullable
146- private final List <DownsamplingRound > downsampling ;
146+ private final List <DownsamplingRound > downsamplingRounds ;
147147
148148 /**
149149 * This constructor is visible for testing, please use {@link DataStreamLifecycle#createDataLifecycle(Boolean, TimeValue, List)} or
@@ -153,16 +153,16 @@ public static boolean isDataStreamsLifecycleOnlyMode(final Settings settings) {
153153 LifecycleType lifecycleType ,
154154 @ Nullable Boolean enabled ,
155155 @ Nullable TimeValue dataRetention ,
156- @ Nullable List <DownsamplingRound > downsampling
156+ @ Nullable List <DownsamplingRound > downsamplingRounds
157157 ) {
158158 this .lifecycleType = lifecycleType ;
159159 this .enabled = enabled == null || enabled ;
160160 this .dataRetention = dataRetention ;
161- if (lifecycleType == LifecycleType .FAILURES && downsampling != null ) {
161+ if (lifecycleType == LifecycleType .FAILURES && downsamplingRounds != null ) {
162162 throw new IllegalArgumentException (DOWNSAMPLING_NOT_SUPPORTED_ERROR_MESSAGE );
163163 }
164- DownsamplingRound .validateRounds (downsampling );
165- this .downsampling = downsampling ;
164+ DownsamplingRound .validateRounds (downsamplingRounds );
165+ this .downsamplingRounds = downsamplingRounds ;
166166 }
167167
168168 /**
@@ -308,8 +308,8 @@ public void addWarningHeaderIfDataRetentionNotEffective(
308308 * not configured then it returns null.
309309 */
310310 @ Nullable
311- public List <DownsamplingRound > downsampling () {
312- return downsampling ;
311+ public List <DownsamplingRound > downsamplingRounds () {
312+ return downsamplingRounds ;
313313 }
314314
315315 @ Override
@@ -320,13 +320,13 @@ public boolean equals(Object o) {
320320 final DataStreamLifecycle that = (DataStreamLifecycle ) o ;
321321 return lifecycleType == that .lifecycleType
322322 && Objects .equals (dataRetention , that .dataRetention )
323- && Objects .equals (downsampling , that .downsampling )
323+ && Objects .equals (downsamplingRounds , that .downsamplingRounds )
324324 && enabled == that .enabled ;
325325 }
326326
327327 @ Override
328328 public int hashCode () {
329- return Objects .hash (lifecycleType , enabled , dataRetention , downsampling );
329+ return Objects .hash (lifecycleType , enabled , dataRetention , downsamplingRounds );
330330 }
331331
332332 @ Override
@@ -341,9 +341,9 @@ public void writeTo(StreamOutput out) throws IOException {
341341 }
342342 if (out .getTransportVersion ().onOrAfter (ADDED_ENABLED_FLAG_VERSION )) {
343343 if (out .getTransportVersion ().supports (INTRODUCE_LIFECYCLE_TEMPLATE )) {
344- out .writeOptionalCollection (downsampling );
344+ out .writeOptionalCollection (downsamplingRounds );
345345 } else {
346- writeLegacyOptionalValue (downsampling , out , StreamOutput ::writeCollection );
346+ writeLegacyOptionalValue (downsamplingRounds , out , StreamOutput ::writeCollection );
347347 }
348348 out .writeBoolean (enabled ());
349349 }
@@ -364,13 +364,13 @@ public DataStreamLifecycle(StreamInput in) throws IOException {
364364 }
365365 if (in .getTransportVersion ().onOrAfter (ADDED_ENABLED_FLAG_VERSION )) {
366366 if (in .getTransportVersion ().supports (INTRODUCE_LIFECYCLE_TEMPLATE )) {
367- downsampling = in .readOptionalCollectionAsList (DownsamplingRound ::read );
367+ downsamplingRounds = in .readOptionalCollectionAsList (DownsamplingRound ::read );
368368 } else {
369- downsampling = readLegacyOptionalValue (in , is -> is .readCollectionAsList (DownsamplingRound ::read ));
369+ downsamplingRounds = readLegacyOptionalValue (in , is -> is .readCollectionAsList (DownsamplingRound ::read ));
370370 }
371371 enabled = in .readBoolean ();
372372 } else {
373- downsampling = null ;
373+ downsamplingRounds = null ;
374374 enabled = true ;
375375 }
376376 lifecycleType = in .getTransportVersion ().supports (INTRODUCE_FAILURES_LIFECYCLE ) ? LifecycleType .read (in ) : LifecycleType .DATA ;
@@ -426,8 +426,8 @@ public String toString() {
426426 + enabled
427427 + ", dataRetention="
428428 + dataRetention
429- + ", downsampling ="
430- + downsampling
429+ + ", downsamplingRounds ="
430+ + downsamplingRounds
431431 + '}' ;
432432 }
433433
@@ -466,8 +466,8 @@ public XContentBuilder toXContent(
466466 }
467467 }
468468
469- if (downsampling != null ) {
470- builder .field (DOWNSAMPLING_FIELD .getPreferredName (), downsampling );
469+ if (downsamplingRounds != null ) {
470+ builder .field (DOWNSAMPLING_FIELD .getPreferredName (), downsamplingRounds );
471471 }
472472 if (rolloverConfiguration != null ) {
473473 builder .field (ROLLOVER_FIELD .getPreferredName ());
@@ -667,7 +667,7 @@ public record Template(
667667 LifecycleType lifecycleType ,
668668 boolean enabled ,
669669 ResettableValue <TimeValue > dataRetention ,
670- ResettableValue <List <DataStreamLifecycle .DownsamplingRound >> downsampling
670+ ResettableValue <List <DataStreamLifecycle .DownsamplingRound >> downsamplingRounds
671671 ) implements ToXContentObject , Writeable {
672672
673673 Template (
@@ -680,11 +680,11 @@ public record Template(
680680 }
681681
682682 public Template {
683- if (lifecycleType == LifecycleType .FAILURES && downsampling .get () != null ) {
683+ if (lifecycleType == LifecycleType .FAILURES && downsamplingRounds .get () != null ) {
684684 throw new IllegalArgumentException (DOWNSAMPLING_NOT_SUPPORTED_ERROR_MESSAGE );
685685 }
686- if (downsampling .isDefined () && downsampling .get () != null ) {
687- DownsamplingRound .validateRounds (downsampling .get ());
686+ if (downsamplingRounds .isDefined () && downsamplingRounds .get () != null ) {
687+ DownsamplingRound .validateRounds (downsamplingRounds .get ());
688688 }
689689 }
690690
@@ -736,9 +736,9 @@ public void writeTo(StreamOutput out) throws IOException {
736736 }
737737 if (out .getTransportVersion ().onOrAfter (ADDED_ENABLED_FLAG_VERSION )) {
738738 if (out .getTransportVersion ().supports (INTRODUCE_LIFECYCLE_TEMPLATE )) {
739- ResettableValue .write (out , downsampling , StreamOutput ::writeCollection );
739+ ResettableValue .write (out , downsamplingRounds , StreamOutput ::writeCollection );
740740 } else {
741- writeLegacyValue (out , downsampling , StreamOutput ::writeCollection );
741+ writeLegacyValue (out , downsamplingRounds , StreamOutput ::writeCollection );
742742 }
743743 out .writeBoolean (enabled );
744744 }
@@ -839,7 +839,7 @@ public XContentBuilder toXContent(
839839 builder .startObject ();
840840 builder .field (ENABLED_FIELD .getPreferredName (), enabled );
841841 dataRetention .toXContent (builder , params , DATA_RETENTION_FIELD .getPreferredName (), TimeValue ::getStringRep );
842- downsampling .toXContent (builder , params , DOWNSAMPLING_FIELD .getPreferredName ());
842+ downsamplingRounds .toXContent (builder , params , DOWNSAMPLING_FIELD .getPreferredName ());
843843 if (rolloverConfiguration != null ) {
844844 builder .field (ROLLOVER_FIELD .getPreferredName ());
845845 rolloverConfiguration .evaluateAndConvertToXContent (
@@ -853,7 +853,7 @@ public XContentBuilder toXContent(
853853 }
854854
855855 public DataStreamLifecycle toDataStreamLifecycle () {
856- return new DataStreamLifecycle (lifecycleType , enabled , dataRetention .get (), downsampling .get ());
856+ return new DataStreamLifecycle (lifecycleType , enabled , dataRetention .get (), downsamplingRounds .get ());
857857 }
858858 }
859859
@@ -890,7 +890,7 @@ public static class Builder {
890890 @ Nullable
891891 private TimeValue dataRetention = null ;
892892 @ Nullable
893- private List <DownsamplingRound > downsampling = null ;
893+ private List <DownsamplingRound > downsamplingRounds = null ;
894894
895895 private Builder (LifecycleType lifecycleType ) {
896896 this .lifecycleType = lifecycleType ;
@@ -900,21 +900,21 @@ private Builder(DataStreamLifecycle.Template template) {
900900 lifecycleType = template .lifecycleType ();
901901 enabled = template .enabled ();
902902 dataRetention = template .dataRetention ().get ();
903- downsampling = template .downsampling ().get ();
903+ downsamplingRounds = template .downsamplingRounds ().get ();
904904 }
905905
906906 private Builder (DataStreamLifecycle lifecycle ) {
907907 lifecycleType = lifecycle .lifecycleType ;
908908 enabled = lifecycle .enabled ();
909909 dataRetention = lifecycle .dataRetention ();
910- downsampling = lifecycle .downsampling ();
910+ downsamplingRounds = lifecycle .downsamplingRounds ();
911911 }
912912
913913 public Builder composeTemplate (DataStreamLifecycle .Template template ) {
914914 assert lifecycleType == template .lifecycleType () : "Trying to compose templates with different lifecycle types" ;
915915 enabled (template .enabled ());
916916 dataRetention (template .dataRetention ());
917- downsampling (template .downsampling ());
917+ downsamplingRounds (template .downsamplingRounds ());
918918 return this ;
919919 }
920920
@@ -935,24 +935,24 @@ public Builder dataRetention(@Nullable TimeValue dataRetention) {
935935 return this ;
936936 }
937937
938- public Builder downsampling (ResettableValue <List <DownsamplingRound >> downsampling ) {
938+ public Builder downsamplingRounds (ResettableValue <List <DownsamplingRound >> downsampling ) {
939939 if (downsampling .isDefined ()) {
940- this .downsampling = downsampling .get ();
940+ this .downsamplingRounds = downsampling .get ();
941941 }
942942 return this ;
943943 }
944944
945- public Builder downsampling (@ Nullable List <DownsamplingRound > downsampling ) {
946- this .downsampling = downsampling ;
945+ public Builder downsamplingRounds (@ Nullable List <DownsamplingRound > downsampling ) {
946+ this .downsamplingRounds = downsampling ;
947947 return this ;
948948 }
949949
950950 public DataStreamLifecycle build () {
951- return new DataStreamLifecycle (lifecycleType , enabled , dataRetention , downsampling );
951+ return new DataStreamLifecycle (lifecycleType , enabled , dataRetention , downsamplingRounds );
952952 }
953953
954954 public Template buildTemplate () {
955- return new Template (lifecycleType , enabled , dataRetention , downsampling );
955+ return new Template (lifecycleType , enabled , dataRetention , downsamplingRounds );
956956 }
957957 }
958958
0 commit comments