List of usage examples for org.apache.hadoop.fs.permission FsPermission getCachePoolDefault
public static FsPermission getCachePoolDefault()
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)); } }