From 0688a1c25a4649c96d47179507dcfad1caa7a75d Mon Sep 17 00:00:00 2001 From: Tsz-Wo Nicholas Sze Date: Tue, 13 Jun 2017 17:25:20 +0800 Subject: [PATCH] HDFS-11946. Ozone: Containers in different datanodes are mapped to the same location. Contributed by Nandakumar --- .../java/org/apache/hadoop/ozone/MiniOzoneCluster.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java index 51b3ee1f370..38692e393d5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java @@ -111,6 +111,11 @@ public final class MiniOzoneCluster extends MiniDFSCluster String.valueOf(NetUtils.createSocketAddr(address).getPort())); setConf(i, dnConf, OzoneConfigKeys.DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR, getInstanceStorageDir(i, -1).getCanonicalPath()); + String containerMetaDirs = dnConf.get( + OzoneConfigKeys.OZONE_CONTAINER_METADATA_DIRS) + "-dn-" + i; + Files.createDirectories(Paths.get(containerMetaDirs)); + setConf(i, dnConf, OzoneConfigKeys.OZONE_CONTAINER_METADATA_DIRS, + containerMetaDirs); } static void setConf(int i, Configuration conf, String key, String value) { @@ -406,7 +411,7 @@ public final class MiniOzoneCluster extends MiniDFSCluster // If user has not specified a path, create a UUID for this miniCluster // and create SCM under that directory. - Path scmPath = Paths.get(path, runID.toString(), "scm"); + Path scmPath = Paths.get(path, runID.toString(), "cont-meta"); Files.createDirectories(scmPath); conf.set(OzoneConfigKeys.OZONE_CONTAINER_METADATA_DIRS, scmPath .toString());