Example usage for org.apache.hadoop.fs FileSystem create

List of usage examples for org.apache.hadoop.fs FileSystem create

Introduction

In this page you can find the example usage for org.apache.hadoop.fs FileSystem create.

Prototype

public FSDataOutputStream create(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize,
        short replication, long blockSize, Progressable progress, ChecksumOpt checksumOpt) throws IOException 

Source Link

Document

Create an FSDataOutputStream at the indicated Path with a custom checksum option.

Usage

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

License:Apache License

@Override
public FSDataOutputStream create(final Path f, final FsPermission permission, final EnumSet<CreateFlag> cflags,
        final int bufferSize, final short replication, final long blockSize, final Progressable progress,
        final ChecksumOpt checksumOpt) throws IOException {
    statistics.incrementWriteOps(1);// ww w. j a v  a  2  s.c om
    Path absF = fixRelativePart(f);
    return new FileSystemLinkResolver<FSDataOutputStream>() {
        @Override
        public FSDataOutputStream doCall(final Path p) throws IOException, UnresolvedLinkException {
            final DFSOutputStream dfsos = dfs.create(getPathName(p), permission, cflags, replication, blockSize,
                    progress, bufferSize, checksumOpt);
            return dfs.createWrappedOutputStream(dfsos, statistics);
        }

        @Override
        public FSDataOutputStream next(final FileSystem fs, final Path p) throws IOException {
            return fs.create(p, permission, cflags, bufferSize, replication, blockSize, progress, checksumOpt);
        }
    }.resolve(this, absF);
}