Skip to content

Commit a18a77f

Browse files
committed
fixed more compile errors
1 parent adc929c commit a18a77f

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

x-pack/plugin/downsample/src/test/java/org/elasticsearch/xpack/downsample/DownsampleActionSingleNodeTests.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public void setup() throws IOException {
270270
}
271271

272272
public void testDownsampleIndex() throws Exception {
273-
DownsampleConfig config = new DownsampleConfig(randomInterval());
273+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
274274
SourceSupplier sourceSupplier = () -> {
275275
String ts = randomDateForInterval(config.getInterval());
276276
double labelDoubleValue = DATE_FORMATTER.parseMillis(ts);
@@ -329,7 +329,7 @@ public void testDownsampleIndex() throws Exception {
329329
}
330330

331331
public void testDownsampleIndexWithFlattenedAndMultiFieldDimensions() throws Exception {
332-
DownsampleConfig config = new DownsampleConfig(randomInterval());
332+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
333333
SourceSupplier sourceSupplier = () -> {
334334
String ts = randomDateForInterval(config.getInterval());
335335
double labelDoubleValue = DATE_FORMATTER.parseMillis(ts);
@@ -366,7 +366,7 @@ public void testDownsampleIndexWithFlattenedAndMultiFieldDimensions() throws Exc
366366

367367
public void testDownsampleOfDownsample() throws Exception {
368368
int intervalMinutes = randomIntBetween(10, 120);
369-
DownsampleConfig config = new DownsampleConfig(DateHistogramInterval.minutes(intervalMinutes));
369+
DownsampleConfig config = new DownsampleConfig(DateHistogramInterval.minutes(intervalMinutes), null);
370370
SourceSupplier sourceSupplier = () -> {
371371
String ts = randomDateForInterval(config.getInterval());
372372
double labelDoubleValue = DATE_FORMATTER.parseMillis(ts);
@@ -402,7 +402,7 @@ public void testDownsampleOfDownsample() throws Exception {
402402

403403
// Downsample the downsample index. The downsampling interval is a multiple of the previous downsampling interval.
404404
String downsampleIndex2 = downsampleIndex + "-2";
405-
DownsampleConfig config2 = new DownsampleConfig(DateHistogramInterval.minutes(intervalMinutes * randomIntBetween(2, 50)));
405+
DownsampleConfig config2 = new DownsampleConfig(DateHistogramInterval.minutes(intervalMinutes * randomIntBetween(2, 50)), null);
406406
downsample(downsampleIndex, downsampleIndex2, config2);
407407
assertDownsampleIndex(downsampleIndex, downsampleIndex2, config2);
408408
}
@@ -436,7 +436,7 @@ public void testCopyIndexSettings() throws IOException {
436436
var updateSettingsReq = new UpdateSettingsRequest(settings, sourceIndex);
437437
assertAcked(indicesAdmin().updateSettings(updateSettingsReq).actionGet());
438438

439-
DownsampleConfig config = new DownsampleConfig(randomInterval());
439+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
440440
SourceSupplier sourceSupplier = () -> {
441441
String ts = randomDateForInterval(config.getInterval());
442442
return XContentFactory.jsonBuilder()
@@ -464,7 +464,7 @@ public void testCopyIndexSettings() throws IOException {
464464
}
465465

466466
public void testNullSourceIndexName() {
467-
DownsampleConfig config = new DownsampleConfig(randomInterval());
467+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
468468
ActionRequestValidationException exception = expectThrows(
469469
ActionRequestValidationException.class,
470470
() -> downsample(null, downsampleIndex, config)
@@ -473,7 +473,7 @@ public void testNullSourceIndexName() {
473473
}
474474

475475
public void testNullDownsampleIndexName() {
476-
DownsampleConfig config = new DownsampleConfig(randomInterval());
476+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
477477
ActionRequestValidationException exception = expectThrows(
478478
ActionRequestValidationException.class,
479479
() -> downsample(sourceIndex, null, config)
@@ -490,7 +490,7 @@ public void testNullDownsampleConfig() {
490490
}
491491

492492
public void testDownsampleSparseMetrics() throws Exception {
493-
DownsampleConfig config = new DownsampleConfig(randomInterval());
493+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
494494
SourceSupplier sourceSupplier = () -> {
495495
XContentBuilder builder = XContentFactory.jsonBuilder()
496496
.startObject()
@@ -511,7 +511,7 @@ public void testDownsampleSparseMetrics() throws Exception {
511511
}
512512

513513
public void testCannotDownsampleToExistingIndex() throws Exception {
514-
DownsampleConfig config = new DownsampleConfig(randomInterval());
514+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
515515
prepareSourceIndex(sourceIndex, true);
516516

517517
// Create an empty index with the same name as the downsample index
@@ -524,7 +524,7 @@ public void testCannotDownsampleToExistingIndex() throws Exception {
524524
}
525525

526526
public void testDownsampleEmptyIndex() throws Exception {
527-
DownsampleConfig config = new DownsampleConfig(randomInterval());
527+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
528528
// Source index has been created in the setup() method
529529
prepareSourceIndex(sourceIndex, true);
530530
downsample(sourceIndex, downsampleIndex, config);
@@ -551,21 +551,21 @@ public void testDownsampleIndexWithNoMetrics() throws Exception {
551551
)
552552
.get();
553553

554-
DownsampleConfig config = new DownsampleConfig(randomInterval());
554+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
555555
prepareSourceIndex(sourceIndex, true);
556556
downsample(sourceIndex, downsampleIndex, config);
557557
assertDownsampleIndex(sourceIndex, downsampleIndex, config);
558558
}
559559

560560
public void testCannotDownsampleWriteableIndex() {
561-
DownsampleConfig config = new DownsampleConfig(randomInterval());
561+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
562562
// Source index has been created in the setup() method and is empty and still writable
563563
Exception exception = expectThrows(ElasticsearchException.class, () -> downsample(sourceIndex, downsampleIndex, config));
564564
assertThat(exception.getMessage(), containsString("Downsample requires setting [index.blocks.write = true] for index"));
565565
}
566566

567567
public void testCannotDownsampleMissingIndex() {
568-
DownsampleConfig config = new DownsampleConfig(randomInterval());
568+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
569569
IndexNotFoundException exception = expectThrows(
570570
IndexNotFoundException.class,
571571
() -> downsample("missing-index", downsampleIndex, config)
@@ -575,7 +575,7 @@ public void testCannotDownsampleMissingIndex() {
575575
}
576576

577577
public void testCannotDownsampleWhileOtherDownsampleInProgress() throws Exception {
578-
DownsampleConfig config = new DownsampleConfig(randomInterval());
578+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
579579
SourceSupplier sourceSupplier = () -> XContentFactory.jsonBuilder()
580580
.startObject()
581581
.field(FIELD_TIMESTAMP, randomDateForInterval(config.getInterval()))
@@ -630,7 +630,7 @@ public void onFailure(Exception e) {
630630
}
631631

632632
public void testDownsampleDatastream() throws Exception {
633-
DownsampleConfig config = new DownsampleConfig(randomInterval());
633+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
634634
String dataStreamName = createDataStream();
635635

636636
final Instant now = Instant.now();
@@ -666,7 +666,7 @@ public void testDownsampleDatastream() throws Exception {
666666

667667
public void testCancelDownsampleIndexer() throws IOException {
668668
// create downsample config and index documents into source index
669-
DownsampleConfig config = new DownsampleConfig(randomInterval());
669+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
670670
SourceSupplier sourceSupplier = () -> XContentFactory.jsonBuilder()
671671
.startObject()
672672
.field(FIELD_TIMESTAMP, randomDateForInterval(config.getInterval()))
@@ -718,7 +718,7 @@ public void testCancelDownsampleIndexer() throws IOException {
718718

719719
public void testDownsampleBulkFailed() throws IOException {
720720
// create downsample config and index documents into source index
721-
DownsampleConfig config = new DownsampleConfig(randomInterval());
721+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
722722
SourceSupplier sourceSupplier = () -> XContentFactory.jsonBuilder()
723723
.startObject()
724724
.field(FIELD_TIMESTAMP, randomDateForInterval(config.getInterval()))
@@ -786,7 +786,7 @@ public void testDownsampleBulkFailed() throws IOException {
786786

787787
public void testTooManyBytesInFlight() throws IOException {
788788
// create downsample config and index documents into source index
789-
DownsampleConfig config = new DownsampleConfig(randomInterval());
789+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
790790
SourceSupplier sourceSupplier = () -> XContentFactory.jsonBuilder()
791791
.startObject()
792792
.field(FIELD_TIMESTAMP, randomDateForInterval(config.getInterval()))
@@ -840,7 +840,7 @@ public void testTooManyBytesInFlight() throws IOException {
840840

841841
public void testDownsampleStats() throws Exception {
842842
final PersistentTasksService persistentTasksService = mock(PersistentTasksService.class);
843-
final DownsampleConfig config = new DownsampleConfig(randomInterval());
843+
final DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
844844
final SourceSupplier sourceSupplier = () -> XContentFactory.jsonBuilder()
845845
.startObject()
846846
.field(FIELD_TIMESTAMP, randomDateForInterval(config.getInterval()))
@@ -897,7 +897,7 @@ public void testDownsampleStats() throws Exception {
897897

898898
public void testResumeDownsample() throws IOException {
899899
// create downsample config and index documents into source index
900-
DownsampleConfig config = new DownsampleConfig(randomInterval());
900+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
901901
SourceSupplier sourceSupplier = () -> XContentFactory.jsonBuilder()
902902
.startObject()
903903
.field(FIELD_TIMESTAMP, randomDateForInterval(config.getInterval()))
@@ -973,7 +973,7 @@ public void testResumeDownsample() throws IOException {
973973

974974
public void testResumeDownsamplePartial() throws IOException {
975975
// create downsample config and index documents into source index
976-
DownsampleConfig config = new DownsampleConfig(randomInterval());
976+
DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
977977
SourceSupplier sourceSupplier = () -> XContentFactory.jsonBuilder()
978978
.startObject()
979979
.field(FIELD_TIMESTAMP, randomDateForInterval(config.getInterval()))
@@ -1620,7 +1620,7 @@ private String createDataStream() throws Exception {
16201620
}
16211621

16221622
public void testConcurrentDownsample() throws Exception {
1623-
final DownsampleConfig config = new DownsampleConfig(randomInterval());
1623+
final DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
16241624
SourceSupplier sourceSupplier = () -> {
16251625
String ts = randomDateForInterval(config.getInterval());
16261626
double labelDoubleValue = DATE_FORMATTER.parseMillis(ts);
@@ -1699,7 +1699,7 @@ public void testConcurrentDownsample() throws Exception {
16991699
}
17001700

17011701
public void testDuplicateDownsampleRequest() throws Exception {
1702-
final DownsampleConfig config = new DownsampleConfig(randomInterval());
1702+
final DownsampleConfig config = new DownsampleConfig(randomInterval(), null);
17031703
SourceSupplier sourceSupplier = () -> {
17041704
String ts = randomDateForInterval(config.getInterval());
17051705
double labelDoubleValue = DATE_FORMATTER.parseMillis(ts);

x-pack/plugin/downsample/src/test/java/org/elasticsearch/xpack/downsample/DownsampleDataStreamTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void testDataStreamDownsample() throws ExecutionException, InterruptedExc
102102
rolloverResponse.getOldIndex(),
103103
downsampleTargetIndex,
104104
TIMEOUT,
105-
new DownsampleConfig(DateHistogramInterval.HOUR)
105+
new DownsampleConfig(DateHistogramInterval.HOUR, null)
106106
);
107107
final AcknowledgedResponse downsampleResponse = indicesAdmin().execute(DownsampleAction.INSTANCE, downsampleRequest).actionGet();
108108

x-pack/plugin/downsample/src/test/java/org/elasticsearch/xpack/downsample/DownsampleShardPersistentTaskExecutorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void testGetAssignment() {
7878
.build();
7979

8080
var params = new DownsampleShardTaskParams(
81-
new DownsampleConfig(new DateHistogramInterval("1h")),
81+
new DownsampleConfig(new DateHistogramInterval("1h"), null),
8282
shardId.getIndexName(),
8383
1,
8484
1,
@@ -110,7 +110,7 @@ public void testGetAssignmentMissingIndex() {
110110

111111
var missingShardId = new ShardId(new Index("another_index", "uid"), 0);
112112
var params = new DownsampleShardTaskParams(
113-
new DownsampleConfig(new DateHistogramInterval("1h")),
113+
new DownsampleConfig(new DateHistogramInterval("1h"), null),
114114
missingShardId.getIndexName(),
115115
1,
116116
1,

x-pack/plugin/downsample/src/test/java/org/elasticsearch/xpack/downsample/DownsampleShardTaskParamsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected DownsampleShardTaskParams createTestInstance() {
2929
long endTime = startTime + randomLongBetween(1000, 10_000);
3030
String[] dimensions = randomBoolean() ? generateRandomStringArray(5, 5, false, true) : new String[] {};
3131
return new DownsampleShardTaskParams(
32-
new DownsampleConfig(randomFrom(DateHistogramInterval.HOUR, DateHistogramInterval.DAY)),
32+
new DownsampleConfig(randomFrom(DateHistogramInterval.HOUR, DateHistogramInterval.DAY), null),
3333
randomAlphaOfLength(5),
3434
startTime,
3535
endTime,
@@ -44,7 +44,7 @@ protected DownsampleShardTaskParams createTestInstance() {
4444
protected DownsampleShardTaskParams mutateInstance(DownsampleShardTaskParams in) throws IOException {
4545
return switch (between(0, 7)) {
4646
case 0 -> new DownsampleShardTaskParams(
47-
new DownsampleConfig(randomFrom(DateHistogramInterval.WEEK, DateHistogramInterval.MONTH)),
47+
new DownsampleConfig(randomFrom(DateHistogramInterval.WEEK, DateHistogramInterval.MONTH), null),
4848
in.downsampleIndex(),
4949
in.indexStartTimeMillis(),
5050
in.indexEndTimeMillis(),

0 commit comments

Comments
 (0)