Skip to content

Commit 553b08a

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 321a332 commit 553b08a

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorServiceTests.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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));

server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeSchedulerTests.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ public void testMergesExecuteInSizeOrder() throws IOException {
7272
MergeSource mergeSource = mock(MergeSource.class);
7373
MergePolicy.OneMerge oneMerge = mock(MergePolicy.OneMerge.class);
7474
when(oneMerge.getStoreMergeInfo()).thenReturn(
75-
new MergeInfo(randomNonNegativeInt(), randomLongBetween(1L, 10L), randomBoolean(), randomFrom(-1, randomNonNegativeInt()))
75+
new MergeInfo(
76+
randomNonNegativeInt(),
77+
randomLongBetween(1L, 10L),
78+
randomBoolean(),
79+
randomFrom(-1, randomNonNegativeInt())
80+
)
7681
);
7782
when(oneMerge.getMergeProgress()).thenReturn(new MergePolicy.OneMergeProgress());
7883
when(mergeSource.getNextMerge()).thenReturn(oneMerge, (MergePolicy.OneMerge) null);
@@ -86,8 +91,10 @@ public void testMergesExecuteInSizeOrder() throws IOException {
8691
assertThat(executedMergesList.size(), is(mergeCount));
8792
// assert merges are executed in ascending size order
8893
for (int i = 1; i < mergeCount; i++) {
89-
assertThat(executedMergesList.get(i - 1).getStoreMergeInfo().estimatedMergeBytes(),
90-
lessThanOrEqualTo(executedMergesList.get(i).getStoreMergeInfo().estimatedMergeBytes()));
94+
assertThat(
95+
executedMergesList.get(i - 1).getStoreMergeInfo().estimatedMergeBytes(),
96+
lessThanOrEqualTo(executedMergesList.get(i).getStoreMergeInfo().estimatedMergeBytes())
97+
);
9198
}
9299
}
93100
assertTrue(threadPoolMergeExecutorService.allDone());

0 commit comments

Comments
 (0)