Java Code Examples for org.apache.hadoop.hdfs.protocol.HdfsFileStatus#getFullPath()
The following examples show how to use
org.apache.hadoop.hdfs.protocol.HdfsFileStatus#getFullPath() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestStorageMover.java From hadoop with Apache License 2.0 | 5 votes |
private void verifyRecursively(final Path parent, final HdfsFileStatus status) throws Exception { if (status.isDir()) { Path fullPath = parent == null ? new Path("/") : status.getFullPath(parent); DirectoryListing children = dfs.getClient().listPaths( fullPath.toString(), HdfsFileStatus.EMPTY_NAME, true); for (HdfsFileStatus child : children.getPartialListing()) { verifyRecursively(fullPath, child); } } else if (!status.isSymlink()) { // is file verifyFile(parent, status, null); } }
Example 2
Source File: TestStorageMover.java From big-c with Apache License 2.0 | 5 votes |
private void verifyRecursively(final Path parent, final HdfsFileStatus status) throws Exception { if (status.isDir()) { Path fullPath = parent == null ? new Path("/") : status.getFullPath(parent); DirectoryListing children = dfs.getClient().listPaths( fullPath.toString(), HdfsFileStatus.EMPTY_NAME, true); for (HdfsFileStatus child : children.getPartialListing()) { verifyRecursively(fullPath, child); } } else if (!status.isSymlink()) { // is file verifyFile(parent, status, null); } }
Example 3
Source File: DFSClient.java From RDFS with Apache License 2.0 | 5 votes |
/** * Convert an HdfsFileStatus to a FileStatus * @param stat an HdfsFileStatus * @param src parent path in string representation * @return a FileStatus object */ private static FileStatus toFileStatus(HdfsFileStatus stat, String src) { if (stat == null) { return null; } return new FileStatus(stat.getLen(), stat.isDir(), stat.getReplication(), stat.getBlockSize(), stat.getModificationTime(), stat.getAccessTime(), stat.getPermission(), stat.getOwner(), stat.getGroup(), stat.getFullPath(new Path(src))); // full path }
Example 4
Source File: DFSClient.java From RDFS with Apache License 2.0 | 5 votes |
/** * Convert an HdfsFileStatus and its block locations to a LocatedFileStatus * @param stat an HdfsFileStatus * @param locs the file's block locations * @param src parent path in string representation * @return a FileStatus object */ private static LocatedFileStatus toLocatedFileStatus( HdfsFileStatus stat, LocatedBlocks locs, String src) { if (stat == null) { return null; } return new LocatedFileStatus(stat.getLen(), stat.isDir(), stat.getReplication(), stat.getBlockSize(), stat.getModificationTime(), stat.getAccessTime(), stat.getPermission(), stat.getOwner(), stat.getGroup(), stat.getFullPath(new Path(src)), // full path DFSUtil.locatedBlocks2Locations(locs)); }