Example usage for org.apache.hadoop.io EnumSetWritable EnumSetWritable

List of usage examples for org.apache.hadoop.io EnumSetWritable EnumSetWritable

Introduction

In this page you can find the example usage for org.apache.hadoop.io EnumSetWritable EnumSetWritable.

Prototype

public EnumSetWritable(EnumSet<E> value, Class<E> elementType) 

Source Link

Document

Construct a new EnumSetWritable.

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 www.j  a v  a 2  s.  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);
    }
}