Package org.apache.cassandra.io.sstable
Class AbstractSSTableIterator<RIE extends AbstractRowIndexEntry>
- java.lang.Object
-
- org.apache.cassandra.io.sstable.AbstractSSTableIterator<RIE>
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.util.Iterator<Unfiltered>
,BaseRowIterator<Unfiltered>
,UnfilteredRowIterator
,CloseableIterator<Unfiltered>
- Direct Known Subclasses:
SSTableIterator
,SSTableReversedIterator
public abstract class AbstractSSTableIterator<RIE extends AbstractRowIndexEntry> extends java.lang.Object implements UnfilteredRowIterator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AbstractSSTableIterator.AbstractReader
protected class
AbstractSSTableIterator.ForwardReader
static interface
AbstractSSTableIterator.Reader
-
Field Summary
Fields Modifier and Type Field Description protected ColumnFilter
columns
protected DeserializationHelper
helper
protected FileHandle
ifile
protected DecoratedKey
key
protected TableMetadata
metadata
protected DeletionTime
partitionLevelDeletion
protected AbstractSSTableIterator.Reader
reader
protected Slices
slices
protected SSTableReader
sstable
protected Row
staticRow
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSSTableIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, RIE indexEntry, Slices slices, ColumnFilter columnFilter, FileHandle ifile)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
RegularAndStaticColumns
columns()
A subset of the columns for the (static and regular) rows returned by this iterator.protected abstract AbstractSSTableIterator.Reader
createReaderInternal(RIE indexEntry, FileDataInput file, boolean shouldCloseFile, Version version)
protected abstract boolean
hasMoreSlices()
Checks if there are more slice to process.boolean
hasNext()
TableMetadata
metadata()
The metadata for the table this iterator on.Unfiltered
next()
protected abstract int
nextSliceIndex()
Returns the index of the next slice to process.DecoratedKey
partitionKey()
The partition key of the partition this in an iterator over.DeletionTime
partitionLevelDeletion()
The partition level deletion for the partition this iterate over.void
remove()
Row
staticRow()
The static part corresponding to this partition (this can be an empty row but cannot benull
).EncodingStats
stats()
Return "statistics" about what is returned by this iterator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.db.rows.BaseRowIterator
isReverseOrder
-
Methods inherited from interface org.apache.cassandra.db.rows.UnfilteredRowIterator
isEmpty
-
-
-
-
Field Detail
-
sstable
protected final SSTableReader sstable
-
metadata
protected final TableMetadata metadata
-
key
protected final DecoratedKey key
-
partitionLevelDeletion
protected final DeletionTime partitionLevelDeletion
-
columns
protected final ColumnFilter columns
-
helper
protected final DeserializationHelper helper
-
staticRow
protected final Row staticRow
-
reader
protected final AbstractSSTableIterator.Reader reader
-
ifile
protected final FileHandle ifile
-
slices
protected final Slices slices
-
-
Constructor Detail
-
AbstractSSTableIterator
protected AbstractSSTableIterator(SSTableReader sstable, FileDataInput file, DecoratedKey key, RIE indexEntry, Slices slices, ColumnFilter columnFilter, FileHandle ifile)
-
-
Method Detail
-
nextSliceIndex
protected abstract int nextSliceIndex()
Returns the index of the next slice to process.- Returns:
- the index of the next slice to process
-
hasMoreSlices
protected abstract boolean hasMoreSlices()
Checks if there are more slice to process.- Returns:
true
if there are more slice to process,false
otherwise.
-
createReaderInternal
protected abstract AbstractSSTableIterator.Reader createReaderInternal(RIE indexEntry, FileDataInput file, boolean shouldCloseFile, Version version)
-
metadata
public TableMetadata metadata()
Description copied from interface:BaseRowIterator
The metadata for the table this iterator on.- Specified by:
metadata
in interfaceBaseRowIterator<RIE extends AbstractRowIndexEntry>
-
columns
public RegularAndStaticColumns columns()
Description copied from interface:BaseRowIterator
A subset of the columns for the (static and regular) rows returned by this iterator. Every row returned by this iterator must guarantee that it has only those columns.- Specified by:
columns
in interfaceBaseRowIterator<RIE extends AbstractRowIndexEntry>
-
partitionKey
public DecoratedKey partitionKey()
Description copied from interface:BaseRowIterator
The partition key of the partition this in an iterator over.- Specified by:
partitionKey
in interfaceBaseRowIterator<RIE extends AbstractRowIndexEntry>
-
partitionLevelDeletion
public DeletionTime partitionLevelDeletion()
Description copied from interface:UnfilteredRowIterator
The partition level deletion for the partition this iterate over.- Specified by:
partitionLevelDeletion
in interfaceUnfilteredRowIterator
-
staticRow
public Row staticRow()
Description copied from interface:BaseRowIterator
The static part corresponding to this partition (this can be an empty row but cannot benull
).- Specified by:
staticRow
in interfaceBaseRowIterator<RIE extends AbstractRowIndexEntry>
-
stats
public EncodingStats stats()
Description copied from interface:UnfilteredRowIterator
Return "statistics" about what is returned by this iterator. Those are used for performance reasons (for delta-encoding for instance) and code should not expect those to be exact.- Specified by:
stats
in interfaceUnfilteredRowIterator
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<RIE extends AbstractRowIndexEntry>
-
next
public Unfiltered next()
- Specified by:
next
in interfacejava.util.Iterator<RIE extends AbstractRowIndexEntry>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<RIE extends AbstractRowIndexEntry>
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceCloseableIterator<RIE extends AbstractRowIndexEntry>
-
-