Skip to content

Commit 9e57f14

Browse files
authored
generate sequence diagramRefactor logger declaration (#128457)
1 parent 21fe40a commit 9e57f14

File tree

1 file changed

+5
-6
lines changed
  • x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/exchange

1 file changed

+5
-6
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/exchange/ExchangeService.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
* use {@link ExchangeSourceHandler#addRemoteSink(RemoteSink, boolean, Runnable, int, ActionListener)}.
5757
*/
5858
public final class ExchangeService extends AbstractLifecycleComponent {
59+
60+
private static final Logger logger = LogManager.getLogger(ExchangeService.class);
61+
5962
// TODO: Make this a child action of the data node transport to ensure that exchanges
6063
// are accessed only by the user initialized the session.
6164
public static final String EXCHANGE_ACTION_NAME = "internal:data/read/esql/exchange";
@@ -71,8 +74,6 @@ public final class ExchangeService extends AbstractLifecycleComponent {
7174
public static final String INACTIVE_SINKS_INTERVAL_SETTING = "esql.exchange.sink_inactive_interval";
7275
public static final TimeValue INACTIVE_SINKS_INTERVAL_DEFAULT = TimeValue.timeValueMinutes(5);
7376

74-
private static final Logger LOGGER = LogManager.getLogger(ExchangeService.class);
75-
7677
private final ThreadPool threadPool;
7778
private final Executor executor;
7879
private final BlockFactory blockFactory;
@@ -87,7 +88,7 @@ public ExchangeService(Settings settings, ThreadPool threadPool, String executor
8788
final var inactiveInterval = settings.getAsTime(INACTIVE_SINKS_INTERVAL_SETTING, INACTIVE_SINKS_INTERVAL_DEFAULT);
8889
// Run the reaper every half of the keep_alive interval
8990
this.threadPool.scheduleWithFixedDelay(
90-
new InactiveSinksReaper(LOGGER, threadPool, inactiveInterval),
91+
new InactiveSinksReaper(threadPool, inactiveInterval),
9192
TimeValue.timeValueMillis(Math.max(1, inactiveInterval.millis() / 2)),
9293
executor
9394
);
@@ -249,12 +250,10 @@ public void messageReceived(ExchangeRequest request, TransportChannel channel, T
249250
}
250251

251252
private final class InactiveSinksReaper extends AbstractRunnable {
252-
private final Logger logger;
253253
private final TimeValue keepAlive;
254254
private final ThreadPool threadPool;
255255

256-
InactiveSinksReaper(Logger logger, ThreadPool threadPool, TimeValue keepAlive) {
257-
this.logger = logger;
256+
InactiveSinksReaper(ThreadPool threadPool, TimeValue keepAlive) {
258257
this.keepAlive = keepAlive;
259258
this.threadPool = threadPool;
260259
}

0 commit comments

Comments
 (0)