Example usage for org.apache.hadoop.hdfs.protocol HdfsFileStatus getFullPath

List of usage examples for org.apache.hadoop.hdfs.protocol HdfsFileStatus getFullPath

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.protocol HdfsFileStatus getFullPath.

Prototype

default Path getFullPath(Path parent) 

Source Link

Document

Get the full path.

Usage

From source file:com.bigstep.datalake.DLFileSystem.java

License:Apache License

private FileStatus makeQualified(HdfsFileStatus f, Path parent) {

    return new FileStatus(f.getLen(), f.isDir(), f.getReplication(), f.getBlockSize(), f.getModificationTime(),
            f.getAccessTime(), f.getPermission(), f.getOwner(), f.getGroup(),
            f.isSymlink() ? new Path(f.getSymlink()) : null,
            makeQualified(f.getFullPath(parent).makeQualified(getUri(), getWorkingDirectory())));
}

From source file:com.pinterest.terrapin.hadoop.HdfsUploader.java

License:Apache License

@Override
List<Pair<Path, Long>> getFileList() {
    List<Pair<Path, Long>> fileSizePairList = Lists.newArrayList();
    try {/*from   ww  w  .j av  a  2 s  .  c o  m*/
        List<HdfsFileStatus> fileStatusList = TerrapinUtil.getHdfsFileList(dfsClient, hdfsDir.toString());
        for (HdfsFileStatus fileStatus : fileStatusList) {
            fileSizePairList.add(new ImmutablePair(fileStatus.getFullPath(hdfsDir), fileStatus.getLen()));
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    return fileSizePairList;
}