Interface PerColumnIndexWriter

All Known Implementing Classes:
MemtableIndexWriter, SSTableIndexWriter

public interface PerColumnIndexWriter
Creates the on-disk components for a given column index.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Aborts accumulating data.
    void
    addRow(PrimaryKey key, Row row, long sstableRowId)
    Adds a row to this index.
    void
    complete(com.google.common.base.Stopwatch stopwatch)
    Builds on-disk index data structures from accumulated data, moves them all to the filesystem, and fsync created files.
    void
    onSSTableWriterSwitched(com.google.common.base.Stopwatch stopwatch)
    Called when current SSTable writer is switched during sharded compaction to free any in-memory resources associated with the SSTable for current index without waiting for full transaction to complete
  • Method Details

    • addRow

      void addRow(PrimaryKey key, Row row, long sstableRowId) throws IOException
      Adds a row to this index.

      Note: Callers are responsible for ensuring that rows are added in PrimaryKey order.

      Throws:
      IOException
    • complete

      void complete(com.google.common.base.Stopwatch stopwatch) throws IOException
      Builds on-disk index data structures from accumulated data, moves them all to the filesystem, and fsync created files.
      Throws:
      IOException
    • onSSTableWriterSwitched

      void onSSTableWriterSwitched(com.google.common.base.Stopwatch stopwatch) throws IOException
      Called when current SSTable writer is switched during sharded compaction to free any in-memory resources associated with the SSTable for current index without waiting for full transaction to complete
      Throws:
      IOException
    • abort

      void abort(Throwable cause)
      Aborts accumulating data. Allows to clean up resources on error.

      Note: Implementations should be idempotent, i.e. safe to call multiple times without producing undesirable side-effects.