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

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

Introduction

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

Prototype

public LocatedBlock getLastBlock() 

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);/*from   ww w  . ja v a 2 s  .  co m*/
    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);
    }
}