Skip to content

Commit

Permalink
Update version to 2.18.0 for CatShards request and response (#16455)
Browse files Browse the repository at this point in the history
* Update version to 2.18.0 for CatShards request and response

Signed-off-by: Harsh Garg <gkharsh@amazon.com>

* Retry Build

Signed-off-by: Harsh Garg <gkharsh@amazon.com>

* Fix CatShardsRequestTests

Signed-off-by: Harsh Garg <gkharsh@amazon.com>

* Retry Build

Signed-off-by: Harsh Garg <gkharsh@amazon.com>

---------

Signed-off-by: Harsh Garg <gkharsh@amazon.com>
Co-authored-by: Harsh Garg <gkharsh@amazon.com>
  • Loading branch information
gargharsh3134 and Harsh Garg authored Oct 24, 2024
1 parent 9dd1a59 commit 119abaf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public CatShardsRequest() {}

public CatShardsRequest(StreamInput in) throws IOException {
super(in);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_18_0)) {
indices = in.readStringArray();
cancelAfterTimeInterval = in.readOptionalTimeValue();
if (in.readBoolean()) {
Expand All @@ -50,7 +50,7 @@ public CatShardsRequest(StreamInput in) throws IOException {
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_18_0)) {
if (indices == null) {
out.writeVInt(0);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public CatShardsResponse() {}
public CatShardsResponse(StreamInput in) throws IOException {
super(in);
indicesStatsResponse = new IndicesStatsResponse(in);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_18_0)) {
nodes = DiscoveryNodes.readFrom(in, null);
responseShards = in.readList(ShardRouting::new);
if (in.readBoolean()) {
Expand All @@ -50,7 +50,7 @@ public CatShardsResponse(StreamInput in) throws IOException {
@Override
public void writeTo(StreamOutput out) throws IOException {
indicesStatsResponse.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_18_0)) {
nodes.writeToWithAttribute(out);
out.writeList(responseShards);
out.writeBoolean(pageToken != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* Class specific to paginated queries, which will contain common query params required by a paginated API.
*/
@PublicApi(since = "3.0.0")
@PublicApi(since = "2.18.0")
public class PageParams implements Writeable {

public static final String PARAM_SORT = "sort";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void testSerializationWithOlderVersionsParametersNotSerialized() throws E
catShardsRequest.setCancelAfterTimeInterval(TimeValue.timeValueMillis(randomIntBetween(1, 5)));
catShardsRequest.setIndices(new String[2]);

Version version = VersionUtils.getPreviousVersion(Version.CURRENT);
Version version = VersionUtils.getPreviousVersion(Version.V_2_18_0);
try (BytesStreamOutput out = new BytesStreamOutput()) {
out.setVersion(version);
catShardsRequest.writeTo(out);
Expand Down

0 comments on commit 119abaf

Please sign in to comment.