diff --git a/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java b/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java index f4fdbc53cbc9e..d5492977a3ae3 100644 --- a/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java @@ -448,7 +448,7 @@ public void onPhaseEnd(SearchPhaseContext searchPhaseContext) { searchRequestOperationsListener.onCanMatchPhaseEnd(searchPhaseContext, tookTimeInMillis); } else if (searchPhaseContext.getCurrentPhase() instanceof DfsQueryPhase) { searchRequestOperationsListener.onQueryPhaseEnd(searchPhaseContext, tookTimeInMillis); - }else if (searchPhaseContext.getCurrentPhase() instanceof SearchQueryThenFetchAsyncAction) { + } else if (searchPhaseContext.getCurrentPhase() instanceof SearchQueryThenFetchAsyncAction) { searchRequestOperationsListener.onQueryPhaseEnd(searchPhaseContext, tookTimeInMillis); } else if (searchPhaseContext.getCurrentPhase() instanceof FetchSearchPhase) { searchRequestOperationsListener.onFetchPhaseEnd(searchPhaseContext, tookTimeInMillis); diff --git a/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java b/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java index a20b30dd7d27b..cb181840406a5 100644 --- a/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java +++ b/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java @@ -63,5 +63,4 @@ public long count() { return counter.sum(); } - } diff --git a/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java b/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java index d730f206d19e8..5e6582b9666d0 100644 --- a/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java +++ b/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java @@ -33,7 +33,6 @@ package org.opensearch.index.search.stats; import org.opensearch.Version; -import org.opensearch.action.CoordinatorStats; import org.opensearch.action.search.SearchCoordinatorStats; import org.opensearch.common.Nullable; import org.opensearch.common.Strings; @@ -81,6 +80,7 @@ public static class CoordinatorStatsLongHolder { public long expandSearchCurrent; public long expandSearchTotal; } + public static class Stats implements Writeable, ToXContentFragment { private long queryCount; @@ -182,23 +182,23 @@ private Stats(StreamInput in) throws IOException { if (in.getVersion().onOrAfter(Version.V_3_0_0)) { this.coordinatorStatsLongHolder = new CoordinatorStatsLongHolder(); coordinatorStatsLongHolder.dfsPreQueryMetric = in.readVLong(); - coordinatorStatsLongHolder.dfsPreQueryCurrent= in.readVLong(); + coordinatorStatsLongHolder.dfsPreQueryCurrent = in.readVLong(); coordinatorStatsLongHolder.dfsPreQueryTotal = in.readVLong(); coordinatorStatsLongHolder.canMatchMetric = in.readVLong(); - coordinatorStatsLongHolder.canMatchCurrent= in.readVLong(); + coordinatorStatsLongHolder.canMatchCurrent = in.readVLong(); coordinatorStatsLongHolder.canMatchTotal = in.readVLong(); coordinatorStatsLongHolder.queryMetric = in.readVLong(); - coordinatorStatsLongHolder.queryCurrent= in.readVLong(); + coordinatorStatsLongHolder.queryCurrent = in.readVLong(); coordinatorStatsLongHolder.queryTotal = in.readVLong(); coordinatorStatsLongHolder.fetchMetric = in.readVLong(); - coordinatorStatsLongHolder.fetchCurrent= in.readVLong(); + coordinatorStatsLongHolder.fetchCurrent = in.readVLong(); coordinatorStatsLongHolder.fetchTotal = in.readVLong(); coordinatorStatsLongHolder.expandSearchMetric = in.readVLong(); - coordinatorStatsLongHolder.expandSearchCurrent= in.readVLong(); + coordinatorStatsLongHolder.expandSearchCurrent = in.readVLong(); coordinatorStatsLongHolder.expandSearchTotal = in.readVLong(); } } diff --git a/server/src/test/java/org/opensearch/action/search/SearchQueryThenFetchAsyncActionTests.java b/server/src/test/java/org/opensearch/action/search/SearchQueryThenFetchAsyncActionTests.java index a04b3f428ef8d..558120eeba127 100644 --- a/server/src/test/java/org/opensearch/action/search/SearchQueryThenFetchAsyncActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchQueryThenFetchAsyncActionTests.java @@ -62,7 +62,8 @@ import org.opensearch.test.InternalAggregationTestCase; import org.opensearch.transport.Transport; -import java.util.*; +import java.util.Collections; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor;