WriterContext (ORC Core 1.6.6 API)
Date: 2021-01-13

org.apache.orc.impl.writer

## Interface WriterContext

-     public interface WriterContext

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `buildIndex()` Should be building the row index.
    `OutStream` | `createStream(StreamName name)` Create a stream to store part of a column.
    `boolean[]` | `getBloomFilterColumns()` Get the bloom filter columns
    `double` | `getBloomFilterFPP()` Get bloom filter false positive percentage.
    `OrcFile.BloomFilterVersion` | `getBloomFilterVersion()`
    `Configuration` | `getConfiguration()` Get the writer's configuration.
    `double` | `getDictionaryKeySizeThreshold(int columnId)` Get the dictionary key size threshold.
    `OrcFile.EncodingStrategy` | `getEncodingStrategy()` Get the encoding strategy to use.
    `WriterEncryptionVariant` | `getEncryption(int columnId)` Get the encryption for the given column.
    `PhysicalWriter` | `getPhysicalWriter()` Get the PhysicalWriter.
    `boolean` | `getProlepticGregorian()` Should we write the data using the proleptic Gregorian calendar?
    `int` | `getRowIndexStride()` Get the stride rate of the row index.
    `DataMask` | `getUnencryptedMask(int columnId)` Get the mask for the unencrypted variant.
    `boolean` | `getUseUTCTimestamp()` Should the writer use UTC as the timezone?
    `OrcFile.Version` | `getVersion()` Get the version of the file to write.
    `boolean` | `isCompressed()` Is the ORC file compressed?
    `void` | `setEncoding(int column, WriterEncryptionVariant variant, OrcProto.ColumnEncoding encoding)` Set the encoding for the current stripe.
    `void` | `writeBloomFilter(StreamName name, OrcProto.BloomFilterIndex.Builder bloom)`
    `void` | `writeIndex(StreamName name, OrcProto.RowIndex.Builder index)`
    `void` | `writeStatistics(StreamName name, OrcProto.ColumnStatistics.Builder stats)` Set the column statistics for the stripe or file.

- - ### Method Detail

    - #### createStream

          OutStream createStream(StreamName name)
                          throws IOException

      Create a stream to store part of a column.
      Parameters:
        `name` - the name of the stream
      Returns:
        The output outStream that the section needs to be written to.
      Throws:
        `IOException`

    - #### getRowIndexStride

          int getRowIndexStride()

      Get the stride rate of the row index.

    - #### buildIndex

          boolean buildIndex()

      Should be building the row index.
      Returns:
        true if we are building the index

    - #### isCompressed

          boolean isCompressed()

      Is the ORC file compressed?
      Returns:
        are the streams compressed

    - #### getEncodingStrategy

          OrcFile.EncodingStrategy getEncodingStrategy()

      Get the encoding strategy to use.
      Returns:
        encoding strategy

    - #### getBloomFilterColumns

          boolean[] getBloomFilterColumns()

      Get the bloom filter columns
      Returns:
        bloom filter columns

    - #### getBloomFilterFPP

          double getBloomFilterFPP()

      Get bloom filter false positive percentage.
      Returns:
        fpp

    - #### getConfiguration

          Configuration getConfiguration()

      Get the writer's configuration.
      Returns:
        configuration

    - #### getVersion

          OrcFile.Version getVersion()

      Get the version of the file to write.

    - #### getBloomFilterVersion

          OrcFile.BloomFilterVersion getBloomFilterVersion()

    - #### writeIndex

          void writeIndex(StreamName name,
                          OrcProto.RowIndex.Builder index)
                   throws IOException

      Throws:
        `IOException`

    - #### writeBloomFilter

          void writeBloomFilter(StreamName name,
                                OrcProto.BloomFilterIndex.Builder bloom)
                         throws IOException

      Throws:
        `IOException`

    - #### getUnencryptedMask

          DataMask getUnencryptedMask(int columnId)

      Get the mask for the unencrypted variant.
      Parameters:
        `columnId` - the column id
      Returns:
        the mask to apply to the unencrypted data or null if there is none

    - #### getEncryption

          WriterEncryptionVariant getEncryption(int columnId)

      Get the encryption for the given column.
      Parameters:
        `columnId` - the root column id
      Returns:
        the column encryption or null if it isn't encrypted

    - #### getPhysicalWriter

          PhysicalWriter getPhysicalWriter()

      Get the PhysicalWriter.
      Returns:
        the file's physical writer.

    - #### setEncoding

          void setEncoding(int column,
                           WriterEncryptionVariant variant,
                           OrcProto.ColumnEncoding encoding)

      Set the encoding for the current stripe.
      Parameters:
        `column` - the column identifier
        `variant` - the encryption variant
        `encoding` - the encoding for this stripe

    - #### writeStatistics

          void writeStatistics(StreamName name,
                               OrcProto.ColumnStatistics.Builder stats)
                        throws IOException

      Set the column statistics for the stripe or file.
      Parameters:
        `name` - the name of the statistics stream
        `stats` - the statistics for this column in this stripe
      Throws:
        `IOException`

    - #### getUseUTCTimestamp

          boolean getUseUTCTimestamp()

      Should the writer use UTC as the timezone?

    - #### getDictionaryKeySizeThreshold

          double getDictionaryKeySizeThreshold(int columnId)

      Get the dictionary key size threshold.
      Parameters:
        `columnId` - the column id
      Returns:
        the minimum ratio for using a dictionary

    - #### getProlepticGregorian

          boolean getProlepticGregorian()

      Should we write the data using the proleptic Gregorian calendar?
      Returns:
        true if we should use the proleptic Gregorian calendar

Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.