56
56
* use {@link ExchangeSourceHandler#addRemoteSink(RemoteSink, boolean, Runnable, int, ActionListener)}.
57
57
*/
58
58
public final class ExchangeService extends AbstractLifecycleComponent {
59
+
60
+ private static final Logger logger = LogManager .getLogger (ExchangeService .class );
61
+
59
62
// TODO: Make this a child action of the data node transport to ensure that exchanges
60
63
// are accessed only by the user initialized the session.
61
64
public static final String EXCHANGE_ACTION_NAME = "internal:data/read/esql/exchange" ;
@@ -71,8 +74,6 @@ public final class ExchangeService extends AbstractLifecycleComponent {
71
74
public static final String INACTIVE_SINKS_INTERVAL_SETTING = "esql.exchange.sink_inactive_interval" ;
72
75
public static final TimeValue INACTIVE_SINKS_INTERVAL_DEFAULT = TimeValue .timeValueMinutes (5 );
73
76
74
- private static final Logger LOGGER = LogManager .getLogger (ExchangeService .class );
75
-
76
77
private final ThreadPool threadPool ;
77
78
private final Executor executor ;
78
79
private final BlockFactory blockFactory ;
@@ -87,7 +88,7 @@ public ExchangeService(Settings settings, ThreadPool threadPool, String executor
87
88
final var inactiveInterval = settings .getAsTime (INACTIVE_SINKS_INTERVAL_SETTING , INACTIVE_SINKS_INTERVAL_DEFAULT );
88
89
// Run the reaper every half of the keep_alive interval
89
90
this .threadPool .scheduleWithFixedDelay (
90
- new InactiveSinksReaper (LOGGER , threadPool , inactiveInterval ),
91
+ new InactiveSinksReaper (threadPool , inactiveInterval ),
91
92
TimeValue .timeValueMillis (Math .max (1 , inactiveInterval .millis () / 2 )),
92
93
executor
93
94
);
@@ -249,12 +250,10 @@ public void messageReceived(ExchangeRequest request, TransportChannel channel, T
249
250
}
250
251
251
252
private final class InactiveSinksReaper extends AbstractRunnable {
252
- private final Logger logger ;
253
253
private final TimeValue keepAlive ;
254
254
private final ThreadPool threadPool ;
255
255
256
- InactiveSinksReaper (Logger logger , ThreadPool threadPool , TimeValue keepAlive ) {
257
- this .logger = logger ;
256
+ InactiveSinksReaper (ThreadPool threadPool , TimeValue keepAlive ) {
258
257
this .keepAlive = keepAlive ;
259
258
this .threadPool = threadPool ;
260
259
}
0 commit comments