@Override public SnapshotDiffReport doCall(final Path p) throws IOException { return getSnapshotDiffReportInternal(getPathName(p), fromSnapshot, toSnapshot); }
/** * See {@link ClientProtocol#hardLink(String, String)}. */ public boolean hardLink(Path src, Path dst) throws IOException { return dfs.hardLink(getPathName(src), getPathName(dst)); }
/** * Rename files/dirs */ public boolean rename(Path src, Path dst) throws IOException { return dfs.rename(getPathName(src), getPathName(dst)); }
@Override public Void doCall(final Path p) throws IOException { dfs.rename(getPathName(source), getPathName(p), options); return null; } @Override
@Override public Void doCall(final Path p) throws IOException { dfs.createSymlink(target.toString(), getPathName(p), createParent); return null; } @Override
@Override public FileChecksum doCall(final Path p) throws IOException { return dfs.getFileChecksumWithCombineMode( getPathName(p), Long.MAX_VALUE); }
@Override public Void doCall(final Path p) throws IOException { dfs.setPermission(getPathName(p), permission); return null; }
@Override public Void doCall(final Path p) throws IOException { dfs.setOwner(getPathName(p), username, groupname); return null; }
@Override public Void doCall(final Path p) throws IOException { dfs.removeDefaultAcl(getPathName(p)); return null; } @Override
@Override public Void doCall(final Path p) throws IOException { dfs.setXAttr(getPathName(p), name, value, flag); return null; }
public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException { if (file == null) { return null; } return dfs.getBlockLocations(getPathName(file.getPath()), start, len); }
/** * Start lease recovery * * @param f the name of the file to start lease recovery * @return if the file is closed or not * @throws IOException */ @Deprecated public boolean recoverLease(Path f) throws IOException { return dfs.recoverLease(getPathName(f), false); }
@Override public FSDataOutputStream doCall(final Path p) throws IOException { return dfs.append(getPathName(p), bufferSize, flag, progress, statistics, favoredNodes); } @Override
@Override public Boolean doCall(final Path p) throws IOException { return dfs.delete(getPathName(p), recursive); } @Override
@Override public Void doCall(Path p) throws IOException { provisionEZTrash(getPathName(p), trashPermission); return null; }
/** * Returns the stat information about the file. * @throws FileNotFoundException if the file does not exist. */ public FileStatus getFileStatus(Path f) throws IOException { FileStatus fi = dfs.getFileInfo(getPathName(f)); if (fi != null) { return makeQualified(fi); } else { throw new FileNotFoundException("File does not exist: " + f); } }
@Override public FSDataOutputStream doCall(final Path p) throws IOException { final DFSOutputStream dfsos = dfs.create(getPathName(p), permission, cflags, replication, blockSize, progress, bufferSize, checksumOpt); return dfs.createWrappedOutputStream(dfsos, statistics); } @Override
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, int bytesPerChecksum, Progressable progress) throws IOException { return new FSDataOutputStream (dfs.create(getPathName(f), permission, overwrite, true, replication, blockSize, progress, bufferSize, bytesPerChecksum), statistics); }
@Override public Path doCall(final Path p) throws IOException { HdfsFileStatus fi = dfs.getFileLinkInfo(getPathName(p)); if (fi != null) { return fi.makeQualified(getUri(), p).getSymlink(); } else { throw new FileNotFoundException("File does not exist: " + p); } } @Override
/** This optional operation is not yet supported. */ public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException { DFSOutputStream op = (DFSOutputStream)dfs.append(getPathName(f), bufferSize, progress); return new FSDataOutputStream(op, statistics, op.getInitialLen()); }