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 inherited from class org.apache.cassandra.io.sstable.SSTable

      `COMPONENT_DATA, COMPONENT_DIGEST, COMPONENT_FILTER, COMPONENT_INDEX, COMPONENT_STATS, COMPONENT_SUMMARY, components, compression, descriptor, first, last, maxTimestampComparator, metadata, partitioner, sstableComparator, sstableOrdering, TEMPFILE_MARKER, TOMBSTONE_HISTOGRAM_BIN_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSTableWriter(java.lang.String filename, long keyCount)`
    `SSTableWriter(java.lang.String filename, long keyCount, CFMetaData metadata, IPartitioner<?> partitioner, SSTableMetadata.Collector 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
    `RowIndexEntry` | `append(AbstractCompactedRow row)`
    `void` | `append(DecoratedKey decoratedKey, ColumnFamily cf)`
    `long` | `appendFromStream(DecoratedKey key, CFMetaData metadata, long dataSize, java.io.DataInput in)`
    `SSTableReader` | `closeAndOpenReader()`
    `SSTableReader` | `closeAndOpenReader(long maxDataAge)`
    `long` | `getFilePointer()`
    `long` | `getOnDiskFilePointer()`
    `void` | `mark()`
    `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, delete, getColumnFamilyName, getFilename, getIndexFilename, getMinimalKey, getTableName, getTotalBytes, readTOC, toString, tryComponentFromFilename`

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

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

- - ### Constructor Detail

    - #### SSTableWriter

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

    - #### SSTableWriter

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

  - ### Method Detail

    - #### mark

          public void mark()

    - #### resetAndTruncate

          public void resetAndTruncate()

    - #### append

          public RowIndexEntry append(AbstractCompactedRow row)

    - #### append

          public void append(DecoratedKey decoratedKey,
                    ColumnFamily cf)

    - #### appendFromStream

          public long appendFromStream(DecoratedKey key,
                              CFMetaData metadata,
                              long dataSize,
                              java.io.DataInput in)
                                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

    - #### closeAndOpenReader

          public SSTableReader closeAndOpenReader()

    - #### closeAndOpenReader

          public SSTableReader closeAndOpenReader(long maxDataAge)

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