Example usage for org.apache.hadoop.hdfs.protocol LastBlockWithStatus getFileStatus

List of usage examples for org.apache.hadoop.hdfs.protocol LastBlockWithStatus getFileStatus

Introduction

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

Prototype

public HdfsFileStatus getFileStatus() 

Source Link

Usage

From source file:com.mellanox.r4h.DFSClient.java

License:Apache License

/** Method to get stream returned by append call */
private DFSOutputStream callAppend(String src, int buffersize, EnumSet<CreateFlag> flag, Progressable progress,
        String[] favoredNodes) throws IOException {
    CreateFlag.validateForAppend(flag);// ww  w  .j av a  2s .  c om
    try {
        LastBlockWithStatus blkWithStatus = namenode.append(src, clientName,
                new EnumSetWritable<>(flag, CreateFlag.class));
        return DFSOutputStream.newStreamForAppend(this, src, flag, buffersize, progress,
                blkWithStatus.getLastBlock(), blkWithStatus.getFileStatus(), dfsClientConf.createChecksum(),
                favoredNodes);
    } catch (RemoteException re) {
        throw re.unwrapRemoteException(AccessControlException.class, FileNotFoundException.class,
                SafeModeException.class, DSQuotaExceededException.class, UnsupportedOperationException.class,
                UnresolvedPathException.class, SnapshotAccessControlException.class);
    }
}