@@ -75,12 +75,12 @@ public void testTargetIORateChangesWhenSubmittingMergeTasks() throws Exception {
7575 int mergesStillToSubmit = randomIntBetween (1 , 100 );
7676 int mergesStillToComplete = mergesStillToSubmit ;
7777 Settings settings = Settings .builder ()
78- .put (ThreadPoolMergeScheduler .USE_THREAD_POOL_MERGE_SCHEDULER_SETTING .getKey (), true )
79- .put (EsExecutors .NODE_PROCESSORS_SETTING .getKey (), mergeExecutorThreadCount )
80- .build ();
78+ .put (ThreadPoolMergeScheduler .USE_THREAD_POOL_MERGE_SCHEDULER_SETTING .getKey (), true )
79+ .put (EsExecutors .NODE_PROCESSORS_SETTING .getKey (), mergeExecutorThreadCount )
80+ .build ();
8181 try (TestThreadPool testThreadPool = new TestThreadPool ("test" , settings )) {
8282 ThreadPoolMergeExecutorService threadPoolMergeExecutorService = ThreadPoolMergeExecutorService
83- .maybeCreateThreadPoolMergeExecutorService (testThreadPool , settings );
83+ .maybeCreateThreadPoolMergeExecutorService (testThreadPool , settings );
8484 assertNotNull (threadPoolMergeExecutorService );
8585 assertThat (threadPoolMergeExecutorService .getMaxConcurrentMerges (), equalTo (mergeExecutorThreadCount ));
8686 Semaphore runMergeSemaphore = new Semaphore (0 );
@@ -118,16 +118,18 @@ public void testTargetIORateChangesWhenSubmittingMergeTasks() throws Exception {
118118 }
119119 long newIORate = threadPoolMergeExecutorService .getTargetIORateBytesPerSec ();
120120 if (supportsIOThrottling ) {
121- if (submittedIOThrottledMergeTasks .get () < threadPoolMergeExecutorService .getConcurrentMergesFloorLimitForThrottling ()) {
121+ if (submittedIOThrottledMergeTasks .get () < threadPoolMergeExecutorService
122+ .getConcurrentMergesFloorLimitForThrottling ()) {
122123 // assert the IO rate decreases, with a floor limit, when there are few merge tasks enqueued
123124 assertThat (newIORate , either (is (MIN_IO_RATE .getBytes ())).or (lessThan (currentIORate )));
124- } else if (submittedIOThrottledMergeTasks .get () > threadPoolMergeExecutorService .getConcurrentMergesCeilLimitForThrottling ()) {
125- // assert the IO rate increases, with a ceiling limit, when there are many merge tasks enqueued
126- assertThat (newIORate , either (is (MAX_IO_RATE .getBytes ())).or (greaterThan (currentIORate )));
127- } else {
128- // assert the IO rate does NOT change when there are a couple of merge tasks enqueued
129- assertThat (newIORate , equalTo (currentIORate ));
130- }
125+ } else if (submittedIOThrottledMergeTasks .get () > threadPoolMergeExecutorService
126+ .getConcurrentMergesCeilLimitForThrottling ()) {
127+ // assert the IO rate increases, with a ceiling limit, when there are many merge tasks enqueued
128+ assertThat (newIORate , either (is (MAX_IO_RATE .getBytes ())).or (greaterThan (currentIORate )));
129+ } else {
130+ // assert the IO rate does NOT change when there are a couple of merge tasks enqueued
131+ assertThat (newIORate , equalTo (currentIORate ));
132+ }
131133 } else {
132134 // assert the IO rate does change, when the merge task doesn't support IO throttling
133135 assertThat (newIORate , equalTo (currentIORate ));
0 commit comments