Skip to content

Commit

Permalink
Addressing Comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ajay Kumar Movva <[email protected]>
  • Loading branch information
Ajay Kumar Movva committed Oct 20, 2023
1 parent 01316da commit b8c2c63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ public NetworkModule(
HttpServerTransport.Dispatcher dispatcher,
ClusterSettings clusterSettings,
Tracer tracer,
List<TransportInterceptor> coreTransportInterceptors
List<TransportInterceptor> transportInterceptors
) {
this.settings = settings;
if (coreTransportInterceptors != null) {
coreTransportInterceptors.forEach(this::registerTransportInterceptor);
if (transportInterceptors != null) {
transportInterceptors.forEach(this::registerTransportInterceptor);
}
for (NetworkPlugin plugin : plugins) {
Map<String, Supplier<HttpServerTransport>> httpTransportFactory = plugin.getHttpTransports(
Expand Down Expand Up @@ -184,11 +184,11 @@ public NetworkModule(
for (Map.Entry<String, Supplier<Transport>> entry : transportFactory.entrySet()) {
registerTransport(entry.getKey(), entry.getValue());
}
List<TransportInterceptor> transportInterceptors = plugin.getTransportInterceptors(
List<TransportInterceptor> pluginTransportInterceptors = plugin.getTransportInterceptors(
namedWriteableRegistry,
threadPool.getThreadContext()
);
for (TransportInterceptor interceptor : transportInterceptors) {
for (TransportInterceptor interceptor : pluginTransportInterceptors) {
registerTransportInterceptor(interceptor);
}
}
Expand Down
5 changes: 2 additions & 3 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,6 @@ protected Node(

final RestController restController = actionModule.getRestController();

List<TransportInterceptor> coreTransportInterceptors = new ArrayList<>();
final AdmissionControlService admissionControlService = new AdmissionControlService(
settings,
clusterService.getClusterSettings(),
Expand All @@ -904,7 +903,7 @@ protected Node(
admissionControlService
);

coreTransportInterceptors.add(admissionControlTransportInterceptor);
List<TransportInterceptor> transportInterceptors = List.of(admissionControlTransportInterceptor);
final NetworkModule networkModule = new NetworkModule(
settings,
pluginsService.filterPlugins(NetworkPlugin.class),
Expand All @@ -918,7 +917,7 @@ protected Node(
restController,
clusterService.getClusterSettings(),
tracer,
coreTransportInterceptors
transportInterceptors
);

Collection<UnaryOperator<Map<String, IndexTemplateMetadata>>> indexTemplateMetadataUpgraders = pluginsService.filterPlugins(
Expand Down

0 comments on commit b8c2c63

Please sign in to comment.