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:
Iterable<Row>,IRowCacheEntry,CachedPartition,Partition
-
Field Summary
Fields inherited from class org.apache.cassandra.db.partitions.ImmutableBTreePartition
holder, metadataFields inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
partitionKeyFields inherited from interface org.apache.cassandra.db.partitions.CachedPartition
cacheSerializer -
Method Summary
Modifier and TypeMethodDescriptionintThe number of rows that were live at the time the partition was cached.static CachedBTreePartitioncreate(UnfilteredRowIterator iterator, int initialRowCapacity, long nowInSec) Creates anArrayBackedCachedPartitionholding all the data of the provided iterator.static CachedBTreePartitioncreate(UnfilteredRowIterator iterator, long nowInSec) Creates anArrayBackedCachedPartitionholding all the data of the provided iterator.intThe 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, create, holder, metadataMethods inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition
build, build, build, columns, deletionInfo, equals, getRow, hasRows, isEmpty, iterator, lastRow, partitionKey, partitionLevelDeletion, rowCount, staticRow, stats, toString, toString, unfilteredIterator, unfilteredIterator, unfilteredIterator, unfilteredIteratorMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.db.partitions.CachedPartition
lastRow, rowCountMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.cassandra.db.partitions.Partition
columns, getRow, hasRows, isEmpty, metadata, partitionKey, partitionLevelDeletion, stats, unfilteredIterator, unfilteredIterator, unfilteredIterator
-
Method Details
-
create
Creates anArrayBackedCachedPartitionholding 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 whichcachedLiveRowsapplies.- Returns:
- the created partition.
-
create
public static CachedBTreePartition create(UnfilteredRowIterator iterator, int initialRowCapacity, long nowInSec) Creates anArrayBackedCachedPartitionholding 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 whichcachedLiveRowsapplies.- 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, long, boolean)to see why we need this.- Specified by:
cachedLiveRowsin 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, long, boolean, boolean)as an optimization.- Specified by:
rowsWithNonExpiringCellsin interfaceCachedPartition- Returns:
- the number of row that have at least one non-expiring non-deleted cell.
-