Skip to content

Commit

Permalink
Remove from nodestats api.
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <handalm@amazon.com>
  • Loading branch information
mch2 committed Mar 12, 2023
1 parent 976effd commit 2a1e732
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 141 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.discovery.DiscoveryStats;
import org.opensearch.http.HttpStats;
import org.opensearch.index.SegmentReplicationStats;
import org.opensearch.index.stats.IndexingPressureStats;
import org.opensearch.index.stats.ShardIndexingPressureStats;
import org.opensearch.index.store.remote.filecache.FileCacheStats;
Expand Down Expand Up @@ -124,9 +123,6 @@ public class NodeStats extends BaseNodeResponse implements ToXContentFragment {
@Nullable
private ShardIndexingPressureStats shardIndexingPressureStats;

@Nullable
private SegmentReplicationStats segmentReplicationStats;

@Nullable
private SearchBackpressureStats searchBackpressureStats;

Expand Down Expand Up @@ -185,11 +181,6 @@ public NodeStats(StreamInput in) throws IOException {
} else {
fileCacheStats = null;
}
if (in.getVersion().onOrAfter(Version.V_2_7_0) && FeatureFlags.isEnabled(FeatureFlags.REPLICATION_TYPE)) {
segmentReplicationStats = in.readOptionalWriteable(SegmentReplicationStats::new);
} else {
segmentReplicationStats = null;
}
}

