From 390485c6d2cb9215fca9f69ec2442ba8aabd83e0 Mon Sep 17 00:00:00 2001 From: "w.montaz" Date: Mon, 27 Nov 2023 12:03:26 +0100 Subject: [PATCH] Fix checkstyle --- .../hadoop/garmadon/hdfs/writer/PartitionedWriter.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/readers/hdfs/src/main/java/com/criteo/hadoop/garmadon/hdfs/writer/PartitionedWriter.java b/readers/hdfs/src/main/java/com/criteo/hadoop/garmadon/hdfs/writer/PartitionedWriter.java index 0291cfe1..cccd2d22 100644 --- a/readers/hdfs/src/main/java/com/criteo/hadoop/garmadon/hdfs/writer/PartitionedWriter.java +++ b/readers/hdfs/src/main/java/com/criteo/hadoop/garmadon/hdfs/writer/PartitionedWriter.java @@ -44,9 +44,10 @@ public class PartitionedWriter implements Closeable { // A pool of worker dedicated to writing files to HDFS. Allows the reader to block for less time // the pool is static to avoid creating too many pools - private static final ExecutorService consumerCloserThreads = Executors.newCachedThreadPool(); + private static final ExecutorService CONSUMER_CLOSER_THREADS = Executors.newCachedThreadPool(); + static { - Runtime.getRuntime().addShutdownHook(new Thread(consumerCloserThreads::shutdown)); + Runtime.getRuntime().addShutdownHook(new Thread(CONSUMER_CLOSER_THREADS::shutdown)); } private final BiFunction> writerBuilder; @@ -222,7 +223,7 @@ private void possiblyCloseConsumers(Predicate> sh return dailyWriters.entrySet().stream().map(e -> CompletableFuture.supplyAsync( new CloseConsumerTask(shouldClose, partitionId, e.getKey(), e.getValue()), - consumerCloserThreads + CONSUMER_CLOSER_THREADS )); }).collect(Collectors.toList());