Skip to content

Commit

Permalink
test changes for PA
Browse files Browse the repository at this point in the history
Signed-off-by: Gagan Juneja <[email protected]>
  • Loading branch information
Gagan Juneja committed May 6, 2024
1 parent b4692c8 commit d7250c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public class ClusterService extends AbstractLifecycleComponent {

private final ClusterApplierService clusterApplierService;

private MetricsRegistry metricsRegistry;

public static final org.opensearch.common.settings.Setting.AffixSetting<String> USER_DEFINED_METADATA = Setting.prefixKeySetting(
"cluster.metadata.",
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope)
Expand Down Expand Up @@ -117,6 +119,10 @@ public ClusterService(
this.clusterApplierService = clusterApplierService;
}

public MetricsRegistry setMetricsRegistry(MetricsRegistry metricsRegistry) {
return this.metricsRegistry = metricsRegistry;
}

public synchronized void setNodeConnectionsService(NodeConnectionsService nodeConnectionsService) {
clusterApplierService.setNodeConnectionsService(nodeConnectionsService);
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@ protected Node(
tracerFactory = new NoopTracerFactory();
metricsRegistryFactory = new NoopMetricsRegistryFactory();
}

tracer = tracerFactory.getTracer();
metricsRegistry = metricsRegistryFactory.getMetricsRegistry();
clusterService.setMetricsRegistry(metricsRegistry);
resourcesToClose.add(tracer::close);
resourcesToClose.add(metricsRegistry::close);

Expand Down

0 comments on commit d7250c5

Please sign in to comment.