Skip to content

Commit 3bbe9ed

Browse files
committed
fixed more compile errors
1 parent 545ce95 commit 3bbe9ed

File tree

5 files changed

+24
-21
lines changed

5 files changed

+24
-21
lines changed

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleServiceIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ public void testLifecycleAppliedToFailureStore() throws Exception {
10381038
List.of(
10391039
new DataStreamLifecycle.Downsampling.Round(
10401040
TimeValue.timeValueMillis(10),
1041-
new DownsampleConfig(new DateHistogramInterval("10m"))
1041+
new DownsampleConfig(new DateHistogramInterval("10m"), null)
10421042
)
10431043
)
10441044
)

modules/data-streams/src/test/java/org/elasticsearch/datastreams/MetadataIndexTemplateServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ private static DataStreamLifecycle.Downsampling randomNonEmptyDownsampling() {
257257
List<DataStreamLifecycle.Downsampling.Round> rounds = new ArrayList<>();
258258
var previous = new DataStreamLifecycle.Downsampling.Round(
259259
TimeValue.timeValueDays(randomIntBetween(1, 365)),
260-
new DownsampleConfig(new DateHistogramInterval(randomIntBetween(1, 24) + "h"))
260+
new DownsampleConfig(new DateHistogramInterval(randomIntBetween(1, 24) + "h"), null)
261261
);
262262
rounds.add(previous);
263263
for (int i = 0; i < count; i++) {
@@ -271,7 +271,7 @@ private static DataStreamLifecycle.Downsampling randomNonEmptyDownsampling() {
271271
private static DataStreamLifecycle.Downsampling.Round nextRound(DataStreamLifecycle.Downsampling.Round previous) {
272272
var after = TimeValue.timeValueDays(previous.after().days() + randomIntBetween(1, 10));
273273
var fixedInterval = new DownsampleConfig(
274-
new DateHistogramInterval((previous.config().getFixedInterval().estimateMillis() * randomIntBetween(2, 5)) + "ms")
274+
new DateHistogramInterval((previous.config().getFixedInterval().estimateMillis() * randomIntBetween(2, 5)) + "ms"), null
275275
);
276276
return new DataStreamLifecycle.Downsampling.Round(after, fixedInterval);
277277
}

modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ public void testDownsamplingWhenTargetIndexNameClashYieldsException() throws Exc
13651365
DataStreamLifecycle.newBuilder()
13661366
.downsampling(
13671367
new Downsampling(
1368-
List.of(new Round(TimeValue.timeValueMillis(0), new DownsampleConfig(new DateHistogramInterval("5m"))))
1368+
List.of(new Round(TimeValue.timeValueMillis(0), new DownsampleConfig(new DateHistogramInterval("5m"), null)))
13691369
)
13701370
)
13711371
.dataRetention(TimeValue.MAX_VALUE)
@@ -1616,7 +1616,7 @@ private ClusterState downsampleSetup(String dataStreamName, IndexMetadata.Downsa
16161616
DataStreamLifecycle.newBuilder()
16171617
.downsampling(
16181618
new Downsampling(
1619-
List.of(new Round(TimeValue.timeValueMillis(0), new DownsampleConfig(new DateHistogramInterval("5m"))))
1619+
List.of(new Round(TimeValue.timeValueMillis(0), new DownsampleConfig(new DateHistogramInterval("5m"), null)))
16201620
)
16211621
)
16221622
.dataRetention(TimeValue.timeValueMillis(1))

server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamLifecycleTests.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ public void testInvalidDownsamplingConfiguration() {
182182
List.of(
183183
new DataStreamLifecycle.Downsampling.Round(
184184
TimeValue.timeValueDays(10),
185-
new DownsampleConfig(new DateHistogramInterval("2h"))
185+
new DownsampleConfig(new DateHistogramInterval("2h"), null)
186186
),
187187
new DataStreamLifecycle.Downsampling.Round(
188188
TimeValue.timeValueDays(3),
189-
new DownsampleConfig(new DateHistogramInterval("2h"))
189+
new DownsampleConfig(new DateHistogramInterval("2h"), null)
190190
)
191191
)
192192
)
@@ -203,11 +203,11 @@ public void testInvalidDownsamplingConfiguration() {
203203
List.of(
204204
new DataStreamLifecycle.Downsampling.Round(
205205
TimeValue.timeValueDays(10),
206-
new DownsampleConfig(new DateHistogramInterval("2h"))
206+
new DownsampleConfig(new DateHistogramInterval("2h"), null)
207207
),
208208
new DataStreamLifecycle.Downsampling.Round(
209209
TimeValue.timeValueDays(30),
210-
new DownsampleConfig(new DateHistogramInterval("2h"))
210+
new DownsampleConfig(new DateHistogramInterval("2h"), null)
211211
)
212212
)
213213
)
@@ -221,11 +221,11 @@ public void testInvalidDownsamplingConfiguration() {
221221
List.of(
222222
new DataStreamLifecycle.Downsampling.Round(
223223
TimeValue.timeValueDays(10),
224-
new DownsampleConfig(new DateHistogramInterval("2h"))
224+
new DownsampleConfig(new DateHistogramInterval("2h"), null)
225225
),
226226
new DataStreamLifecycle.Downsampling.Round(
227227
TimeValue.timeValueDays(30),
228-
new DownsampleConfig(new DateHistogramInterval("3h"))
228+
new DownsampleConfig(new DateHistogramInterval("3h"), null)
229229
)
230230
)
231231
)
@@ -248,7 +248,7 @@ public void testInvalidDownsamplingConfiguration() {
248248
.map(
249249
i -> new DataStreamLifecycle.Downsampling.Round(
250250
TimeValue.timeValueDays(i),
251-
new DownsampleConfig(new DateHistogramInterval(i + "h"))
251+
new DownsampleConfig(new DateHistogramInterval(i + "h"), randomBoolean() ? null : randomIntBetween(-1, 128))
252252
)
253253
)
254254
.toList()
@@ -264,7 +264,7 @@ public void testInvalidDownsamplingConfiguration() {
264264
List.of(
265265
new DataStreamLifecycle.Downsampling.Round(
266266
TimeValue.timeValueDays(10),
267-
new DownsampleConfig(new DateHistogramInterval("2m"))
267+
new DownsampleConfig(new DateHistogramInterval("2m"), null)
268268
)
269269
)
270270
)
@@ -420,9 +420,10 @@ static DataStreamLifecycle.Downsampling randomDownsampling() {
420420
default -> {
421421
var count = randomIntBetween(0, 9);
422422
List<DataStreamLifecycle.Downsampling.Round> rounds = new ArrayList<>();
423+
Integer forceMergeMaxNumSegments = randomBoolean() ? null : randomIntBetween(-1, 128);
423424
var previous = new DataStreamLifecycle.Downsampling.Round(
424425
randomTimeValue(1, 365, TimeUnit.DAYS),
425-
new DownsampleConfig(new DateHistogramInterval(randomIntBetween(1, 24) + "h"))
426+
new DownsampleConfig(new DateHistogramInterval(randomIntBetween(1, 24) + "h"), forceMergeMaxNumSegments)
426427
);
427428
rounds.add(previous);
428429
for (int i = 0; i < count; i++) {
@@ -437,8 +438,10 @@ static DataStreamLifecycle.Downsampling randomDownsampling() {
437438

438439
private static DataStreamLifecycle.Downsampling.Round nextRound(DataStreamLifecycle.Downsampling.Round previous) {
439440
var after = TimeValue.timeValueDays(previous.after().days() + randomIntBetween(1, 10));
441+
Integer forceMergeMaxNumSegments = randomBoolean() ? null : randomIntBetween(-1, 128);
440442
var fixedInterval = new DownsampleConfig(
441-
new DateHistogramInterval((previous.config().getFixedInterval().estimateMillis() * randomIntBetween(2, 5)) + "ms")
443+
new DateHistogramInterval((previous.config().getFixedInterval().estimateMillis() * randomIntBetween(2, 5)) + "ms"),
444+
forceMergeMaxNumSegments
442445
);
443446
return new DataStreamLifecycle.Downsampling.Round(after, fixedInterval);
444447
}

server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,15 +1647,15 @@ public void testGetDownsampleRounds() {
16471647
List.of(
16481648
new DataStreamLifecycle.Downsampling.Round(
16491649
TimeValue.timeValueMillis(2000),
1650-
new DownsampleConfig(new DateHistogramInterval("10m"))
1650+
new DownsampleConfig(new DateHistogramInterval("10m"), null)
16511651
),
16521652
new DataStreamLifecycle.Downsampling.Round(
16531653
TimeValue.timeValueMillis(3200),
1654-
new DownsampleConfig(new DateHistogramInterval("100m"))
1654+
new DownsampleConfig(new DateHistogramInterval("100m"), null)
16551655
),
16561656
new DataStreamLifecycle.Downsampling.Round(
16571657
TimeValue.timeValueMillis(3500),
1658-
new DownsampleConfig(new DateHistogramInterval("1000m"))
1658+
new DownsampleConfig(new DateHistogramInterval("1000m"), null)
16591659
)
16601660
)
16611661
)
@@ -1708,15 +1708,15 @@ public void testGetDownsampleRounds() {
17081708
List.of(
17091709
new DataStreamLifecycle.Downsampling.Round(
17101710
TimeValue.timeValueMillis(2000),
1711-
new DownsampleConfig(new DateHistogramInterval("10m"))
1711+
new DownsampleConfig(new DateHistogramInterval("10m"), null)
17121712
),
17131713
new DataStreamLifecycle.Downsampling.Round(
17141714
TimeValue.timeValueMillis(3200),
1715-
new DownsampleConfig(new DateHistogramInterval("100m"))
1715+
new DownsampleConfig(new DateHistogramInterval("100m"), null)
17161716
),
17171717
new DataStreamLifecycle.Downsampling.Round(
17181718
TimeValue.timeValueMillis(3500),
1719-
new DownsampleConfig(new DateHistogramInterval("1000m"))
1719+
new DownsampleConfig(new DateHistogramInterval("1000m"), null)
17201720
)
17211721
)
17221722
)

0 commit comments

Comments
 (0)