Example usage for org.apache.hadoop.fs.permission FsPermission getCachePoolDefault

List of usage examples for org.apache.hadoop.fs.permission FsPermission getCachePoolDefault

Introduction

In this page you can find the example usage for org.apache.hadoop.fs.permission FsPermission getCachePoolDefault.

Prototype

public static FsPermission getCachePoolDefault() 

Source Link

Document

Get the default permission for cache pools.

Usage

From source file:gobblin.data.management.conversion.hive.publisher.HiveConvertPublisher.java

License:Apache License

private void moveDirectory(String sourceDir, String targetDir) throws IOException {
    // If targetDir exists, delete it
    if (this.fs.exists(new Path(targetDir))) {
        deleteDirectory(targetDir);/*from   ww  w .j a  v a2  s. c  o m*/
    }

    // Create parent directories of targetDir
    WriterUtils.mkdirsWithRecursivePermission(this.fs, new Path(targetDir).getParent(),
            FsPermission.getCachePoolDefault());

    // Move directory
    log.info("Moving directory: " + sourceDir + " to: " + targetDir);
    if (!this.fs.rename(new Path(sourceDir), new Path(targetDir))) {
        throw new IOException(String.format("Unable to move %s to %s", sourceDir, targetDir));
    }
}