@Override public BlockLocation[] getBlockLocations() { return myFs.getBlockLocations(); }
@Override public BlockLocation[] getLocations(FileSystem fs, FileStatus status) throws IOException { if (status instanceof LocatedFileStatus) { return ((LocatedFileStatus) status).getBlockLocations(); } else { return fs.getFileBlockLocations(status, 0, status.getLen()); } }
private Optional<InternalHiveSplit> createInternalHiveSplit(LocatedFileStatus status, OptionalInt bucketNumber, boolean splittable) { splittable = splittable && isSplittable(inputFormat, fileSystem, status.getPath()); return createInternalHiveSplit( status.getPath(), status.getBlockLocations(), 0, status.getLen(), status.getLen(), bucketNumber, splittable); }
status.getBlockLocations()); } else { throw new IOException("path=" + p
@Override public BlockLocation[] getBlockLocations() { return myFs.getBlockLocations(); }
@Override public BlockLocation[] getBlockLocations() { return myFs.getBlockLocations(); }
protected BlockLocation[] getFileBlockLocations( FileSystem fs, FileStatus stat) throws IOException { if (stat instanceof LocatedFileStatus) { return ((LocatedFileStatus) stat).getBlockLocations(); } return fs.getFileBlockLocations(stat, 0, stat.getLen()); }
protected BlockLocation[] getFileBlockLocations( FileSystem fs, FileStatus stat) throws IOException { if (stat instanceof LocatedFileStatus) { return ((LocatedFileStatus) stat).getBlockLocations(); } return fs.getFileBlockLocations(stat, 0, stat.getLen()); }
protected BlockLocation[] getFileBlockLocations( FileSystem fs, FileStatus stat) throws IOException { if (stat instanceof LocatedFileStatus) { return ((LocatedFileStatus) stat).getBlockLocations(); } return fs.getFileBlockLocations(stat, 0, stat.getLen()); }
protected BlockLocation[] getFileBlockLocations( FileSystem fs, FileStatus stat) throws IOException { if (stat instanceof LocatedFileStatus) { return ((LocatedFileStatus) stat).getBlockLocations(); } return fs.getFileBlockLocations(stat, 0, stat.getLen()); }
@Override public BlockLocation[] getLocations(FileSystem fs, FileStatus status) throws IOException { if (status instanceof LocatedFileStatus) { return ((LocatedFileStatus) status).getBlockLocations(); } else { return fs.getFileBlockLocations(status, 0, status.getLen()); } }
@Override public BlockLocation[] getLocations(FileSystem fs, FileStatus status) throws IOException { if (status instanceof LocatedFileStatus) { return ((LocatedFileStatus) status).getBlockLocations(); } else { return fs.getFileBlockLocations(status, 0, status.getLen()); } }
@Override public BlockLocation[] getLocations(FileSystem fs, FileStatus status) throws IOException { if (status instanceof LocatedFileStatus) { return ((LocatedFileStatus) status).getBlockLocations(); } else { return fs.getFileBlockLocations(status, 0, status.getLen()); } }
protected BlockLocation[] getFileBlockLocations( FileSystem fs, FileStatus stat) throws IOException { if (stat instanceof LocatedFileStatus) { return ((LocatedFileStatus)stat).getBlockLocations(); } return fs.getFileBlockLocations(stat, 0, stat.getLen()); }
@Override public BlockLocation[] getLocations(FileSystem fs, FileStatus status) throws IOException { if (status instanceof LocatedFileStatus) { return ((LocatedFileStatus) status).getBlockLocations(); } else { return fs.getFileBlockLocations(status, 0, status.getLen()); } }
@Override public String[] getLocations() throws IOException { BlockLocation[] blkLocations; if (fileStatus instanceof LocatedFileStatus) { blkLocations = ((LocatedFileStatus)fileStatus).getBlockLocations(); } else { FileSystem fs = fileStatus.getPath().getFileSystem(FileFactory.getConfiguration()); blkLocations = fs.getFileBlockLocations(fileStatus.getPath(), 0L, fileStatus.getLen()); } return blkLocations[0].getHosts(); }
protected FileMetadata toMetadata(LocatedFileStatus fileStatus) { List<FileMetadata.BlockInfo> blocks = new ArrayList<>(); blocks.addAll(Arrays.stream(fileStatus.getBlockLocations()) .map(block -> new FileMetadata.BlockInfo(block.getOffset(), block.getLength(), block.isCorrupt())) .collect(Collectors.toList())); return new FileMetadata(fileStatus.getPath().toString(), fileStatus.getLen(), blocks); }
private Optional<InternalHiveSplit> createInternalHiveSplit(LocatedFileStatus status, OptionalInt bucketNumber, boolean splittable) { splittable = splittable && isSplittable(inputFormat, fileSystem, status.getPath()); return createInternalHiveSplit( status.getPath(), status.getBlockLocations(), 0, status.getLen(), status.getLen(), bucketNumber, splittable); }
@Override public RemoteIterator<LocatedFileStatus> listFiles(Path f, boolean recursive) throws FileNotFoundException, IOException { final String container = getContainerName(f); return RemoteIterators.transform( getFileSystemForPath(f).fs().listFiles(pathWithoutContainer(f), recursive), t -> new LocatedFileStatus(ContainerFileSystem.transform(t, container), t.getBlockLocations()) ); }
@Override protected RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f, final PathFilter filter) throws FileNotFoundException, IOException { final String container = getContainerName(f); final PathFilter alteredFilter = (path) -> { return filter.accept(transform(path, container)); }; return RemoteIterators.transform( ListAccessor.listLocatedFileStatus(getFileSystemForPath(f).fs(), pathWithoutContainer(f), alteredFilter), t -> new LocatedFileStatus(ContainerFileSystem.transform(t, container), t.getBlockLocations()) ); }