SSTableWriter (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.io.sstable

## Class SSTableWriter

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

-     public class SSTableWriter
      extends SSTable

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `END_OF_ROW`

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

      `components, compression, descriptor, first, last, metadata, partitioner, TOMBSTONE_HISTOGRAM_BIN_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSTableWriter(java.lang.String filename, long keyCount, long repairedAt)`
    `SSTableWriter(java.lang.String filename, long keyCount, long repairedAt, CFMetaData metadata, IPartitioner<?> partitioner, MetadataCollector sstableMetadataCollector)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `abort()` After failure, attempt to close the index writer and data file before deleting all temp components for the sstable
    `void` | `abort(boolean closeBf)`
    `RowIndexEntry` | `append(AbstractCompactedRow row)`
    `void` | `append(DecoratedKey decoratedKey, ColumnFamily cf)`
    `long` | `appendFromStream(DecoratedKey key, CFMetaData metadata, java.io.DataInput in, Descriptor.Version version)`
    `Pair<Descriptor,StatsMetadata>` | `close()`
    `SSTableReader` | `closeAndOpenReader()`
    `SSTableReader` | `closeAndOpenReader(long maxDataAge)`
    `SSTableReader` | `closeAndOpenReader(long maxDataAge, long repairedAt)`
    `long` | `getFilePointer()`
    `long` | `getOnDiskFilePointer()`
    `void` | `isolateReferences()`
    `void` | `mark()`
    `SSTableReader` | `openEarly(long maxDataAge)`
    `static RowIndexEntry` | `rawAppend(ColumnFamily cf, long startPosition, DecoratedKey key, DataOutputPlus out)`
    `static void` | `rename(Descriptor tmpdesc, Descriptor newdesc, java.util.Set<Component> components)`
    `void` | `resetAndTruncate()`

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

      `addComponents, appendTOC, bytesOnDisk, componentsFor, delete, getColumnFamilyName, getFilename, getIndexFilename, getKeyspaceName, getMinimalKey, readTOC, toString, tryComponentFromFilename`

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

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

- - ### Field Detail

    - #### END_OF_ROW

          public static final int END_OF_ROW

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SSTableWriter

          public SSTableWriter(java.lang.String filename,
                       long keyCount,
                       long repairedAt)

    - #### SSTableWriter

          public SSTableWriter(java.lang.String filename,
                       long keyCount,
                       long repairedAt,
                       CFMetaData metadata,
                       IPartitioner<?> partitioner,
                       MetadataCollector sstableMetadataCollector)

  - ### Method Detail

    - #### mark

          public void mark()

    - #### resetAndTruncate

          public void resetAndTruncate()

    - #### append

          public RowIndexEntry append(AbstractCompactedRow row)

      Parameters:
        `row` -
      Returns:
        null if the row was compacted away entirely; otherwise, the PK index entry for this row

    - #### append

          public void append(DecoratedKey decoratedKey,
                    ColumnFamily cf)

    - #### rawAppend

          public static RowIndexEntry rawAppend(ColumnFamily cf,
                                long startPosition,
                                DecoratedKey key,
                                DataOutputPlus out)
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### appendFromStream

          public long appendFromStream(DecoratedKey key,
                              CFMetaData metadata,
                              java.io.DataInput in,
                              Descriptor.Version version)
                                throws java.io.IOException

      Throws:
        `java.io.IOException` - if a read from the DataInput fails
        `FSWriteError` - if a write to the dataFile fails

    - #### abort

          public void abort()

      After failure, attempt to close the index writer and data file before deleting all temp components for the sstable

    - #### abort

          public void abort(boolean closeBf)

    - #### isolateReferences

          public void isolateReferences()

    - #### openEarly

          public SSTableReader openEarly(long maxDataAge)

    - #### closeAndOpenReader

          public SSTableReader closeAndOpenReader()

    - #### closeAndOpenReader

          public SSTableReader closeAndOpenReader(long maxDataAge)

    - #### closeAndOpenReader

          public SSTableReader closeAndOpenReader(long maxDataAge,
                                         long repairedAt)

    - #### close

          public Pair<Descriptor,StatsMetadata> close()

    - #### rename

          public static void rename(Descriptor tmpdesc,
                    Descriptor newdesc,
                    java.util.Set<Component> components)

    - #### getFilePointer

          public long getFilePointer()

    - #### getOnDiskFilePointer

          public long getOnDiskFilePointer()

Copyright © 2014 The Apache Software Foundation