org.apache.cassandra.io.sstable

## Class SSTableTxnWriter

- java.lang.Object
- - org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
  - - org.apache.cassandra.io.sstable.SSTableTxnWriter

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

      public class SSTableTxnWriter
      extends Transactional.AbstractTransactional
      implements Transactional

  A wrapper for SSTableWriter and LifecycleTransaction to be used when the writer is the only participant in the transaction and therefore it can safely own the transaction.

- - ### Nested Class Summary

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

      `Transactional.AbstractTransactional.State`

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

      `Transactional.AbstractTransactional`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSTableTxnWriter(LifecycleTransaction txn, SSTableMultiWriter writer)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `append(UnfilteredRowIterator iterator)`
    `static SSTableTxnWriter` | `create(CFMetaData cfm, Descriptor descriptor, long keyCount, long repairedAt, int sstableLevel, SerializationHeader header, java.util.Collection<Index> indexes)`
    `static SSTableTxnWriter` | `create(ColumnFamilyStore cfs, Descriptor descriptor, long keyCount, long repairedAt, int sstableLevel, SerializationHeader header)`
    `static SSTableTxnWriter` | `create(ColumnFamilyStore cfs, java.lang.String filename, long keyCount, long repairedAt, int sstableLevel, SerializationHeader header)`
    `static SSTableTxnWriter` | `create(ColumnFamilyStore cfs, java.lang.String filename, long keyCount, long repairedAt, SerializationHeader header)`
    `static SSTableTxnWriter` | `createRangeAware(CFMetaData cfm, long keyCount, long repairedAt, SSTableFormat.Type type, int sstableLevel, SerializationHeader header)`
    `protected java.lang.Throwable` | `doAbort(java.lang.Throwable accumulate)`
    `protected java.lang.Throwable` | `doCommit(java.lang.Throwable accumulate)`
    `protected java.lang.Throwable` | `doPostCleanup(java.lang.Throwable accumulate)` perform an exception-safe post-abort cleanup
    `protected void` | `doPrepare()` Do any preparatory work prior to commit.
    `java.util.Collection<SSTableReader>` | `finish(boolean openResult)`
    `java.lang.String` | `getFilename()`
    `long` | `getFilePointer()`

    - ### Methods inherited from class org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional

      `abort, abort, close, commit, commit, doPreCleanup, finish, permitRedundantTransitions, prepareToCommit, state`

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

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

    - ### Methods inherited from interface org.apache.cassandra.utils.concurrent.Transactional

      `abort, close, commit, prepareToCommit`

- - ### Constructor Detail

    - #### SSTableTxnWriter

          public SSTableTxnWriter(LifecycleTransaction txn,
                                  SSTableMultiWriter writer)

  - ### Method Detail

    - #### append

          public boolean append(UnfilteredRowIterator iterator)

    - #### getFilename

          public java.lang.String getFilename()

    - #### getFilePointer

          public long getFilePointer()

    - #### doCommit

          protected java.lang.Throwable doCommit(java.lang.Throwable accumulate)

      Specified by:
        `doCommit` in class `Transactional.AbstractTransactional`

    - #### doAbort

          protected java.lang.Throwable doAbort(java.lang.Throwable accumulate)

      Specified by:
        `doAbort` in class `Transactional.AbstractTransactional`

    - #### doPrepare

          protected void doPrepare()

      Description copied from class: `Transactional.AbstractTransactional`
      Do any preparatory work prior to commit. This method should throw any exceptions that can be encountered during the finalization of the behaviour.
      Specified by:
        `doPrepare` in class `Transactional.AbstractTransactional`

    - #### doPostCleanup

          protected java.lang.Throwable doPostCleanup(java.lang.Throwable accumulate)

      Description copied from class: `Transactional.AbstractTransactional`
      perform an exception-safe post-abort cleanup
      Overrides:
        `doPostCleanup` in class `Transactional.AbstractTransactional`

    - #### finish

          public java.util.Collection<SSTableReader> finish(boolean openResult)

    - #### create

          public static SSTableTxnWriter create(ColumnFamilyStore cfs,
                                                Descriptor descriptor,
                                                long keyCount,
                                                long repairedAt,
                                                int sstableLevel,
                                                SerializationHeader header)

    - #### createRangeAware

          public static SSTableTxnWriter createRangeAware(CFMetaData cfm,
                                                          long keyCount,
                                                          long repairedAt,
                                                          SSTableFormat.Type type,
                                                          int sstableLevel,
                                                          SerializationHeader header)

    - #### create

          public static SSTableTxnWriter create(CFMetaData cfm,
                                                Descriptor descriptor,
                                                long keyCount,
                                                long repairedAt,
                                                int sstableLevel,
                                                SerializationHeader header,
                                                java.util.Collection<Index> indexes)

    - #### create

          public static SSTableTxnWriter create(ColumnFamilyStore cfs,
                                                java.lang.String filename,
                                                long keyCount,
                                                long repairedAt,
                                                int sstableLevel,
                                                SerializationHeader header)

    - #### create

          public static SSTableTxnWriter create(ColumnFamilyStore cfs,
                                                java.lang.String filename,
                                                long keyCount,
                                                long repairedAt,
                                                SerializationHeader header)

Copyright © 2018 The Apache Software Foundation