Skip to content

Commit

Permalink
functional model init
Browse files Browse the repository at this point in the history
Signed-off-by: Atharva Sharma <[email protected]>
  • Loading branch information
atharvasharma61 committed Apr 22, 2024
1 parent b899a27 commit 48ef808
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.opensearch.plugins.Plugin;
import org.opensearch.plugins.SecureHttpTransportSettingsProvider;
import org.opensearch.plugins.SecureTransportSettingsProvider;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.netty4.Netty4Transport;
Expand Down Expand Up @@ -103,8 +104,8 @@ public Map<String, Supplier<Transport>> getTransports(
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService,
Tracer tracer
) {
Tracer tracer,
MetricsRegistry metricsRegistry) {
return Collections.singletonMap(
NETTY_TRANSPORT_NAME,
() -> new Netty4Transport(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.opensearch.http.nio.NioHttpServerTransport;
import org.opensearch.plugins.NetworkPlugin;
import org.opensearch.plugins.Plugin;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Transport;
Expand Down Expand Up @@ -92,8 +93,8 @@ public Map<String, Supplier<Transport>> getTransports(
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService,
Tracer tracer
) {
Tracer tracer,
MetricsRegistry metricsRegistry) {
return Collections.singletonMap(
NIO_TRANSPORT_NAME,
() -> new NioTransport(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.opensearch.ratelimitting.admissioncontrol.enums.AdmissionControlActionType;
import org.opensearch.tasks.RawTaskStatus;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Transport;
Expand Down Expand Up @@ -176,6 +177,7 @@ public NetworkModule(
HttpServerTransport.Dispatcher dispatcher,
ClusterSettings clusterSettings,
Tracer tracer,
MetricsRegistry metricsRegistry,
List<TransportInterceptor> transportInterceptors,
Collection<SecureSettingsFactory> secureSettingsFactories
) {
Expand Down Expand Up @@ -229,7 +231,8 @@ public NetworkModule(
circuitBreakerService,
namedWriteableRegistry,
networkService,
tracer
tracer,
metricsRegistry
);
for (Map.Entry<String, Supplier<Transport>> entry : transportFactory.entrySet()) {
registerTransport(entry.getKey(), entry.getValue());
Expand Down
1 change: 1 addition & 0 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ protected Node(
restController,
clusterService.getClusterSettings(),
tracer,
metricsRegistry,
transportInterceptors,
secureSettingsFactories
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.opensearch.core.indices.breaker.CircuitBreakerService;
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.http.HttpServerTransport;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Transport;
Expand Down Expand Up @@ -84,8 +85,8 @@ default Map<String, Supplier<Transport>> getTransports(
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService,
Tracer tracer
) {
Tracer tracer,
MetricsRegistry metricsRegistry) {
return Collections.emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.opensearch.plugins.SecureSettingsFactory;
import org.opensearch.plugins.SecureTransportSettingsProvider;
import org.opensearch.plugins.TransportExceptionHandler;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.test.OpenSearchTestCase;
Expand Down Expand Up @@ -177,8 +178,8 @@ public Map<String, Supplier<Transport>> getTransports(
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService,
Tracer tracer
) {
Tracer tracer,
MetricsRegistry metricsRegistry) {
return Collections.singletonMap("custom", custom);
}
};
Expand Down Expand Up @@ -286,8 +287,8 @@ public Map<String, Supplier<Transport>> getTransports(
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService,
Tracer tracer
) {
Tracer tracer,
MetricsRegistry metricsRegistry) {
return Collections.singletonMap("default_custom", customTransport);
}

Expand Down Expand Up @@ -331,8 +332,8 @@ public Map<String, Supplier<Transport>> getTransports(
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService,
Tracer tracer
) {
Tracer tracer,
MetricsRegistry metricsRegistry) {
return Collections.singletonMap("default_custom", customTransport);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.opensearch.core.indices.breaker.CircuitBreakerService;
import org.opensearch.plugins.NetworkPlugin;
import org.opensearch.plugins.Plugin;
import org.opensearch.telemetry.metrics.MetricsRegistry;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Transport;
Expand All @@ -59,8 +60,8 @@ public Map<String, Supplier<Transport>> getTransports(
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService,
Tracer tracer
) {
Tracer tracer,
MetricsRegistry metricsRegistry) {
return Collections.singletonMap(
MOCK_NIO_TRANSPORT_NAME,
() -> new MockNioTransport(
Expand Down

0 comments on commit 48ef808

Please sign in to comment.