Example usage for org.apache.hadoop.fs FSDataOutputStreamBuilder recursive

List of usage examples for org.apache.hadoop.fs FSDataOutputStreamBuilder recursive

Introduction

In this page you can find the example usage for org.apache.hadoop.fs FSDataOutputStreamBuilder recursive.

Prototype

boolean recursive

To view the source code for org.apache.hadoop.fs FSDataOutputStreamBuilder recursive.

Click Source Link

Document

set to true to create missing directory.

Usage

From source file:org.apache.pulsar.io.hdfs.sink.HdfsAbstractSink.java

License:Apache License

@SuppressWarnings("rawtypes")
protected final FSDataOutputStreamBuilder getOutputStreamBuilder() throws IOException {
    Path path = getPath();// ww  w  .j a  v  a  2 s.c  om
    FileSystem fs = getFileSystemAsUser(getConfiguration(), getUserGroupInformation());
    FSDataOutputStreamBuilder builder = fs.exists(path) ? fs.appendFile(path) : fs.createFile(path);
    return builder.recursive().permission(new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL));
}