Skip to content

Commit 63c295e

Browse files
committed
HDFS-14755. [Dynamometer] Enhance compatibility of Dynamometer with branch-2 builds. Contributed by Takanobu Asanuma.
1 parent 61b2df2 commit 63c295e

File tree

1 file changed

+4
-2
lines changed
  • hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer

1 file changed

+4
-2
lines changed

hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/SimulatedDataNodes.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ public int run(String[] args) throws Exception {
109109
}
110110
System.out.println("DataNodes will connect to NameNode at " + nameNodeAdr);
111111

112-
System.setProperty(MiniDFSCluster.PROP_TEST_BUILD_DATA,
113-
DataNode.getStorageLocations(getConf()).get(0).getUri().getPath());
112+
String loc = DataNode.getStorageLocations(getConf()).get(0).toString();
113+
loc = loc.substring(loc.indexOf("]") + 1); // delete storage type
114+
String path = new URI(loc).getPath();
115+
System.setProperty(MiniDFSCluster.PROP_TEST_BUILD_DATA, path);
114116
SimulatedFSDataset.setFactory(getConf());
115117
getConf().setLong(SimulatedFSDataset.CONFIG_PROPERTY_CAPACITY,
116118
STORAGE_CAPACITY);

0 commit comments

Comments
 (0)