org.apache.cassandra.db.partitions

## Interface CachedPartition

- All Superinterfaces:
    IRowCacheEntry, Partition
  All Known Implementing Classes:
    CachedBTreePartition

      public interface CachedPartition
      extends Partition, IRowCacheEntry

  A partition stored in the partition cache. Note that in practice, the only implementation of this is `CachedBTreePartition`, we keep this interface mainly to make it clear what we need from partition in the cache (that we don't otherwise)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ISerializer<CachedPartition>` | `cacheSerializer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `cachedLiveRows()` The number of rows that were live at the time the partition was cached.
    `Row` | `lastRow()` The last row in this cached partition (in order words, the row with the biggest clustering that the partition contains).
    `int` | `nonExpiringLiveCells()` The number of cells in this cached partition that are neither tombstone nor expiring.
    `int` | `nonTombstoneCellCount()` The number of `cell` objects that are not tombstone in this cached partition.
    `int` | `rowCount()` The number of `Row` objects in this cached partition.
    `int` | `rowsWithNonExpiringCells()` The number of rows in this cached partition that have at least one non-expiring non-deleted cell.

    - ### Methods inherited from interface org.apache.cassandra.db.partitions.Partition

      `columns, getRow, isEmpty, metadata, partitionKey, partitionLevelDeletion, searchIterator, stats, unfilteredIterator, unfilteredIterator`

- - ### Field Detail

    - #### cacheSerializer

          static final ISerializer<CachedPartition> cacheSerializer

  - ### Method Detail

    - #### rowCount

          int rowCount()

      The number of `Row` objects in this cached partition. Please note that this is not the number of live rows since some of the row may only contains deleted (or expired) information.
      Returns:
        the number of row in the partition.

    - #### cachedLiveRows

          int cachedLiveRows()

      The number of rows that were live at the time the partition was cached. See `ColumnFamilyStore.isFilterFullyCoveredBy(org.apache.cassandra.db.filter.ClusteringIndexFilter, org.apache.cassandra.db.filter.DataLimits, org.apache.cassandra.db.partitions.CachedPartition, int)` to see why we need this.
      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

          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 by `DataLimits.hasEnoughLiveData(org.apache.cassandra.db.partitions.CachedPartition, int, boolean, boolean)` as an optimization.
      Returns:
        the number of row that have at least one non-expiring non-deleted cell.

    - #### lastRow

          Row lastRow()

      The last row in this cached partition (in order words, the row with the biggest clustering that the partition contains).
      Returns:
        the last row of the partition, or `null` if the partition is empty.

    - #### nonTombstoneCellCount

          int nonTombstoneCellCount()

      The number of `cell` objects that are not tombstone in this cached partition. Please note that this is not the number of live cells since some of the cells might be expired.
      Returns:
        the number of non tombstone cells in the partition.

    - #### nonExpiringLiveCells

          int nonExpiringLiveCells()

      The number of cells in this cached partition that are neither tombstone nor expiring. Note that this is generally not a very meaningful number, but this is used by `DataLimits.hasEnoughLiveData(org.apache.cassandra.db.partitions.CachedPartition, int, boolean, boolean)` as an optimization.
      Returns:
        the number of cells that are neither tombstones nor expiring.

Copyright © 2018 The Apache Software Foundation