BigTableWriter (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.io.sstable.format.big

## Class BigTableWriter

- java.lang.Object
- - org.apache.cassandra.io.sstable.SSTable
  - - org.apache.cassandra.io.sstable.format.SSTableWriter
    - - org.apache.cassandra.io.sstable.format.big.BigTableWriter

- All Implemented Interfaces:
    java.lang.AutoCloseable, Transactional

      public class BigTableWriter
      extends SSTableWriter

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.io.sstable.format.SSTableWriter

      `SSTableWriter.Factory`

    - ### Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Transactional

      `Transactional.AbstractTransactional`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SequentialWriter` | `dataFile`

    - ### Fields inherited from class org.apache.cassandra.io.sstable.format.SSTableWriter

      `header, keyCount, maxDataAge, metadataCollector, observers, repairedAt, rowIndexEntrySerializer, txnProxy`

    - ### Fields inherited from class org.apache.cassandra.io.sstable.SSTable

      `components, compression, descriptor, first, last, metadata, optimizationStrategy, TOMBSTONE_HISTOGRAM_BIN_SIZE, TOMBSTONE_HISTOGRAM_SPOOL_SIZE, TOMBSTONE_HISTOGRAM_TTL_ROUND_SECONDS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BigTableWriter(Descriptor descriptor, long keyCount, long repairedAt, CFMetaData metadata, MetadataCollector metadataCollector, SerializationHeader header, java.util.Collection<SSTableFlushObserver> observers, LifecycleTransaction txn)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RowIndexEntry` | `append(UnfilteredRowIterator iterator)` Appends partition data to this writer.
    `protected long` | `beforeAppend(DecoratedKey decoratedKey)` Perform sanity checks on @param decoratedKey and @return the position in the data file before any data is written
    `long` | `getEstimatedOnDiskBytesWritten()`
    `long` | `getFilePointer()`
    `long` | `getOnDiskFilePointer()`
    `void` | `mark()`
    `SSTableReader` | `openEarly()` Open the resultant SSTableReader before it has been fully written
    `SSTableReader` | `openFinalEarly()` Open the resultant SSTableReader once it has been fully written, but before the _set_ of tables that are being written together as one atomic operation are all ready
    `void` | `resetAndTruncate()`
    `protected SSTableWriter.TransactionalProxy` | `txnProxy()`

    - ### Methods inherited from class org.apache.cassandra.io.sstable.format.SSTableWriter

      `abort, abort, close, commit, create, create, create, create, create, finalizeMetadata, finish, finish, finished, prepareToCommit, rename, setMaxDataAge, setOpenResult, setRepairedAt, statsMetadata`

    - ### Methods inherited from class org.apache.cassandra.io.sstable.SSTable

      `addComponents, appendTOC, bytesOnDisk, componentsFor, decorateKey, delete, discoverComponentsFor, estimateRowsFromIndex, getAllFilePaths, getColumnFamilyName, getFilename, getIndexFilename, getKeyspaceName, getMinimalKey, getPartitioner, readTOC, toString, tryComponentFromFilename`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### dataFile

          protected final SequentialWriter dataFile

  - ### Constructor Detail

    - #### BigTableWriter

          public BigTableWriter(Descriptor descriptor,
                                long keyCount,
                                long repairedAt,
                                CFMetaData metadata,
                                MetadataCollector metadataCollector,
                                SerializationHeader header,
                                java.util.Collection<SSTableFlushObserver> observers,
                                LifecycleTransaction txn)

  - ### Method Detail

    - #### mark

          public void mark()

      Specified by:
        `mark` in class `SSTableWriter`

    - #### resetAndTruncate

          public void resetAndTruncate()

      Specified by:
        `resetAndTruncate` in class `SSTableWriter`

    - #### beforeAppend

          protected long beforeAppend(DecoratedKey decoratedKey)

      Perform sanity checks on @param decoratedKey and @return the position in the data file before any data is written

    - #### append

          public RowIndexEntry append(UnfilteredRowIterator iterator)

      Appends partition data to this writer.
      Specified by:
        `append` in class `SSTableWriter`
      Parameters:
        `iterator` - the partition to write
      Returns:
        the created index entry if something was written, that is if `iterator` wasn't empty, `null` otherwise.
      Throws:
        `FSWriteError` - if a write to the dataFile fails

    - #### openEarly

          public SSTableReader openEarly()

      Description copied from class: `SSTableWriter`
      Open the resultant SSTableReader before it has been fully written
      Specified by:
        `openEarly` in class `SSTableWriter`

    - #### openFinalEarly

          public SSTableReader openFinalEarly()

      Description copied from class: `SSTableWriter`
      Open the resultant SSTableReader once it has been fully written, but before the _set_ of tables that are being written together as one atomic operation are all ready
      Specified by:
        `openFinalEarly` in class `SSTableWriter`

    - #### txnProxy

          protected SSTableWriter.TransactionalProxy txnProxy()

      Specified by:
        `txnProxy` in class `SSTableWriter`

    - #### getFilePointer

          public long getFilePointer()

      Specified by:
        `getFilePointer` in class `SSTableWriter`

    - #### getOnDiskFilePointer

          public long getOnDiskFilePointer()

      Specified by:
        `getOnDiskFilePointer` in class `SSTableWriter`

    - #### getEstimatedOnDiskBytesWritten

          public long getEstimatedOnDiskBytesWritten()

      Overrides:
        `getEstimatedOnDiskBytesWritten` in class `SSTableWriter`

Copyright © 2018 The Apache Software Foundation