Class SSTableIndexWriter
java.lang.Object
org.apache.cassandra.index.sai.disk.v1.SSTableIndexWriter
- All Implemented Interfaces:
PerColumnIndexWriter
Column index writer that accumulates (on-heap) indexed data from a compacted SSTable as it's being flushed to disk.
-
Constructor Summary
ConstructorsConstructorDescriptionSSTableIndexWriter(IndexDescriptor indexDescriptor, StorageAttachedIndex index, NamedMemoryLimiter limiter, BooleanSupplier isIndexValid) -
Method Summary
Modifier and TypeMethodDescriptionvoidAborts accumulating data.voidaddRow(PrimaryKey key, Row row, long sstableRowId) Adds a row to this index.voidcomplete(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.voidonSSTableWriterSwitched(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
-
Constructor Details
-
SSTableIndexWriter
public SSTableIndexWriter(IndexDescriptor indexDescriptor, StorageAttachedIndex index, NamedMemoryLimiter limiter, BooleanSupplier isIndexValid)
-
-
Method Details
-
addRow
Description copied from interface:PerColumnIndexWriterAdds a row to this index.Note: Callers are responsible for ensuring that rows are added in
PrimaryKeyorder.- Specified by:
addRowin interfacePerColumnIndexWriter- Throws:
IOException
-
onSSTableWriterSwitched
Description copied from interface:PerColumnIndexWriterCalled 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- Specified by:
onSSTableWriterSwitchedin interfacePerColumnIndexWriter- Throws:
IOException
-
complete
Description copied from interface:PerColumnIndexWriterBuilds on-disk index data structures from accumulated data, moves them all to the filesystem, and fsync created files.- Specified by:
completein interfacePerColumnIndexWriter- Throws:
IOException
-
abort
Description copied from interface:PerColumnIndexWriterAborts 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.
- Specified by:
abortin interfacePerColumnIndexWriter
-