Skip to content

Commit

Permalink
Remove breaking changes from opensearch-project#15409 (opensearch-pro…
Browse files Browse the repository at this point in the history
…ject#15624)

Signed-off-by: Lakshya Taragi <lakshya.taragi@gmail.com>
(cherry picked from commit a60b668)
  • Loading branch information
ltaragi committed Sep 4, 2024
1 parent 4e26bb9 commit 278557a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ public void testSnapshotsStatus() {
boolean ignoreUnavailable = randomBoolean();
String endpoint = "/_snapshot/" + repository + "/" + snapshotNames.toString() + "/_status";

SnapshotsStatusRequest snapshotsStatusRequest = new SnapshotsStatusRequest(repository, snapshots, indices);
SnapshotsStatusRequest snapshotsStatusRequest = (new SnapshotsStatusRequest(repository, snapshots)).indices(indices);
RequestConvertersTests.setRandomMasterTimeout(snapshotsStatusRequest, expectedParams);

snapshotsStatusRequest.ignoreUnavailable(ignoreUnavailable);
expectedParams.put("ignore_unavailable", Boolean.toString(ignoreUnavailable));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public void testUpgradeMovesRepoToNewMetaVersion() throws IOException {
private static void assertSnapshotStatusSuccessful(RestHighLevelClient client, String repoName,
String[] snapshots, String[] indices) throws IOException {
final SnapshotsStatusResponse statusResponse = client.snapshot()
.status(new SnapshotsStatusRequest(repoName, snapshots, indices), RequestOptions.DEFAULT);
.status((new SnapshotsStatusRequest(repoName, snapshots)).indices(indices), RequestOptions.DEFAULT);
for (SnapshotStatus status : statusResponse.getSnapshots()) {
assertThat(status.getShardsStats().getFailedShards(), is(0));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ public SnapshotsStatusRequest() {}
* @param repository repository name
* @param snapshots list of snapshots
*/
public SnapshotsStatusRequest(String repository, String[] snapshots) {
this.repository = repository;
this.snapshots = snapshots;
}

/**
* Constructs a new get snapshots request with given repository name and list of snapshots
*
* @param repository repository name
* @param snapshots list of snapshots
* @param indices list of indices
*/
public SnapshotsStatusRequest(String repository, String[] snapshots, String[] indices) {
this.repository = repository;
this.snapshots = snapshots;
Expand Down

0 comments on commit 278557a

Please sign in to comment.