Skip to content

Commit

Permalink
add version checks to gate searchIdleWakenUpCount
Browse files Browse the repository at this point in the history
Signed-off-by: Ruirui Zhang <[email protected]>
  • Loading branch information
ruai0511 committed Mar 19, 2024
1 parent b6e9385 commit 2ae676f
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ private Stats(StreamInput in) throws IOException {
suggestTimeInMillis = in.readVLong();
suggestCurrent = in.readVLong();

searchIdleWakenUpCount = in.readVLong();

if (in.getVersion().onOrAfter(Version.V_2_4_0)) {
pitCount = in.readVLong();
pitTimeInMillis = in.readVLong();
Expand All @@ -262,6 +260,10 @@ private Stats(StreamInput in) throws IOException {
concurrentQueryCurrent = in.readVLong();
queryConcurrency = in.readVLong();
}

if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
searchIdleWakenUpCount = in.readVLong();
}
}

public void add(Stats stats) {
Expand Down Expand Up @@ -449,8 +451,6 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVLong(suggestTimeInMillis);
out.writeVLong(suggestCurrent);

out.writeVLong(searchIdleWakenUpCount);

if (out.getVersion().onOrAfter(Version.V_2_4_0)) {
out.writeVLong(pitCount);
out.writeVLong(pitTimeInMillis);
Expand All @@ -475,6 +475,10 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVLong(queryConcurrency);
}

if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
out.writeVLong(searchIdleWakenUpCount);
}

}

@Override
Expand Down Expand Up @@ -667,15 +671,14 @@ static final class Fields {
static final String PIT_CURRENT = "point_in_time_current";
static final String SUGGEST_TOTAL = "suggest_total";
static final String SUGGEST_TIME = "suggest_time";
static final String SEARCH_IDLE_WAKEN_UP_TOTAL = "search_idle_waken_up_total";
static final String SUGGEST_TIME_IN_MILLIS = "suggest_time_in_millis";
static final String SUGGEST_CURRENT = "suggest_current";
static final String REQUEST = "request";
static final String TIME_IN_MILLIS = "time_in_millis";
static final String TIME = "time";
static final String CURRENT = "current";
static final String TOTAL = "total";

static final String SEARCH_IDLE_WAKEN_UP_TOTAL = "search_idle_waken_up_total";
}

@Override
Expand Down

0 comments on commit 2ae676f

Please sign in to comment.