Skip to content

Commit

Permalink
Check if the data directory exists before trying to format.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinjia committed Apr 11, 2015
1 parent 3552655 commit 5690872
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/src/main/java/tachyon/Format.java
Expand Up @@ -88,9 +88,12 @@ public static void main(String[] args) throws IOException {
String[] dirPaths = tachyonConf.get(tierLevelDirPath, "/mnt/ramdisk").split(",");
String name = "TIER_" + level + "_DIR_PATH";
for (String dirPath : dirPaths) {
String dirWorkDataFolder = CommonUtils.concat(dirPath.trim(), workerDataFolder);
if (!formatFolder(name, dirWorkDataFolder, tachyonConf)) {
System.exit(-1);
String dirWorkerDataFolder = CommonUtils.concat(dirPath.trim(), workerDataFolder);
UnderFileSystem ufs = UnderFileSystem.get(dirWorkerDataFolder, tachyonConf);
if (ufs.exists(dirWorkerDataFolder)) {
if (!formatFolder(name, dirWorkerDataFolder, tachyonConf)) {
System.exit(-1);
}
}
}
}
Expand Down

0 comments on commit 5690872

Please sign in to comment.