@Override public BlockLocation[] next(final AbstractFileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getFileBlockLocations(p, start, len); } }.resolve(this, absF);
@Override public Object call() throws Exception { // Argument is checked by Hadoop. return fs.getFileBlockLocations(null, 1, 2); } }, NullPointerException.class, null);
@Override public BlockLocation[] getFileBlockLocations(final Path f, final long start, final long len) throws IOException, UnresolvedLinkException { return myFs.getFileBlockLocations(fullPath(f), start, len); }
@Override public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws IOException, UnresolvedLinkException { checkPath(f); return myFs.getFileBlockLocations(f, start, len); }
@Override public Object call() throws Exception { return fs.getFileBlockLocations(new Path("/someFile"), 1, 2); } }, FileNotFoundException.class, null);
@Override public BlockLocation[] getFileBlockLocations(final Path f, final long start, final long len) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException { InodeTree.ResolveResult<AbstractFileSystem> res = fsState.resolve(getUriPath(f), true); return res.targetFileSystem.getFileBlockLocations(res.remainingPath, start, len); }
@Override public LocatedFileStatus next() throws IOException { if (!hasNext()) { throw new NoSuchElementException("No more entry in " + f); } FileStatus result = itor.next(); BlockLocation[] locs = null; if (result.isFile()) { locs = getFileBlockLocations( result.getPath(), 0, result.getLen()); } return new LocatedFileStatus(result, locs); } };
/** @throws Exception If failed. */ @Test public void testGetFileBlockLocations() throws Exception { Path igfsHome = new Path(primaryFsUri); Path file = new Path(igfsHome, "someFile"); try (OutputStream out = new BufferedOutputStream(fs.create(file, EnumSet.noneOf(CreateFlag.class), Options.CreateOpts.perms(FsPermission.getDefault())))) { byte[] data = new byte[128 * 1024]; for (int i = 0; i < 100; i++) out.write(data); out.flush(); } try (FSDataInputStream in = fs.open(file, 1024 * 1024)) { byte[] data = new byte[128 * 1024]; int read; do { read = in.read(data); } while (read > 0); } FileStatus status = fs.getFileStatus(file); int grpLen = 128 * 512 * 1024; int grpCnt = (int)((status.getLen() + grpLen - 1) / grpLen); BlockLocation[] locations = fs.getFileBlockLocations(file, 0, status.getLen()); assertEquals(grpCnt, locations.length); }
@Override public BlockLocation[] next(final AbstractFileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getFileBlockLocations(p, start, len); } }.resolve(this, absF);
@Override public BlockLocation[] next(final AbstractFileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getFileBlockLocations(p, start, len); } }.resolve(this, absF);
@Override public BlockLocation[] next(final AbstractFileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getFileBlockLocations(p, start, len); } }.resolve(this, absF);
@Override public BlockLocation[] next(final AbstractFileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getFileBlockLocations(p, start, len); } }.resolve(this, absF);
@Override public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws IOException, UnresolvedLinkException { checkPath(f); return myFs.getFileBlockLocations(f, start, len); }
@Override public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws IOException, UnresolvedLinkException { checkPath(f); return myFs.getFileBlockLocations(f, start, len); }
@Override public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws IOException, UnresolvedLinkException { checkPath(f); return myFs.getFileBlockLocations(f, start, len); }
@Override public BlockLocation[] getFileBlockLocations(final Path f, final long start, final long len) throws IOException, UnresolvedLinkException { return myFs.getFileBlockLocations(fullPath(f), start, len); }
@Override public BlockLocation[] getFileBlockLocations(final Path f, final long start, final long len) throws IOException, UnresolvedLinkException { return myFs.getFileBlockLocations(fullPath(f), start, len); }
@Override public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws IOException, UnresolvedLinkException { checkPath(f); return myFs.getFileBlockLocations(f, start, len); }
@Override public BlockLocation[] getFileBlockLocations(final Path f, final long start, final long len) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException { InodeTree.ResolveResult<AbstractFileSystem> res = fsState.resolve(getUriPath(f), true); return res.targetFileSystem.getFileBlockLocations(res.remainingPath, start, len); }
@Override public BlockLocation[] getFileBlockLocations(final Path f, final long start, final long len) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException { InodeTree.ResolveResult<AbstractFileSystem> res = fsState.resolve(getUriPath(f), true); return res.targetFileSystem.getFileBlockLocations(res.remainingPath, start, len); }