Skip to content

Commit 608fcb6

Browse files
committed
Remove breaking changes from opensearch-project#15409 (opensearch-project#15624)
Signed-off-by: Lakshya Taragi <[email protected]> (cherry picked from commit a60b668)
1 parent fd946f0 commit 608fcb6

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

client/rest-high-level/src/test/java/org/opensearch/client/SnapshotRequestConvertersTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ public void testSnapshotsStatus() {
238238
boolean ignoreUnavailable = randomBoolean();
239239
String endpoint = "/_snapshot/" + repository + "/" + snapshotNames.toString() + "/_status";
240240

241-
SnapshotsStatusRequest snapshotsStatusRequest = new SnapshotsStatusRequest(repository, snapshots, indices);
241+
SnapshotsStatusRequest snapshotsStatusRequest = (new SnapshotsStatusRequest(repository, snapshots)).indices(indices);
242242
RequestConvertersTests.setRandomMasterTimeout(snapshotsStatusRequest, expectedParams);
243+
243244
snapshotsStatusRequest.ignoreUnavailable(ignoreUnavailable);
244245
expectedParams.put("ignore_unavailable", Boolean.toString(ignoreUnavailable));
245246

qa/repository-multi-version/src/test/java/org/opensearch/upgrades/MultiVersionRepositoryAccessIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public void testUpgradeMovesRepoToNewMetaVersion() throws IOException {
257257
private static void assertSnapshotStatusSuccessful(RestHighLevelClient client, String repoName,
258258
String[] snapshots, String[] indices) throws IOException {
259259
final SnapshotsStatusResponse statusResponse = client.snapshot()
260-
.status(new SnapshotsStatusRequest(repoName, snapshots, indices), RequestOptions.DEFAULT);
260+
.status((new SnapshotsStatusRequest(repoName, snapshots)).indices(indices), RequestOptions.DEFAULT);
261261
for (SnapshotStatus status : statusResponse.getSnapshots()) {
262262
assertThat(status.getShardsStats().getFailedShards(), is(0));
263263
}

server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ public SnapshotsStatusRequest() {}
6767
* @param repository repository name
6868
* @param snapshots list of snapshots
6969
*/
70+
public SnapshotsStatusRequest(String repository, String[] snapshots) {
71+
this.repository = repository;
72+
this.snapshots = snapshots;
73+
}
74+
75+
/**
76+
* Constructs a new get snapshots request with given repository name and list of snapshots
77+
*
78+
* @param repository repository name
79+
* @param snapshots list of snapshots
80+
* @param indices list of indices
81+
*/
7082
public SnapshotsStatusRequest(String repository, String[] snapshots, String[] indices) {
7183
this.repository = repository;
7284
this.snapshots = snapshots;

0 commit comments

Comments
 (0)