@Override public Path resolvePath(final Path p) throws IOException { return fs.resolvePath(p); } /**
@Override public Path resolvePath(Path p) throws IOException { return fs.resolvePath(p); }
@Override public boolean isFileInHDFS(FileSystem fs, Path path) throws IOException { // In case of viewfs we need to lookup where the actual file is to know the filesystem in use. // resolvePath is a sure shot way of knowing which file system the file is. return "hdfs".equals(fs.resolvePath(path).toUri().getScheme()); } }
public DatePartitionedLogger(Parser<T> parser, Path baseDir, Configuration conf, Clock clock) throws IOException { this.conf = new Configuration(conf); this.clock = clock; this.parser = parser; createDirIfNotExists(baseDir); this.basePath = baseDir.getFileSystem(conf).resolvePath(baseDir); FsPermission.setUMask(this.conf, FILE_UMASK); }
public Path resolvePath(Path p) throws java.io.IOException { return replaceScheme(this.underlyingFs.resolvePath(replaceScheme(p, this.replacementScheme, this.underlyingScheme)), this.underlyingScheme, this.replacementScheme); }
@Override public Path resolvePath(final Path f) throws IOException { final InodeTree.ResolveResult<FileSystem> res; res = fsState.resolve(getUriPath(f), true); if (res.isInternalDir()) { return f; } return res.targetFileSystem.resolvePath(res.remainingPath); }
Path fullyResolvedPath = fs.resolvePath(p); FileSystem fullyResolvedFs = FileSystem.get(fullyResolvedPath.toUri(), conf);
srcPath = srcFs.resolvePath(srcPath); FileSystem realSrcFs = srcPath.getFileSystem(conf); FileSystem desFs = fs instanceof HFileSystem ? ((HFileSystem)fs).getBackingFs() : fs;
/** * Returns the {@link FileStatus} from the {@link PathData} item. If the * current options require links to be followed then the returned file status * is that of the linked file. * * @param item * PathData * @param depth * current depth in the process directories * @return FileStatus */ protected FileStatus getFileStatus(PathData item, int depth) throws IOException { FileStatus fileStatus = item.stat; if (fileStatus.isSymlink()) { if (options.isFollowLink() || (options.isFollowArgLink() && (depth == 0))) { Path linkedFile = item.fs.resolvePath(fileStatus.getSymlink()); fileStatus = getFileSystem(item).getFileStatus(linkedFile); } } return fileStatus; }
@Override protected boolean isPathRecursable(PathData item) throws IOException { if (item.stat.isDirectory()) { return true; } if (item.stat.isSymlink()) { PathData linkedItem = new PathData(item.fs.resolvePath(item.stat.getSymlink()).toString(), getConf()); if (linkedItem.stat.isDirectory()) { if (getOptions().isFollowLink()) { return true; } if (getOptions().isFollowArgLink() && (getDepth() == 0)) { return true; } } } return false; }
private Path getResolvedPath(String dir) throws IOException { Configuration conf = getConf(); Path dirPath = new Path(dir); FileSystem fs = dirPath.getFileSystem(conf); return fs.resolvePath(dirPath); }
Path newSource = ns.resolvePath(source); if (!newSource.equals(source) && newSource.toUri().getScheme() != null) { ns = newSource.getFileSystem(hadoopConf);
@Override public Path resolvePath(final Path p) throws IOException { return fs.resolvePath(p); } /**
@Override public boolean isFileInHDFS(FileSystem fs, Path path) throws IOException { // In case of viewfs we need to lookup where the actual file is to know the filesystem in use. // resolvePath is a sure shot way of knowing which file system the file is. return "hdfs".equals(fs.resolvePath(path).toUri().getScheme()); } }
@Override public Path resolvePath(Path p) throws IOException { try { return underlyingFs.resolvePath(p); } catch(FSError e) { throw propagateFSError(e); } }
private Path getResolvedPath(String dir) throws IOException { Configuration conf = getConf(); Path dirPath = new Path(dir); FileSystem fs = dirPath.getFileSystem(conf); return fs.resolvePath(dirPath); }
@Override public Path resolvePath(final Path f) throws IOException { final InodeTree.ResolveResult<FileSystem> res; res = fsState.resolve(getUriPath(f), true); if (res.isInternalDir()) { return f; } return res.targetFileSystem.resolvePath(res.remainingPath); }
@Override public Path resolvePath(final Path f) throws IOException { final InodeTree.ResolveResult<FileSystem> res; res = fsState.resolve(getUriPath(f), true); if (res.isInternalDir()) { return f; } return res.targetFileSystem.resolvePath(res.remainingPath); }
@Test public void testResolvePathInternalPaths() throws IOException { Assert.assertEquals(new Path("/"), fsView.resolvePath(new Path("/"))); Assert.assertEquals(new Path("/internalDir"), fsView.resolvePath(new Path("/internalDir"))); } @Test
@Test(expected=FileNotFoundException.class) public void testResolvePathMissingThroughMountPoints2() throws IOException { fsView.mkdirs( fileSystemTestHelper.getTestRootPath(fsView, "/user/dirX")); fsView.resolvePath(new Path("/user/dirX/nonExisting")); }