Interface SSTableFlushObserver

All Known Implementing Classes:
PerSSTableIndexWriter, StorageAttachedIndexWriter

public interface SSTableFlushObserver
Observer for events in the lifecycle of writing out an sstable.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    abort(Throwable accumulator)
    Clean up resources on error.
    void
    Called before writing any data to the sstable.
    void
    Called when all data is written to the file and it's ready to be finished up.
    void
    Called after an unfiltered is written to the sstable.
    default void
    Called when current sstable writer is switched during sharded compaction to free any in-memory resources associated with the sstable without waiting for full transaction to complete
    void
    startPartition(DecoratedKey key, long keyPosition, long keyPositionForSASI)
    Called when a new partition in being written to the sstable, but before any cells are processed (see nextUnfilteredCluster(Unfiltered)).
    void
    staticRow(Row staticRow)
    Called when a static row is being written to the sstable.
  • Method Details

    • begin

      void begin()
      Called before writing any data to the sstable.
    • startPartition

      void startPartition(DecoratedKey key, long keyPosition, long keyPositionForSASI)
      Called when a new partition in being written to the sstable, but before any cells are processed (see nextUnfilteredCluster(Unfiltered)).
      Parameters:
      key - the key being appended to SSTable.
      keyPosition - the position of the key in the SSTable data file
      keyPositionForSASI - SSTable format specific key position for storage attached indexes, it can be in data file or in some index file. It is the same position as returned by KeyReader.keyPositionForSecondaryIndex() for the same format, and the same position as expected by SSTableReader.keyAtPositionFromSecondaryIndex(long).
    • staticRow

      void staticRow(Row staticRow)
      Called when a static row is being written to the sstable. If static columns are present in the table, it is called after startPartition(DecoratedKey, long, long) and before any calls to nextUnfilteredCluster(Unfiltered).
      Parameters:
      staticRow - static row appended to the sstable, can be empty, may not be null
    • nextUnfilteredCluster

      void nextUnfilteredCluster(Unfiltered unfiltered)
      Called after an unfiltered is written to the sstable. Will be preceded by a call to startPartition(DecoratedKey, long, long), and the unfiltered should be assumed to belong to that partition.
      Parameters:
      unfiltered - the unfiltered being written to the SSTable
    • complete

      void complete()
      Called when all data is written to the file and it's ready to be finished up.
    • onSSTableWriterSwitched

      default void onSSTableWriterSwitched()
      Called when current sstable writer is switched during sharded compaction to free any in-memory resources associated with the sstable without waiting for full transaction to complete
    • abort

      default void abort(Throwable accumulator)
      Clean up resources on error. There should be no side effects if called multiple times.