Skip to content

Commit

Permalink
spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Dec 11, 2023
1 parent 93063b5 commit aea7785
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,21 +315,15 @@ public void testIndexNotFound() {
}

// Allow partial search result
assertResponse(
prepareSearch().setAllowPartialSearchResults(true).setPointInTime(new PointInTimeBuilder(pit)),
resp -> {
assertFailures(resp);
assertHitCount(resp, index2);
}
);
assertResponse(prepareSearch().setAllowPartialSearchResults(true).setPointInTime(new PointInTimeBuilder(pit)), resp -> {
assertFailures(resp);
assertHitCount(resp, index2);
});

// Do not allow partial search result
expectThrows(
ElasticsearchException.class,
() -> prepareSearch()
.setAllowPartialSearchResults(false)
.setPointInTime(new PointInTimeBuilder(pit))
.get()
() -> prepareSearch().setAllowPartialSearchResults(false).setPointInTime(new PointInTimeBuilder(pit)).get()
);
} finally {
closePointInTime(pit);
Expand Down Expand Up @@ -427,14 +421,11 @@ public void testPartialResults() throws Exception {
});

internalCluster().restartNode(assignedNodeForIndex1);
assertResponse(
prepareSearch().setAllowPartialSearchResults(true).setPointInTime(new PointInTimeBuilder(pitId)),
resp -> {
assertFailures(resp);
assertThat(resp.pointInTimeId(), equalTo(pitId));
assertHitCount(resp, numDocs2);
}
);
assertResponse(prepareSearch().setAllowPartialSearchResults(true).setPointInTime(new PointInTimeBuilder(pitId)), resp -> {
assertFailures(resp);
assertThat(resp.pointInTimeId(), equalTo(pitId));
assertHitCount(resp, numDocs2);
});
} finally {
closePointInTime(pitId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public RandomizingClient(Client client, Random random) {

@Override
public SearchRequestBuilder prepareSearch(String... indices) {
SearchRequestBuilder searchRequestBuilder = new RandomizedSearchRequestBuilder(this)
.setIndices(indices)
SearchRequestBuilder searchRequestBuilder = new RandomizedSearchRequestBuilder(this).setIndices(indices)
.setSearchType(defaultSearchType)
.setPreference(defaultPreference)
.setBatchedReduceSize(batchedReduceSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,10 @@ public void testRetryPointInTime() throws Exception {
).keepAlive(TimeValue.timeValueMinutes(2));
final String pitId = client().execute(TransportOpenPointInTimeAction.TYPE, openPointInTimeRequest).actionGet().getPointInTimeId();
try {
assertNoFailuresAndResponse(
prepareSearch().setPointInTime(new PointInTimeBuilder(pitId)),
searchResponse -> {
assertThat(searchResponse.pointInTimeId(), equalTo(pitId));
assertHitCount(searchResponse, numDocs);
}
);
assertNoFailuresAndResponse(prepareSearch().setPointInTime(new PointInTimeBuilder(pitId)), searchResponse -> {
assertThat(searchResponse.pointInTimeId(), equalTo(pitId));
assertHitCount(searchResponse, numDocs);
});
internalCluster().restartNode(assignedNode);
ensureGreen(indexName);

Expand Down

0 comments on commit aea7785

Please sign in to comment.