/** * Set the group name of the staging output file. * * @throws IOException if it fails to set the group name */ protected void setStagingFileGroup() throws IOException { Preconditions.checkArgument(this.fs.exists(this.stagingFile), String.format("Staging output file %s does not exist", this.stagingFile)); if (this.group.isPresent()) { HadoopUtils.setGroup(this.fs, this.stagingFile, this.group.get()); } }
@Override public Void call() throws Exception { Lock lock = ParallelRunner.this.locks.get(src.toString()); lock.lock(); try { if (ParallelRunner.this.fs.exists(src)) { HadoopUtils.renamePath(ParallelRunner.this.fs, src, dst); if (group.isPresent()) { HadoopUtils.setGroup(ParallelRunner.this.fs, dst, group.get()); } } return null; } catch (FileAlreadyExistsException e) { LOGGER.warn(String.format("Failed to rename %s to %s: dst already exists", src, dst), e); return null; } finally { lock.unlock(); } } }), "Rename " + src + " to " + dst));
@Override public Void call() throws Exception { Lock lock = ParallelRunner.this.locks.get(src.toString()); lock.lock(); try { if (ParallelRunner.this.fs.exists(src)) { HadoopUtils.movePath(ParallelRunner.this.fs, src, dstFs, dst, overwrite, dstFs.getConf()); if (group.isPresent()) { HadoopUtils.setGroup(dstFs, dst, group.get()); } } return null; } catch (FileAlreadyExistsException e) { LOGGER.warn(String.format("Failed to move %s to %s: dst already exists", src, dst), e); return null; } finally { lock.unlock(); } } }), "Move " + src + " to " + dst));
/** * Set the group name of the staging output file. * * @throws IOException if it fails to set the group name */ protected void setStagingFileGroup() throws IOException { Preconditions.checkArgument(this.fs.exists(this.stagingFile), String.format("Staging output file %s does not exist", this.stagingFile)); if (this.group.isPresent()) { HadoopUtils.setGroup(this.fs, this.stagingFile, this.group.get()); } }
@Override public Void call() throws Exception { Lock lock = ParallelRunner.this.locks.get(src.toString()); lock.lock(); try { if (ParallelRunner.this.fs.exists(src)) { HadoopUtils.movePath(ParallelRunner.this.fs, src, dstFs, dst, overwrite, dstFs.getConf()); if (group.isPresent()) { HadoopUtils.setGroup(dstFs, dst, group.get()); } } return null; } catch (FileAlreadyExistsException e) { LOGGER.warn(String.format("Failed to move %s to %s: dst already exists", src, dst), e); return null; } finally { lock.unlock(); } } }), "Move " + src + " to " + dst));
@Override public Void call() throws Exception { Lock lock = ParallelRunner.this.locks.get(src.toString()); lock.lock(); try { if (ParallelRunner.this.fs.exists(src)) { HadoopUtils.renamePath(ParallelRunner.this.fs, src, dst); if (group.isPresent()) { HadoopUtils.setGroup(ParallelRunner.this.fs, dst, group.get()); } } return null; } catch (FileAlreadyExistsException e) { LOGGER.warn(String.format("Failed to rename %s to %s: dst already exists", src, dst), e); return null; } finally { lock.unlock(); } } }), "Rename " + src + " to " + dst));