@@ -61,7 +61,8 @@ public void testMergesExecuteInSizeOrder() throws IOException {
6161 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
6262 new ShardId ("index" , "_na_" , 1 ),
6363 IndexSettingsModule .newIndexSettings ("index" , Settings .EMPTY ),
64- threadPoolMergeExecutorService
64+ threadPoolMergeExecutorService ,
65+ merge -> 0
6566 )
6667 ) {
6768 List <OneMerge > executedMergesList = new ArrayList <>();
@@ -103,7 +104,8 @@ public void testSimpleMergeTaskBacklogging() {
103104 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
104105 new ShardId ("index" , "_na_" , 1 ),
105106 IndexSettingsModule .newIndexSettings ("index" , mergeSchedulerSettings ),
106- threadPoolMergeExecutorService
107+ threadPoolMergeExecutorService ,
108+ merge -> 0
107109 );
108110 // more merge tasks than merge threads
109111 int mergeCount = mergeExecutorThreadCount + randomIntBetween (1 , 5 );
@@ -136,7 +138,8 @@ public void testSimpleMergeTaskReEnqueueingBySize() {
136138 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
137139 new ShardId ("index" , "_na_" , 1 ),
138140 IndexSettingsModule .newIndexSettings ("index" , mergeSchedulerSettings ),
139- threadPoolMergeExecutorService
141+ threadPoolMergeExecutorService ,
142+ merge -> 0
140143 );
141144 // sort backlogged merges by size
142145 PriorityQueue <MergeTask > backloggedMergeTasks = new PriorityQueue <>(16 , Comparator .comparingLong (MergeTask ::estimatedMergeSize ));
@@ -347,7 +350,8 @@ public void testMergeSourceWithFollowUpMergesRunSequentially() throws Exception
347350 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
348351 new ShardId ("index" , "_na_" , 1 ),
349352 IndexSettingsModule .newIndexSettings ("index" , settings ),
350- threadPoolMergeExecutorService
353+ threadPoolMergeExecutorService ,
354+ merge -> 0
351355 )
352356 ) {
353357 MergeSource mergeSource = mock (MergeSource .class );
@@ -420,7 +424,8 @@ public void testMergesRunConcurrently() throws Exception {
420424 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
421425 new ShardId ("index" , "_na_" , 1 ),
422426 IndexSettingsModule .newIndexSettings ("index" , settings ),
423- threadPoolMergeExecutorService
427+ threadPoolMergeExecutorService ,
428+ merge -> 0
424429 )
425430 ) {
426431 // at least 1 extra merge than there are concurrently allowed
@@ -504,7 +509,8 @@ public void testSchedulerCloseWaitsForRunningMerge() throws Exception {
504509 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
505510 new ShardId ("index" , "_na_" , 1 ),
506511 IndexSettingsModule .newIndexSettings ("index" , settings ),
507- threadPoolMergeExecutorService
512+ threadPoolMergeExecutorService ,
513+ merge -> 0
508514 )
509515 ) {
510516 CountDownLatch mergeDoneLatch = new CountDownLatch (1 );
@@ -576,7 +582,8 @@ public void testAutoIOThrottleForMergeTasksWhenSchedulerDisablesIt() throws Exce
576582 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
577583 new ShardId ("index" , "_na_" , 1 ),
578584 indexSettings ,
579- threadPoolMergeExecutorService
585+ threadPoolMergeExecutorService ,
586+ merge -> 0
580587 )
581588 ) {
582589 threadPoolMergeScheduler .merge (mergeSource , randomFrom (MergeTrigger .values ()));
@@ -605,7 +612,8 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
605612 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
606613 new ShardId ("index" , "_na_" , 1 ),
607614 indexSettings ,
608- threadPoolMergeExecutorService
615+ threadPoolMergeExecutorService ,
616+ merge -> 0
609617 )
610618 ) {
611619 threadPoolMergeScheduler .merge (mergeSource , randomFrom (MergeTrigger .values ()));
@@ -621,7 +629,8 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
621629 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
622630 new ShardId ("index" , "_na_" , 1 ),
623631 indexSettings ,
624- threadPoolMergeExecutorService
632+ threadPoolMergeExecutorService ,
633+ merge -> 0
625634 )
626635 ) {
627636 // merge submitted upon closing
@@ -637,7 +646,8 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
637646 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
638647 new ShardId ("index" , "_na_" , 1 ),
639648 indexSettings ,
640- threadPoolMergeExecutorService
649+ threadPoolMergeExecutorService ,
650+ merge -> 0
641651 )
642652 ) {
643653 // merge submitted upon closing
@@ -668,7 +678,7 @@ static class TestThreadPoolMergeScheduler extends ThreadPoolMergeScheduler {
668678 IndexSettings indexSettings ,
669679 ThreadPoolMergeExecutorService threadPoolMergeExecutorService
670680 ) {
671- super (shardId , indexSettings , threadPoolMergeExecutorService );
681+ super (shardId , indexSettings , threadPoolMergeExecutorService , merge -> 0 );
672682 }
673683
674684 @ Override
0 commit comments