Example usage for org.apache.hadoop.fs CreateFlag validateForAppend

List of usage examples for org.apache.hadoop.fs CreateFlag validateForAppend

Introduction

In this page you can find the example usage for org.apache.hadoop.fs CreateFlag validateForAppend.

Prototype

public static void validateForAppend(EnumSet<CreateFlag> flag) 

Source Link

Document

Validate the CreateFlag for the append operation.

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);
    try {/*w ww  .j  a v  a 2  s .  c o m*/
        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);
    }
}