Class PerSSTableIndexWriter
- java.lang.Object
-
- org.apache.cassandra.index.sasi.disk.PerSSTableIndexWriter
-
- All Implemented Interfaces:
SSTableFlushObserver
public class PerSSTableIndexWriter extends java.lang.Object implements SSTableFlushObserver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PerSSTableIndexWriter.Index
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<ColumnMetadata,PerSSTableIndexWriter.Index>
indexes
-
Constructor Summary
Constructors Constructor Description PerSSTableIndexWriter(AbstractType<?> keyValidator, Descriptor descriptor, OperationType source, java.util.Map<ColumnMetadata,ColumnIndex> supportedIndexes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.boolean
equals(java.lang.Object o)
Descriptor
getDescriptor()
PerSSTableIndexWriter.Index
getIndex(ColumnMetadata columnDef)
int
hashCode()
protected long
maxMemorySize(ColumnIndex columnIndex)
protected PerSSTableIndexWriter.Index
newIndex(ColumnIndex columnIndex)
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 (seeSSTableFlushObserver.nextUnfilteredCluster(Unfiltered)
).void
staticRow(Row staticRow)
Called when a static row is being written to the sstable.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.io.sstable.SSTableFlushObserver
abort
-
-
-
-
Field Detail
-
indexes
protected final java.util.Map<ColumnMetadata,PerSSTableIndexWriter.Index> indexes
-
-
Constructor Detail
-
PerSSTableIndexWriter
public PerSSTableIndexWriter(AbstractType<?> keyValidator, Descriptor descriptor, OperationType source, java.util.Map<ColumnMetadata,ColumnIndex> supportedIndexes)
-
-
Method Detail
-
begin
public void begin()
Description copied from interface:SSTableFlushObserver
Called before writing any data to the sstable.- Specified by:
begin
in interfaceSSTableFlushObserver
-
startPartition
public void startPartition(DecoratedKey key, long keyPosition, long KeyPositionForSASI)
Description copied from interface:SSTableFlushObserver
Called when a new partition in being written to the sstable, but before any cells are processed (seeSSTableFlushObserver.nextUnfilteredCluster(Unfiltered)
).- Specified by:
startPartition
in interfaceSSTableFlushObserver
- 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
public void staticRow(Row staticRow)
Description copied from interface:SSTableFlushObserver
Called when a static row is being written to the sstable. If static columns are present in the table, it is called afterSSTableFlushObserver.startPartition(DecoratedKey, long, long)
and before any calls toSSTableFlushObserver.nextUnfilteredCluster(Unfiltered)
.- Specified by:
staticRow
in interfaceSSTableFlushObserver
- Parameters:
staticRow
- static row appended to the sstable, can be empty, may not benull
-
nextUnfilteredCluster
public void nextUnfilteredCluster(Unfiltered unfiltered)
Description copied from interface:SSTableFlushObserver
Called after an unfiltered is written to the sstable. Will be preceded by a call toSSTableFlushObserver.startPartition(DecoratedKey, long, long)
, and the unfiltered should be assumed to belong to that partition.- Specified by:
nextUnfilteredCluster
in interfaceSSTableFlushObserver
- Parameters:
unfiltered
- the unfiltered being written to the SSTable
-
complete
public void complete()
Description copied from interface:SSTableFlushObserver
Called when all data is written to the file and it's ready to be finished up.- Specified by:
complete
in interfaceSSTableFlushObserver
-
getIndex
public PerSSTableIndexWriter.Index getIndex(ColumnMetadata columnDef)
-
getDescriptor
public Descriptor getDescriptor()
-
newIndex
protected PerSSTableIndexWriter.Index newIndex(ColumnIndex columnIndex)
-
maxMemorySize
protected long maxMemorySize(ColumnIndex columnIndex)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-