@@ -61,7 +61,8 @@ public void testMergesExecuteInSizeOrder() throws IOException {
61
61
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
62
62
new ShardId ("index" , "_na_" , 1 ),
63
63
IndexSettingsModule .newIndexSettings ("index" , Settings .EMPTY ),
64
- threadPoolMergeExecutorService
64
+ threadPoolMergeExecutorService ,
65
+ merge -> 0
65
66
)
66
67
) {
67
68
List <OneMerge > executedMergesList = new ArrayList <>();
@@ -103,7 +104,8 @@ public void testSimpleMergeTaskBacklogging() {
103
104
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
104
105
new ShardId ("index" , "_na_" , 1 ),
105
106
IndexSettingsModule .newIndexSettings ("index" , mergeSchedulerSettings ),
106
- threadPoolMergeExecutorService
107
+ threadPoolMergeExecutorService ,
108
+ merge -> 0
107
109
);
108
110
// more merge tasks than merge threads
109
111
int mergeCount = mergeExecutorThreadCount + randomIntBetween (1 , 5 );
@@ -136,7 +138,8 @@ public void testSimpleMergeTaskReEnqueueingBySize() {
136
138
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
137
139
new ShardId ("index" , "_na_" , 1 ),
138
140
IndexSettingsModule .newIndexSettings ("index" , mergeSchedulerSettings ),
139
- threadPoolMergeExecutorService
141
+ threadPoolMergeExecutorService ,
142
+ merge -> 0
140
143
);
141
144
// sort backlogged merges by size
142
145
PriorityQueue <MergeTask > backloggedMergeTasks = new PriorityQueue <>(16 , Comparator .comparingLong (MergeTask ::estimatedMergeSize ));
@@ -347,7 +350,8 @@ public void testMergeSourceWithFollowUpMergesRunSequentially() throws Exception
347
350
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
348
351
new ShardId ("index" , "_na_" , 1 ),
349
352
IndexSettingsModule .newIndexSettings ("index" , settings ),
350
- threadPoolMergeExecutorService
353
+ threadPoolMergeExecutorService ,
354
+ merge -> 0
351
355
)
352
356
) {
353
357
MergeSource mergeSource = mock (MergeSource .class );
@@ -420,7 +424,8 @@ public void testMergesRunConcurrently() throws Exception {
420
424
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
421
425
new ShardId ("index" , "_na_" , 1 ),
422
426
IndexSettingsModule .newIndexSettings ("index" , settings ),
423
- threadPoolMergeExecutorService
427
+ threadPoolMergeExecutorService ,
428
+ merge -> 0
424
429
)
425
430
) {
426
431
// at least 1 extra merge than there are concurrently allowed
@@ -504,7 +509,8 @@ public void testSchedulerCloseWaitsForRunningMerge() throws Exception {
504
509
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
505
510
new ShardId ("index" , "_na_" , 1 ),
506
511
IndexSettingsModule .newIndexSettings ("index" , settings ),
507
- threadPoolMergeExecutorService
512
+ threadPoolMergeExecutorService ,
513
+ merge -> 0
508
514
)
509
515
) {
510
516
CountDownLatch mergeDoneLatch = new CountDownLatch (1 );
@@ -576,7 +582,8 @@ public void testAutoIOThrottleForMergeTasksWhenSchedulerDisablesIt() throws Exce
576
582
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
577
583
new ShardId ("index" , "_na_" , 1 ),
578
584
indexSettings ,
579
- threadPoolMergeExecutorService
585
+ threadPoolMergeExecutorService ,
586
+ merge -> 0
580
587
)
581
588
) {
582
589
threadPoolMergeScheduler .merge (mergeSource , randomFrom (MergeTrigger .values ()));
@@ -605,7 +612,8 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
605
612
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
606
613
new ShardId ("index" , "_na_" , 1 ),
607
614
indexSettings ,
608
- threadPoolMergeExecutorService
615
+ threadPoolMergeExecutorService ,
616
+ merge -> 0
609
617
)
610
618
) {
611
619
threadPoolMergeScheduler .merge (mergeSource , randomFrom (MergeTrigger .values ()));
@@ -621,7 +629,8 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
621
629
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
622
630
new ShardId ("index" , "_na_" , 1 ),
623
631
indexSettings ,
624
- threadPoolMergeExecutorService
632
+ threadPoolMergeExecutorService ,
633
+ merge -> 0
625
634
)
626
635
) {
627
636
// merge submitted upon closing
@@ -637,7 +646,8 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
637
646
ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
638
647
new ShardId ("index" , "_na_" , 1 ),
639
648
indexSettings ,
640
- threadPoolMergeExecutorService
649
+ threadPoolMergeExecutorService ,
650
+ merge -> 0
641
651
)
642
652
) {
643
653
// merge submitted upon closing
@@ -668,7 +678,7 @@ static class TestThreadPoolMergeScheduler extends ThreadPoolMergeScheduler {
668
678
IndexSettings indexSettings ,
669
679
ThreadPoolMergeExecutorService threadPoolMergeExecutorService
670
680
) {
671
- super (shardId , indexSettings , threadPoolMergeExecutorService );
681
+ super (shardId , indexSettings , threadPoolMergeExecutorService , merge -> 0 );
672
682
}
673
683
674
684
@ Override
0 commit comments