Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ALLUXIO-3037] moved log statement out of util function #6226

Merged
merged 1 commit into from Oct 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/common/src/main/java/alluxio/util/io/FileUtils.java
Expand Up @@ -249,10 +249,11 @@ public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOExce
* Also, appropriate directory permissions (777 + StickyBit, namely "drwxrwxrwt") are set.
*
* @param path storage directory path to create
* @return true if the directory is created and false if the directory already exists
*/
public static void createStorageDirPath(String path) throws IOException {
public static boolean createStorageDirPath(String path) throws IOException {
if (Files.exists(Paths.get(path))) {
return;
return false;
}
Path storagePath;
try {
Expand All @@ -263,7 +264,7 @@ public static void createStorageDirPath(String path) throws IOException {
String absolutePath = storagePath.toAbsolutePath().toString();
changeLocalFileToFullPermission(absolutePath);
setLocalDirStickyBit(absolutePath);
LOG.info("Folder {} was created!", path);
return true;
}

/**
Expand Down
Expand Up @@ -105,7 +105,11 @@ public static StorageDir newStorageDir(StorageTier tier, int dirIndex, long capa
private void initializeMeta() throws BlockAlreadyExistsException, IOException,
WorkerOutOfSpaceException {
// Create the storage directory path
FileUtils.createStorageDirPath(mDirPath);
boolean isDirectoryNewlyCreated = FileUtils.createStorageDirPath(mDirPath);

if (isDirectoryNewlyCreated) {
LOG.info("Folder {} was created!", mDirPath);
}

File dir = new File(mDirPath);
File[] paths = dir.listFiles();
Expand Down