Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Bharathwaj G <[email protected]>
  • Loading branch information
bharath-techie committed Jul 19, 2022
1 parent 987cb57 commit 8067e7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.opensearch.common.lucene.search.Queries;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.util.BigArrays;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.index.IndexService;
import org.opensearch.index.IndexSettings;
import org.opensearch.index.cache.bitset.BitsetFilterCache;
Expand Down Expand Up @@ -309,7 +310,7 @@ public void preProcess(boolean rewrite) {
int sliceLimit = indexService.getIndexSettings().getMaxSlicesPerPit();
int numSlices = sliceBuilder.getMax();
if (numSlices > sliceLimit) {
throw new IllegalArgumentException(
throw new OpenSearchRejectedExecutionException(
"The number of slices ["
+ numSlices
+ "] is too large. It must "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.opensearch.common.util.BigArrays;
import org.opensearch.common.util.MockBigArrays;
import org.opensearch.common.util.MockPageCacheRecycler;
import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException;
import org.opensearch.index.IndexService;
import org.opensearch.index.IndexSettings;
import org.opensearch.index.cache.IndexCache;
Expand Down Expand Up @@ -434,9 +435,12 @@ protected Engine.Searcher acquireSearcherInternal(String source) {
when(sliceBuilder.getMax()).thenReturn(numSlicesForPit);
context5.sliceBuilder(sliceBuilder);

exception = expectThrows(IllegalArgumentException.class, () -> context5.preProcess(false));
OpenSearchRejectedExecutionException exception1 = expectThrows(
OpenSearchRejectedExecutionException.class,
() -> context5.preProcess(false)
);
assertThat(
exception.getMessage(),
exception1.getMessage(),
equalTo(
"The number of slices ["
+ numSlicesForPit
Expand Down

0 comments on commit 8067e7b

Please sign in to comment.