HDFS-14755. [Dynamometer] Enhance compatibility of Dynamometer with branch-2 builds. Contributed by Takanobu Asanuma.

This commit is contained in:
Erik Krogen 2019-08-22 09:57:00 -07:00
parent 61b2df2331
commit 63c295e298
1 changed files with 4 additions and 2 deletions

View File

@ -109,8 +109,10 @@ public class SimulatedDataNodes extends Configured implements Tool {
}
System.out.println("DataNodes will connect to NameNode at " + nameNodeAdr);
System.setProperty(MiniDFSCluster.PROP_TEST_BUILD_DATA,
DataNode.getStorageLocations(getConf()).get(0).getUri().getPath());
String loc = DataNode.getStorageLocations(getConf()).get(0).toString();
loc = loc.substring(loc.indexOf("]") + 1); // delete storage type
String path = new URI(loc).getPath();
System.setProperty(MiniDFSCluster.PROP_TEST_BUILD_DATA, path);
SimulatedFSDataset.setFactory(getConf());
getConf().setLong(SimulatedFSDataset.CONFIG_PROPERTY_CAPACITY,
STORAGE_CAPACITY);