Skip to content

Commit 872cdf4

Browse files
adoroszlaibharatviswa504
authored andcommitted
HDDS-1941. Unused executor in SimpleContainerDownloader (#1367)
1 parent 6f2226a commit 872cdf4

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SimpleContainerDownloader.java

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,17 @@
1818

1919
package org.apache.hadoop.ozone.container.replication;
2020

21-
import java.io.IOException;
2221
import java.nio.file.Path;
2322
import java.nio.file.Paths;
2423
import java.util.List;
2524
import java.util.concurrent.CompletableFuture;
26-
import java.util.concurrent.ExecutorService;
27-
import java.util.concurrent.Executors;
28-
import java.util.concurrent.ThreadFactory;
29-
import java.util.concurrent.TimeUnit;
3025
import java.util.function.Function;
3126

3227
import org.apache.hadoop.conf.Configuration;
3328
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
3429
import org.apache.hadoop.hdds.protocol.DatanodeDetails.Port.Name;
3530
import org.apache.hadoop.ozone.OzoneConfigKeys;
3631

37-
import com.google.common.util.concurrent.ThreadFactoryBuilder;
3832
import org.slf4j.Logger;
3933
import org.slf4j.LoggerFactory;
4034

@@ -52,8 +46,6 @@ public class SimpleContainerDownloader implements ContainerDownloader {
5246

5347
private final Path workingDirectory;
5448

55-
private ExecutorService executor;
56-
5749
public SimpleContainerDownloader(Configuration conf) {
5850

5951
String workDirString =
@@ -65,12 +57,6 @@ public SimpleContainerDownloader(Configuration conf) {
6557
} else {
6658
workingDirectory = Paths.get(workDirString);
6759
}
68-
69-
ThreadFactory build = new ThreadFactoryBuilder().setDaemon(true)
70-
.setNameFormat("Container downloader thread - %d").build();
71-
executor = Executors.newSingleThreadExecutor(build);
72-
LOG.info("Starting container downloader service to copy "
73-
+ "containers to replicate.");
7460
}
7561

7662
@Override
@@ -110,11 +96,7 @@ public CompletableFuture<Path> getContainerDataFromReplicas(long containerId,
11096
}
11197

11298
@Override
113-
public void close() throws IOException {
114-
try {
115-
executor.awaitTermination(10, TimeUnit.SECONDS);
116-
} catch (InterruptedException e) {
117-
LOG.error("Can't stop container downloader gracefully", e);
118-
}
99+
public void close() {
100+
// noop
119101
}
120102
}

0 commit comments

Comments
 (0)