Skip to content

Commit

Permalink
Fixes spotless
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 13, 2024
1 parent d30fca6 commit b18e370
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
14 changes: 6 additions & 8 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@
import org.opensearch.plugins.SearchPlugin;
import org.opensearch.plugins.SecureSettingsFactory;
import org.opensearch.plugins.SystemIndexPlugin;
import org.opensearch.plugins.TelemetryPlugin;
import org.opensearch.ratelimitting.admissioncontrol.AdmissionControlService;
import org.opensearch.ratelimitting.admissioncontrol.transport.AdmissionControlTransportInterceptor;
import org.opensearch.repositories.RepositoriesModule;
Expand Down Expand Up @@ -237,15 +236,9 @@
import org.opensearch.tasks.TaskResourceTrackingService;
import org.opensearch.tasks.TaskResultsService;
import org.opensearch.tasks.consumer.TopNSearchTasksLogger;
import org.opensearch.telemetry.TelemetryModule;
import org.opensearch.telemetry.TelemetrySettings;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.telemetry.metrics.MetricsRegistryFactory;
import org.opensearch.telemetry.metrics.NoopMetricsRegistryFactory;
import org.opensearch.telemetry.service.TelemetryService;
import org.opensearch.telemetry.tracing.NoopTracerFactory;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.telemetry.tracing.TracerFactory;
import org.opensearch.threadpool.ExecutorBuilder;
import org.opensearch.threadpool.RunnableTaskExecutionListener;
import org.opensearch.threadpool.ThreadPool;
Expand Down Expand Up @@ -612,7 +605,12 @@ protected Node(
);
}

TelemetryService telemetryService = new TelemetryService(settings, clusterService.getClusterSettings(), pluginsService, threadPool);
TelemetryService telemetryService = new TelemetryService(
settings,
clusterService.getClusterSettings(),
pluginsService,
threadPool
);
pluginsService.setTelemetryService(telemetryService);
resourcesToClose.add(telemetryService);

Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/org/opensearch/plugins/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,5 @@ public Optional<SecureSettingsFactory> getSecureSettingFactory(Settings settings
* Called to set the {@link TelemetryService} and plugins can use it for generating the instrumentations.
* @param telemetryService telemetry service
*/
public void setTelemetryService(TelemetryService telemetryService){}
public void setTelemetryService(TelemetryService telemetryService) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package org.opensearch.telemetry.service;

import java.io.IOException;
import java.util.List;
import org.opensearch.common.annotation.ExperimentalApi;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.common.settings.ClusterSettings;
Expand All @@ -27,6 +25,9 @@
import org.opensearch.telemetry.tracing.TracerFactory;
import org.opensearch.threadpool.ThreadPool;

import java.io.IOException;
import java.util.List;

import static org.opensearch.common.util.FeatureFlags.TELEMETRY;

/**
Expand Down Expand Up @@ -72,25 +73,23 @@ private void init(Settings settings, ClusterSettings clusterSettings, PluginsSer
* will be returned.
* @return tracer.
*/
public Tracer getTracer(){
public Tracer getTracer() {
return tracerFactory.getTracer();
}

/**
* Returns the {@link MetricsRegistry} object. If metrics registry or telemetry plugin is not configured then returns {@link MetricsRegistry}
* @return
*/
public MetricsRegistry getMetricsRegistry(){
public MetricsRegistry getMetricsRegistry() {
return metricsRegistryFactory.getMetricsRegistry();
}

@Override
protected void doStart() {
}
protected void doStart() {}

@Override
protected void doStop() {
}
protected void doStop() {}

@Override
protected void doClose() throws IOException {
Expand Down

0 comments on commit b18e370

Please sign in to comment.