Class MemtableIndexWriter
java.lang.Object
org.apache.cassandra.index.sai.disk.v1.MemtableIndexWriter
- All Implemented Interfaces:
PerColumnIndexWriter
Column index writer that flushes indexed data directly from the corresponding Memtable index, without buffering index
data in memory.
-
Constructor Summary
ConstructorsConstructorDescriptionMemtableIndexWriter(MemtableIndex memtable, IndexDescriptor indexDescriptor, IndexTermType indexTermType, IndexIdentifier indexIdentifier, IndexMetrics indexMetrics, RowMapping rowMapping) -
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
-
MemtableIndexWriter
public MemtableIndexWriter(MemtableIndex memtable, IndexDescriptor indexDescriptor, IndexTermType indexTermType, IndexIdentifier indexIdentifier, IndexMetrics indexMetrics, RowMapping rowMapping)
-
-
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
-
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
-
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
-
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
-