mirror of https://github.com/apache/druid.git
1) Try checking for parent dirs first and creating if they aren't there when moving files from the legacy directory to the new one.
This commit is contained in:
parent
cba404a65d
commit
57f52f71fc
|
@ -82,8 +82,15 @@ public class SingleSegmentLoader implements SegmentLoader
|
|||
throw new SegmentLoadingException(e, "Error deleting localDir[%s]", localStorageDir);
|
||||
}
|
||||
}
|
||||
final File parentDir = localStorageDir.getParentFile();
|
||||
if (!parentDir.exists()) {
|
||||
log.info("Parent[%s] didn't exist, creating.");
|
||||
parentDir.mkdirs();
|
||||
}
|
||||
|
||||
legacyStorageDir.renameTo(localStorageDir);
|
||||
if (!legacyStorageDir.renameTo(localStorageDir)) {
|
||||
log.info("Failed moving [%s] to [%s]", legacyStorageDir, localStorageDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue