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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
abort(java.lang.Throwable accumulator)
Clean up resources on error.void
begin()
Called before writing any data to the sstable.void
complete()
Called when all data is written to the file and it's ready to be finished up.void
nextUnfilteredCluster(Unfiltered unfiltered)
Called after an unfiltered is written to the sstable.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 (seenextUnfilteredCluster(Unfiltered)
).void
staticRow(Row staticRow)
Called when a static row is being written to the sstable.
-
-
-
Method Detail
-
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 (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
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 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
void nextUnfilteredCluster(Unfiltered unfiltered)
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.
-
abort
default void abort(java.lang.Throwable accumulator)
Clean up resources on error. There should be no side effects if called multiple times.
-
-