@Override public void setWorkingDirectory(Path dir) { String result = fixRelativePart(dir).toUri().getPath(); if (!DFSUtilClient.isValidName(result)) { throw new IllegalArgumentException("Invalid DFS directory name " + result); } workingDir = fixRelativePart(dir); }
@Override public void setWorkingDirectory(Path dir) { String result = fixRelativePart(dir).toUri().getPath(); if (!DFSUtil.isValidName(result)) { throw new IllegalArgumentException("Invalid DFS directory name " + result); } workingDir = fixRelativePart(dir); }
@Override public void setWorkingDirectory(Path dir) { String result = fixRelativePart(dir).toUri().getPath(); if (!DFSUtil.isValidName(result)) { throw new IllegalArgumentException("Invalid DFS directory name " + result); } workingDir = fixRelativePart(dir); }
@Override public Map<String, byte[]> getXAttrs(Path path) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<Map<String, byte[]>>() { @Override public Map<String, byte[]> doCall(final Path p) throws IOException { return dfs.getXAttrs(getPathName(p)); } @Override public Map<String, byte[]> next(final FileSystem fs, final Path p) throws IOException { return fs.getXAttrs(p); } }.resolve(this, absF); }
@Override public byte[] getXAttr(Path path, final String name) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<byte[]>() { @Override public byte[] doCall(final Path p) throws IOException { return dfs.getXAttr(getPathName(p), name); } @Override public byte[] next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getXAttr(p, name); } }.resolve(this, absF); }
@Override public Map<String, byte[]> getXAttrs(Path path) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<Map<String, byte[]>>() { @Override public Map<String, byte[]> doCall(final Path p) throws IOException { return dfs.getXAttrs(getPathName(p)); } @Override public Map<String, byte[]> next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getXAttrs(p); } }.resolve(this, absF); }
@Override public Map<String, byte[]> getXAttrs(Path path) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<Map<String, byte[]>>() { @Override public Map<String, byte[]> doCall(final Path p) throws IOException { return dfs.getXAttrs(getPathName(p)); } @Override public Map<String, byte[]> next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getXAttrs(p); } }.resolve(this, absF); }
@Override public byte[] getXAttr(Path path, final String name) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<byte[]>() { @Override public byte[] doCall(final Path p) throws IOException { return dfs.getXAttr(getPathName(p), name); } @Override public byte[] next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getXAttr(p, name); } }.resolve(this, absF); }
@Override public Map<String, byte[]> getXAttrs(Path path, final List<String> names) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<Map<String, byte[]>>() { @Override public Map<String, byte[]> doCall(final Path p) throws IOException { return dfs.getXAttrs(getPathName(p), names); } @Override public Map<String, byte[]> next(final FileSystem fs, final Path p) throws IOException { return fs.getXAttrs(p, names); } }.resolve(this, absF); }
@Override public List<String> listXAttrs(Path path) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<List<String>>() { @Override public List<String> doCall(final Path p) throws IOException { return dfs.listXAttrs(getPathName(p)); } @Override public List<String> next(final FileSystem fs, final Path p) throws IOException { return fs.listXAttrs(p); } }.resolve(this, absF); }
@Override public Map<String, byte[]> getXAttrs(Path path, final List<String> names) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<Map<String, byte[]>>() { @Override public Map<String, byte[]> doCall(final Path p) throws IOException { return dfs.getXAttrs(getPathName(p), names); } @Override public Map<String, byte[]> next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getXAttrs(p, names); } }.resolve(this, absF); }
@Override public List<String> listXAttrs(Path path) throws IOException { final Path absF = fixRelativePart(path); return new FileSystemLinkResolver<List<String>>() { @Override public List<String> doCall(final Path p) throws IOException { return dfs.listXAttrs(getPathName(p)); } @Override public List<String> next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.listXAttrs(p); } }.resolve(this, absF); }
@Override public void removeXAttr(Path path, final String name) throws IOException { Path absF = fixRelativePart(path); new FileSystemLinkResolver<Void>() { @Override public Void doCall(final Path p) throws IOException { dfs.removeXAttr(getPathName(p), name); return null; } @Override public Void next(final FileSystem fs, final Path p) throws IOException { fs.removeXAttr(p, name); return null; } }.resolve(this, absF); }
@Override public void removeXAttr(Path path, final String name) throws IOException { Path absF = fixRelativePart(path); new FileSystemLinkResolver<Void>() { @Override public Void doCall(final Path p) throws IOException { dfs.removeXAttr(getPathName(p), name); return null; } @Override public Void next(final FileSystem fs, final Path p) throws IOException { fs.removeXAttr(p, name); return null; } }.resolve(this, absF); }
@Override protected Path resolveLink(Path f) throws IOException { statistics.incrementReadOps(1); String target = dfs.getLinkTarget(getPathName(fixRelativePart(f))); if (target == null) { throw new FileNotFoundException("File does not exist: " + f.toString()); } return new Path(target); }
@Override protected Path resolveLink(Path f) throws IOException { statistics.incrementReadOps(1); String target = dfs.getLinkTarget(getPathName(fixRelativePart(f))); if (target == null) { throw new FileNotFoundException("File does not exist: " + f.toString()); } return new Path(target); }
@Override protected Path resolveLink(Path f) throws IOException { statistics.incrementReadOps(1); storageStatistics.incrementOpCounter(OpType.RESOLVE_LINK); String target = dfs.getLinkTarget(getPathName(fixRelativePart(f))); if (target == null) { throw new FileNotFoundException("File does not exist: " + f.toString()); } return new Path(target); }
@Override protected HdfsDataOutputStream primitiveCreate(Path f, FsPermission absolutePermission, EnumSet<CreateFlag> flag, int bufferSize, short replication, long blockSize, Progressable progress, ChecksumOpt checksumOpt) throws IOException { statistics.incrementWriteOps(1); final DFSOutputStream dfsos = dfs.primitiveCreate( getPathName(fixRelativePart(f)), absolutePermission, flag, true, replication, blockSize, progress, bufferSize, checksumOpt); return dfs.createWrappedOutputStream(dfsos, statistics); }
@Override protected HdfsDataOutputStream primitiveCreate(Path f, FsPermission absolutePermission, EnumSet<CreateFlag> flag, int bufferSize, short replication, long blockSize, Progressable progress, ChecksumOpt checksumOpt) throws IOException { statistics.incrementWriteOps(1); final DFSOutputStream dfsos = dfs.primitiveCreate( getPathName(fixRelativePart(f)), absolutePermission, flag, true, replication, blockSize, progress, bufferSize, checksumOpt); return dfs.createWrappedOutputStream(dfsos, statistics); }
@Override protected HdfsDataOutputStream primitiveCreate(Path f, FsPermission absolutePermission, EnumSet<CreateFlag> flag, int bufferSize, short replication, long blockSize, Progressable progress, ChecksumOpt checksumOpt) throws IOException { statistics.incrementWriteOps(1); storageStatistics.incrementOpCounter(OpType.PRIMITIVE_CREATE); final DFSOutputStream dfsos = dfs.primitiveCreate( getPathName(fixRelativePart(f)), absolutePermission, flag, true, replication, blockSize, progress, bufferSize, checksumOpt); return dfs.createWrappedOutputStream(dfsos, statistics); }