Example usage for org.apache.hadoop.hdfs.web.resources ReplicationParam ReplicationParam

List of usage examples for org.apache.hadoop.hdfs.web.resources ReplicationParam ReplicationParam

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.web.resources ReplicationParam ReplicationParam.

Prototype

public ReplicationParam(final String str) 

Source Link

Document

Constructor.

Usage

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

License:Apache License

@Override
public boolean setReplication(final Path p, final short replication) throws IOException {
    statistics.incrementWriteOps(1);//from  ww  w. ja  va  2 s.co  m
    final HttpOpParam.Op op = PutOpParam.Op.SETREPLICATION;
    return new FsPathBooleanRunner(op, p, new ReplicationParam(replication)).run();
}

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

License:Apache License

@Override
public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite,
        final int bufferSize, final short replication, final long blockSize, final Progressable progress)
        throws IOException {
    statistics.incrementWriteOps(1);//www  .j a  v  a2s . co  m

    final HttpOpParam.Op op = PutOpParam.Op.CREATE;
    if (this.shouldUseEncryption) {
        return new EncryptedFsPathOutputStreamRunner(op, f, bufferSize,
                new PermissionParam(applyUMask(permission)), new OverwriteParam(overwrite),
                new BufferSizeParam(bufferSize), new ReplicationParam(replication),
                new BlockSizeParam(blockSize)).run();
    } else {
        return new FsPathOutputStreamRunner(op, f, bufferSize, new PermissionParam(applyUMask(permission)),
                new OverwriteParam(overwrite), new BufferSizeParam(bufferSize),
                new ReplicationParam(replication), new BlockSizeParam(blockSize)).run();
    }
}