From 76c0183ae3f7feeed108925a929a2bcc0fd31658 Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Thu, 6 Jun 2019 11:17:59 -0700 Subject: [PATCH] HDDS-1652. HddsDispatcher should not shutdown volumeSet. Contributed by Xiaoyu Yao. (#916) --- .../hadoop/ozone/container/common/impl/HddsDispatcher.java | 2 -- .../hadoop/ozone/genesis/BenchMarkDatanodeDispatcher.java | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java index 30de8936fed..39e163e54e3 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java @@ -114,8 +114,6 @@ public class HddsDispatcher implements ContainerDispatcher, Auditor { @Override public void shutdown() { - // Shutdown the volumes - volumeSet.shutdown(); } /** diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/BenchMarkDatanodeDispatcher.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/BenchMarkDatanodeDispatcher.java index 91d096815ca..c05ecb966bc 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/BenchMarkDatanodeDispatcher.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/genesis/BenchMarkDatanodeDispatcher.java @@ -87,6 +87,7 @@ public class BenchMarkDatanodeDispatcher { private List containers; private List keys; private List chunks; + private VolumeSet volumeSet; @Setup(Level.Trial) public void initialize() throws IOException { @@ -103,7 +104,7 @@ public class BenchMarkDatanodeDispatcher { conf.set("dfs.datanode.data.dir", baseDir + File.separator + "data"); ContainerSet containerSet = new ContainerSet(); - VolumeSet volumeSet = new VolumeSet(datanodeUuid, conf); + volumeSet = new VolumeSet(datanodeUuid, conf); StateContext context = new StateContext( conf, DatanodeStates.RUNNING, null); ContainerMetrics metrics = ContainerMetrics.create(conf); @@ -161,7 +162,7 @@ public class BenchMarkDatanodeDispatcher { @TearDown(Level.Trial) public void cleanup() throws IOException { - dispatcher.shutdown(); + volumeSet.shutdown(); FileUtils.deleteDirectory(new File(baseDir)); }