Class CellWithSource<T>

java.lang.Object
org.apache.cassandra.db.rows.ColumnData
org.apache.cassandra.db.rows.Cell<T>
org.apache.cassandra.index.sai.utils.CellWithSource<T>
Type Parameters:
T - the type of the cell's value
All Implemented Interfaces:
IMeasurableMemory

public class CellWithSource<T> extends Cell<T>
A wrapped Cell that includes a reference to the cell's source table via CellSourceIdentifier
  • Constructor Details

  • Method Details

    • sourceTable

      public CellSourceIdentifier sourceTable()
    • isCounterCell

      public boolean isCounterCell()
      Description copied from class: Cell
      Whether the cell is a counter cell or not.CassandraUInt
      Specified by:
      isCounterCell in class Cell<T>
      Returns:
      whether the cell is a counter cell or not.
    • value

      public T value()
      Specified by:
      value in class Cell<T>
    • accessor

      public ValueAccessor<T> accessor()
      Specified by:
      accessor in class Cell<T>
    • timestamp

      public long timestamp()
      Description copied from class: Cell
      The cell timestamp.

      Specified by:
      timestamp in class Cell<T>
      Returns:
      the cell timestamp.
    • ttl

      public int ttl()
      Description copied from class: Cell
      The cell ttl.
      Specified by:
      ttl in class Cell<T>
      Returns:
      the cell ttl, or NO_TTL if the cell isn't an expiring one.
    • localDeletionTime

      public long localDeletionTime()
      Description copied from class: Cell
      The cell local deletion time.
      Overrides:
      localDeletionTime in class Cell<T>
      Returns:
      the cell local deletion time, or NO_DELETION_TIME if the cell is neither a tombstone nor an expiring one.
    • isTombstone

      public boolean isTombstone()
      Description copied from class: Cell
      Whether the cell is a tombstone or not.
      Specified by:
      isTombstone in class Cell<T>
      Returns:
      whether the cell is a tombstone or not.
    • isExpiring

      public boolean isExpiring()
      Description copied from class: Cell
      Whether the cell is an expiring one or not.

      Note that this only correspond to whether the cell liveness info have a TTL or not, but doesn't tells whether the cell is already expired or not. You should use Cell.isLive(long) for that latter information.

      Specified by:
      isExpiring in class Cell<T>
      Returns:
      whether the cell is an expiring one or not.
    • isLive

      public boolean isLive(long nowInSec)
      Description copied from class: Cell
      Whether the cell is live or not given the current time.
      Specified by:
      isLive in class Cell<T>
      Parameters:
      nowInSec - the current time in seconds. This is used to decide if an expiring cell is expired or live.
      Returns:
      whether the cell is live or not at nowInSec.
    • path

      public CellPath path()
      Description copied from class: Cell
      For cells belonging to complex types (non-frozen collection and UDT), the path to the cell.
      Specified by:
      path in class Cell<T>
      Returns:
      the cell path for cells of complex column, and null for other cells.
    • withUpdatedColumn

      public Cell<?> withUpdatedColumn(ColumnMetadata newColumn)
      Specified by:
      withUpdatedColumn in class Cell<T>
    • withUpdatedValue

      public Cell<?> withUpdatedValue(ByteBuffer newValue)
      Specified by:
      withUpdatedValue in class Cell<T>
    • withUpdatedTimestampAndLocalDeletionTime

      public Cell<?> withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, long newLocalDeletionTime)
      Specified by:
      withUpdatedTimestampAndLocalDeletionTime in class Cell<T>
    • withSkippedValue

      public Cell<?> withSkippedValue()
      Description copied from class: Cell
      Used to apply the same optimization as in Cell.Serializer.deserialize(org.apache.cassandra.io.util.DataInputPlus, org.apache.cassandra.db.LivenessInfo, org.apache.cassandra.schema.ColumnMetadata, org.apache.cassandra.db.SerializationHeader, org.apache.cassandra.db.rows.DeserializationHelper, org.apache.cassandra.db.marshal.ValueAccessor<V>) when the column is not queried but eventhough it's used for digest calculation.
      Specified by:
      withSkippedValue in class Cell<T>
      Returns:
      a cell with an empty buffer as value
    • clone

      public Cell<?> clone(ByteBufferCloner cloner)
      Specified by:
      clone in class Cell<T>
    • dataSize

      public int dataSize()
      Description copied from class: ColumnData
      The size of the data hold by this ColumnData.
      Specified by:
      dataSize in class ColumnData
      Returns:
      the size used by the data of this ColumnData.
    • unsharedHeapSizeExcludingData

      public long unsharedHeapSizeExcludingData()
      Specified by:
      unsharedHeapSizeExcludingData in class ColumnData
    • unsharedHeapSize

      public long unsharedHeapSize()
      Specified by:
      unsharedHeapSize in interface IMeasurableMemory
      Specified by:
      unsharedHeapSize in class ColumnData
      Returns:
      the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.
    • validate

      public void validate()
      Description copied from class: ColumnData
      Validate the column data.
      Specified by:
      validate in class ColumnData
    • hasInvalidDeletions

      public boolean hasInvalidDeletions()
      Description copied from class: ColumnData
      Validates the deletions (ttl and local deletion time) if any.
      Specified by:
      hasInvalidDeletions in class ColumnData
      Returns:
      true if it has any invalid deletions, false otherwise
    • digest

      public void digest(Digest digest)
      Description copied from class: ColumnData
      Adds the data to the provided digest.
      Specified by:
      digest in class ColumnData
      Parameters:
      digest - the Digest to add the data to.
    • updateAllTimestamp

      public ColumnData updateAllTimestamp(long newTimestamp)
      Description copied from class: ColumnData
      Returns a copy of the data where all timestamps for live data have replaced by newTimestamp and all deletion timestamp by newTimestamp - 1. This exists for the Paxos path, see PartitionUpdate#updateAllTimestamp for additional details.
      Specified by:
      updateAllTimestamp in class ColumnData
    • markCounterLocalToBeCleared

      public Cell<?> markCounterLocalToBeCleared()
      Specified by:
      markCounterLocalToBeCleared in class Cell<T>
    • purge

      public Cell<?> purge(DeletionPurger purger, long nowInSec)
      Specified by:
      purge in class Cell<T>
    • purgeDataOlderThan

      public Cell<?> purgeDataOlderThan(long timestamp)
      Specified by:
      purgeDataOlderThan in class Cell<T>
    • localDeletionTimeAsUnsignedInt

      protected int localDeletionTimeAsUnsignedInt()
      Specified by:
      localDeletionTimeAsUnsignedInt in class Cell<T>
    • maxTimestamp

      public long maxTimestamp()
      Specified by:
      maxTimestamp in class ColumnData