From 52326d7a094ca62062c8abad109ece9501ea9c7f Mon Sep 17 00:00:00 2001 From: Ticheng Lin <51488860+ticheng-aws@users.noreply.github.com> Date: Fri, 9 Jun 2023 05:41:23 -0700 Subject: [PATCH] Update version guards to deal for new query profile collector fields (#7979) Signed-off-by: Ticheng Lin --- .../org/opensearch/search/profile/query/CollectorResult.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java b/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java index a624cbc0bb7d6..73dd2214959ad 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java +++ b/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java @@ -164,7 +164,7 @@ public CollectorResult(StreamInput in) throws IOException { CollectorResult child = new CollectorResult(in); this.children.add(child); } - if (in.getVersion().onOrAfter(Version.V_3_0_0)) { + if (in.getVersion().onOrAfter(Version.V_2_9_0)) { this.reduceTime = in.readLong(); this.maxSliceTime = in.readLong(); this.minSliceTime = in.readLong(); @@ -188,7 +188,7 @@ public void writeTo(StreamOutput out) throws IOException { for (CollectorResult child : children) { child.writeTo(out); } - if (out.getVersion().onOrAfter(Version.V_3_0_0)) { + if (out.getVersion().onOrAfter(Version.V_2_9_0)) { out.writeLong(reduceTime); out.writeLong(maxSliceTime); out.writeLong(minSliceTime);