Skip to content

Commit 119abaf

Browse files
gargharsh3134Harsh Garg
and
Harsh Garg
authored
Update version to 2.18.0 for CatShards request and response (#16455)
* Update version to 2.18.0 for CatShards request and response Signed-off-by: Harsh Garg <[email protected]> * Retry Build Signed-off-by: Harsh Garg <[email protected]> * Fix CatShardsRequestTests Signed-off-by: Harsh Garg <[email protected]> * Retry Build Signed-off-by: Harsh Garg <[email protected]> --------- Signed-off-by: Harsh Garg <[email protected]> Co-authored-by: Harsh Garg <[email protected]>
1 parent 9dd1a59 commit 119abaf

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

server/src/main/java/org/opensearch/action/admin/cluster/shards/CatShardsRequest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public CatShardsRequest() {}
3737

3838
public CatShardsRequest(StreamInput in) throws IOException {
3939
super(in);
40-
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
40+
if (in.getVersion().onOrAfter(Version.V_2_18_0)) {
4141
indices = in.readStringArray();
4242
cancelAfterTimeInterval = in.readOptionalTimeValue();
4343
if (in.readBoolean()) {
@@ -50,7 +50,7 @@ public CatShardsRequest(StreamInput in) throws IOException {
5050
@Override
5151
public void writeTo(StreamOutput out) throws IOException {
5252
super.writeTo(out);
53-
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
53+
if (out.getVersion().onOrAfter(Version.V_2_18_0)) {
5454
if (indices == null) {
5555
out.writeVInt(0);
5656
} else {

server/src/main/java/org/opensearch/action/admin/cluster/shards/CatShardsResponse.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public CatShardsResponse() {}
3838
public CatShardsResponse(StreamInput in) throws IOException {
3939
super(in);
4040
indicesStatsResponse = new IndicesStatsResponse(in);
41-
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
41+
if (in.getVersion().onOrAfter(Version.V_2_18_0)) {
4242
nodes = DiscoveryNodes.readFrom(in, null);
4343
responseShards = in.readList(ShardRouting::new);
4444
if (in.readBoolean()) {
@@ -50,7 +50,7 @@ public CatShardsResponse(StreamInput in) throws IOException {
5050
@Override
5151
public void writeTo(StreamOutput out) throws IOException {
5252
indicesStatsResponse.writeTo(out);
53-
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
53+
if (out.getVersion().onOrAfter(Version.V_2_18_0)) {
5454
nodes.writeToWithAttribute(out);
5555
out.writeList(responseShards);
5656
out.writeBoolean(pageToken != null);

server/src/main/java/org/opensearch/action/pagination/PageParams.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* Class specific to paginated queries, which will contain common query params required by a paginated API.
2222
*/
23-
@PublicApi(since = "3.0.0")
23+
@PublicApi(since = "2.18.0")
2424
public class PageParams implements Writeable {
2525

2626
public static final String PARAM_SORT = "sort";

server/src/test/java/org/opensearch/action/admin/cluster/shards/CatShardsRequestTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void testSerializationWithOlderVersionsParametersNotSerialized() throws E
9595
catShardsRequest.setCancelAfterTimeInterval(TimeValue.timeValueMillis(randomIntBetween(1, 5)));
9696
catShardsRequest.setIndices(new String[2]);
9797

98-
Version version = VersionUtils.getPreviousVersion(Version.CURRENT);
98+
Version version = VersionUtils.getPreviousVersion(Version.V_2_18_0);
9999
try (BytesStreamOutput out = new BytesStreamOutput()) {
100100
out.setVersion(version);
101101
catShardsRequest.writeTo(out);

0 commit comments

Comments
 (0)