Class CachedBTreePartition
- java.lang.Object
-
- org.apache.cassandra.db.partitions.AbstractBTreePartition
-
- org.apache.cassandra.db.partitions.ImmutableBTreePartition
-
- org.apache.cassandra.db.partitions.CachedBTreePartition
-
- All Implemented Interfaces:
java.lang.Iterable<Row>
,IRowCacheEntry
,CachedPartition
,Partition
public class CachedBTreePartition extends ImmutableBTreePartition implements CachedPartition
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
AbstractBTreePartition.Holder
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.db.partitions.ImmutableBTreePartition
holder, metadata
-
Fields inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
EMPTY, HOLDER_UNSHARED_HEAP_SIZE, partitionKey
-
Fields inherited from interface org.apache.cassandra.db.partitions.CachedPartition
cacheSerializer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
cachedLiveRows()
The number of rows that were live at the time the partition was cached.static CachedBTreePartition
create(UnfilteredRowIterator iterator, int nowInSec)
Creates anArrayBackedCachedPartition
holding all the data of the provided iterator.static CachedBTreePartition
create(UnfilteredRowIterator iterator, int initialRowCapacity, int nowInSec)
Creates anArrayBackedCachedPartition
holding all the data of the provided iterator.int
rowsWithNonExpiringCells()
The number of rows in this cached partition that have at least one non-expiring non-deleted cell.-
Methods inherited from class org.apache.cassandra.db.partitions.ImmutableBTreePartition
canHaveShadowedData, create, create, create, holder, metadata
-
Methods inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
build, build, build, columns, deletionInfo, getRow, hasRows, isEmpty, iterator, lastRow, partitionKey, partitionLevelDeletion, rowCount, staticRow, stats, toString, unfilteredIterator, unfilteredIterator, unfilteredIterator, unfilteredIterator, unsafeConstructHolder, unsafeGetEmptyHolder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.db.partitions.CachedPartition
lastRow, rowCount
-
Methods inherited from interface org.apache.cassandra.db.partitions.Partition
columns, getRow, isEmpty, metadata, partitionKey, partitionLevelDeletion, stats, unfilteredIterator, unfilteredIterator, unfilteredIterator
-
-
-
-
Method Detail
-
create
public static CachedBTreePartition create(UnfilteredRowIterator iterator, int nowInSec)
Creates anArrayBackedCachedPartition
holding all the data of the provided iterator. Warning: Note that this method does not close the provided iterator and it is up to the caller to do so.- Parameters:
iterator
- the iterator got gather in memory.nowInSec
- the time of the creation in seconds. This is the time at whichcachedLiveRows
applies.- Returns:
- the created partition.
-
create
public static CachedBTreePartition create(UnfilteredRowIterator iterator, int initialRowCapacity, int nowInSec)
Creates anArrayBackedCachedPartition
holding all the data of the provided iterator. Warning: Note that this method does not close the provided iterator and it is up to the caller to do so.- Parameters:
iterator
- the iterator got gather in memory.initialRowCapacity
- sizing hint (in rows) to use for the created partition. It should ideally correspond or be a good estimation of the number or rows initerator
.nowInSec
- the time of the creation in seconds. This is the time at whichcachedLiveRows
applies.- Returns:
- the created partition.
-
cachedLiveRows
public int cachedLiveRows()
The number of rows that were live at the time the partition was cached. SeeColumnFamilyStore.isFilterFullyCoveredBy(org.apache.cassandra.db.filter.ClusteringIndexFilter, org.apache.cassandra.db.filter.DataLimits, org.apache.cassandra.db.partitions.CachedPartition, int, boolean)
to see why we need this.- Specified by:
cachedLiveRows
in interfaceCachedPartition
- Returns:
- the number of rows in this partition that were live at the time the partition was cached (this can be different from the number of live rows now due to expiring cells).
-
rowsWithNonExpiringCells
public int rowsWithNonExpiringCells()
The number of rows in this cached partition that have at least one non-expiring non-deleted cell. Note that this is generally not a very meaningful number, but this is used byDataLimits.hasEnoughLiveData(org.apache.cassandra.db.partitions.CachedPartition, int, boolean, boolean)
as an optimization.- Specified by:
rowsWithNonExpiringCells
in interfaceCachedPartition
- Returns:
- the number of row that have at least one non-expiring non-deleted cell.
-
-