public NodeStats(
Expand All @@ -211,7 +202,6 @@ public NodeStats(
@Nullable ScriptCacheStats scriptCacheStats,
@Nullable IndexingPressureStats indexingPressureStats,
@Nullable ShardIndexingPressureStats shardIndexingPressureStats,
@Nullable SegmentReplicationStats segmentReplicationStats,
@Nullable SearchBackpressureStats searchBackpressureStats,
@Nullable ClusterManagerThrottlingStats clusterManagerThrottlingStats,
@Nullable WeightedRoutingStats weightedRoutingStats,
Expand All @@ -235,7 +225,6 @@ public NodeStats(
this.scriptCacheStats = scriptCacheStats;
this.indexingPressureStats = indexingPressureStats;
this.shardIndexingPressureStats = shardIndexingPressureStats;
this.segmentReplicationStats = segmentReplicationStats;
this.searchBackpressureStats = searchBackpressureStats;
this.clusterManagerThrottlingStats = clusterManagerThrottlingStats;
this.weightedRoutingStats = weightedRoutingStats;
Expand Down Expand Up @@ -349,11 +338,6 @@ public ShardIndexingPressureStats getShardIndexingPressureStats() {
return shardIndexingPressureStats;
}

@Nullable
public SegmentReplicationStats getSegmentReplicationStats() {
return segmentReplicationStats;
}

@Nullable
public SearchBackpressureStats getSearchBackpressureStats() {
return searchBackpressureStats;
Expand Down Expand Up @@ -409,9 +393,6 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_3_0_0) && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) {
out.writeOptionalWriteable(fileCacheStats);
}
if (out.getVersion().onOrAfter(Version.V_2_7_0) && FeatureFlags.isEnabled(FeatureFlags.REPLICATION_TYPE)) {
out.writeOptionalWriteable(segmentReplicationStats);
}
}

@Override
Expand Down Expand Up @@ -496,9 +477,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
if (getFileCacheStats() != null && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) {
getFileCacheStats().toXContent(builder, params);
}
if (getSegmentReplicationStats() != null && FeatureFlags.isEnabled(FeatureFlags.REPLICATION_TYPE)) {
getSegmentReplicationStats().toXContent(builder, params);
}

return builder;
}
}
1 change: 0 additions & 1 deletion server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,6 @@ protected Node(
responseCollectorService,
searchTransportService,
indexingPressureService,
segmentReplicationPressureService,
searchModule.getValuesSourceRegistry().getUsageService(),
searchBackpressureService,
nodeEnvironment
Expand Down
6 changes: 0 additions & 6 deletions server/src/main/java/org/opensearch/node/NodeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.opensearch.env.NodeEnvironment;
import org.opensearch.http.HttpServerTransport;
import org.opensearch.index.IndexingPressureService;
import org.opensearch.index.SegmentReplicationPressureService;
import org.opensearch.indices.IndicesService;
import org.opensearch.indices.breaker.CircuitBreakerService;
import org.opensearch.ingest.IngestService;
Expand Down Expand Up @@ -84,7 +83,6 @@ public class NodeService implements Closeable {
private final ResponseCollectorService responseCollectorService;
private final SearchTransportService searchTransportService;
private final IndexingPressureService indexingPressureService;
private final SegmentReplicationPressureService segmentReplicationPressureService;
private final AggregationUsageService aggregationUsageService;
private final SearchBackpressureService searchBackpressureService;
private final ClusterService clusterService;
Expand All @@ -108,7 +106,6 @@ public class NodeService implements Closeable {
ResponseCollectorService responseCollectorService,
SearchTransportService searchTransportService,
IndexingPressureService indexingPressureService,
SegmentReplicationPressureService segmentReplicationPressureService,
AggregationUsageService aggregationUsageService,
SearchBackpressureService searchBackpressureService,
NodeEnvironment nodeEnvironment
Expand All @@ -128,7 +125,6 @@ public class NodeService implements Closeable {
this.responseCollectorService = responseCollectorService;
this.searchTransportService = searchTransportService;
this.indexingPressureService = indexingPressureService;
this.segmentReplicationPressureService = segmentReplicationPressureService;
this.aggregationUsageService = aggregationUsageService;
this.searchBackpressureService = searchBackpressureService;
this.clusterService = clusterService;
Expand Down Expand Up @@ -184,7 +180,6 @@ public NodeStats stats(
boolean scriptCache,
boolean indexingPressure,
boolean shardIndexingPressure,
boolean segmentReplicationPressure,
boolean searchBackpressure,
boolean clusterManagerThrottling,
boolean weightedRoutingStats,
Expand All @@ -211,7 +206,6 @@ public NodeStats stats(
scriptCache ? scriptService.cacheStats() : null,
indexingPressure ? this.indexingPressureService.nodeStats() : null,
shardIndexingPressure ? this.indexingPressureService.shardStats(indices) : null,
segmentReplicationPressure ? this.segmentReplicationPressureService.nodeStats() : null,
searchBackpressure ? this.searchBackpressureService.nodeStats() : null,
clusterManagerThrottling ? this.clusterService.getClusterManagerService().getThrottlingStats() : null,
weightedRoutingStats ? WeightedRoutingStats.getInstance() : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,7 @@ public static NodeStats createNodeStats() {
scriptCacheStats,
null,
null,
null,
null,
null,
clusterManagerThrottlingStats,
weightedRoutingStats,
null
Expand Down
18 changes: 6 additions & 12 deletions server/src/test/java/org/opensearch/cluster/DiskUsageTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ public void testFillDiskUsage() {
null,
null,
null,
null,
null,
null,
null,
null,
null
Expand All @@ -211,8 +210,7 @@ public void testFillDiskUsage() {
null,
null,
null,
null,
null,
null,
null,
null,
null
Expand All @@ -236,8 +234,7 @@ public void testFillDiskUsage() {
null,
null,
null,
null,
null,
null,
null,
null,
null
Expand Down Expand Up @@ -292,8 +289,7 @@ public void testFillDiskUsageSomeInvalidValues() {
null,
null,
null,
null,
null,
null,
null,
null,
null
Expand All @@ -317,8 +313,7 @@ public void testFillDiskUsageSomeInvalidValues() {
null,
null,
null,
null,
null,
null,
null,
null,
null
Expand All @@ -342,8 +337,7 @@ public void testFillDiskUsageSomeInvalidValues() {
null,
null,
null,
null,
null,
null,
null,
null,
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ List<NodeStats> adjustNodesStats(List<NodeStats> nodesStats) {
nodeStats.getScriptCacheStats(),
nodeStats.getIndexingPressureStats(),
nodeStats.getShardIndexingPressureStats(),
nodeStats.getSegmentReplicationStats(),
nodeStats.getSearchBackpressureStats(),
nodeStats.getSearchBackpressureStats(),
nodeStats.getClusterManagerThrottlingStats(),
nodeStats.getWeightedRoutingStats(),
nodeStats.getFileCacheStats()
Expand Down

0 comments on commit 2a1e732

Please sign in to comment.