Package org.apache.cassandra.io.sstable
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 TypeMethodDescriptiondefault voidClean up resources on error.voidbegin()Called before writing any data to the sstable.voidcomplete()Called when all data is written to the file and it's ready to be finished up.voidnextUnfilteredCluster(Unfiltered unfiltered) Called after an unfiltered is written to the sstable.default voidCalled 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 completevoidstartPartition(DecoratedKey key, long keyPosition, long keyPositionForSASI) Called when a new partition in being written to the sstable, but before any cells are processed (seenextUnfilteredCluster(Unfiltered)).voidCalled when a static row is being written to the sstable.
-
Method Details
-
begin
void begin()Called before writing any data to the sstable. -
startPartition
Called when a new partition in being written to the sstable, but before any cells are processed (seenextUnfilteredCluster(Unfiltered)).- Parameters:
key- the key being appended to SSTable.keyPosition- the position of the key in the SSTable data filekeyPositionForSASI- 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 byKeyReader.keyPositionForSecondaryIndex()for the same format, and the same position as expected bySSTableReader.keyAtPositionFromSecondaryIndex(long).
-
staticRow
Called when a static row is being written to the sstable. If static columns are present in the table, it is called afterstartPartition(DecoratedKey, long, long)and before any calls tonextUnfilteredCluster(Unfiltered).- Parameters:
staticRow- static row appended to the sstable, can be empty, may not benull
-
nextUnfilteredCluster
Called after an unfiltered is written to the sstable. Will be preceded by a call tostartPartition(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
Clean up resources on error. There should be no side effects if called multiple times.
-