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

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

Introduction

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

Prototype

public void setWriteChecksum(boolean writeChecksum) 

Source Link

Document

Set the write checksum flag.

Usage

From source file:com.facebook.presto.raptor.storage.OrcRowSink.java

License:Apache License

private static RecordWriter createRecordWriter(Path target, JobConf conf) {
    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(FileSystem.class.getClassLoader())) {
        FileSystem fileSystem = target.getFileSystem(conf);
        fileSystem.setWriteChecksum(false);
        OrcFile.WriterOptions options = OrcFile.writerOptions(conf).fileSystem(fileSystem).compress(SNAPPY);
        return WRITER_CONSTRUCTOR.newInstance(target, options);
    } catch (ReflectiveOperationException | IOException e) {
        throw new PrestoException(RAPTOR_ERROR, "Failed to create writer", e);
    }//from w ww  . ja va 2s  .c om
}

From source file:org.apache.tajo.util.history.HistoryWriter.java

License:Apache License

public static FileSystem getNonCrcFileSystem(Path path, Configuration conf) throws IOException {
    // https://issues.apache.org/jira/browse/HADOOP-7844
    // If FileSystem is a local and CheckSumFileSystem, flushing doesn't touch file length.
    // So HistoryReader can't read until closing the file.
    FileSystem fs = path.getFileSystem(conf);
    if (path.toUri().getScheme().equals("file")) {
        fs.setWriteChecksum(false);
    }//w  w w . j av a 2s  .c o m

    return fs;
}