org.apache.cassandra.io.compress

## Class CompressionMetadata.Writer

- java.lang.Object
- - org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
  - - org.apache.cassandra.io.compress.CompressionMetadata.Writer

- All Implemented Interfaces:
    java.lang.AutoCloseable, Transactional
  Enclosing class:
    CompressionMetadata

      public static class CompressionMetadata.Writer
      extends Transactional.AbstractTransactional
      implements Transactional

- - ### 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`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOffset(long offset)`
    `long` | `chunkOffsetBy(int chunkIndex)` Get a chunk offset by it's index.
    `protected java.lang.Throwable` | `doAbort(java.lang.Throwable accumulate)`
    `protected java.lang.Throwable` | `doCommit(java.lang.Throwable accumulate)`
    `protected java.lang.Throwable` | `doPreCleanup(java.lang.Throwable failed)` perform an exception-safe pre-abort cleanup; this will still be run *after* commit
    `void` | `doPrepare()` Do any preparatory work prior to commit.
    `CompressionMetadata.Writer` | `finalizeLength(long dataLength, int chunkCount)`
    `static CompressionMetadata.Writer` | `open(CompressionParameters parameters, java.lang.String path)`
    `CompressionMetadata` | `open(long dataLength, long compressedLength)`
    `void` | `resetAndTruncate(int chunkIndex)` Reset the writer so that the next chunk offset written will be the one of `chunkIndex`.

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

      `abort, abort, close, commit, commit, doPostCleanup, 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, commit, prepareToCommit`

    - ### Methods inherited from interface java.lang.AutoCloseable

      `close`

- - ### Method Detail

    - #### open

          public static CompressionMetadata.Writer open(CompressionParameters parameters,
                                                        java.lang.String path)

    - #### addOffset

          public void addOffset(long offset)

    - #### finalizeLength

          public CompressionMetadata.Writer finalizeLength(long dataLength,
                                                           int chunkCount)

    - #### doPrepare

          public 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`

    - #### open

          public CompressionMetadata open(long dataLength,
                                          long compressedLength)

    - #### chunkOffsetBy

          public long chunkOffsetBy(int chunkIndex)

      Get a chunk offset by it's index.
      Parameters:
        `chunkIndex` - Index of the chunk.
      Returns:
        offset of the chunk in the compressed file.

    - #### resetAndTruncate

          public void resetAndTruncate(int chunkIndex)

      Reset the writer so that the next chunk offset written will be the one of `chunkIndex`.
      Parameters:
        `chunkIndex` - the next index to write

    - #### doPreCleanup

          protected java.lang.Throwable doPreCleanup(java.lang.Throwable failed)

      Description copied from class: `Transactional.AbstractTransactional`
      perform an exception-safe pre-abort cleanup; this will still be run *after* commit
      Overrides:
        `doPreCleanup` in class `Transactional.AbstractTransactional`

    - #### 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`

Copyright © 2018 The Apache Software Foundation