Class AbstractCell<V>

All Implemented Interfaces:
IMeasurableMemory
Direct Known Subclasses:
ArrayCell, BufferCell, NativeCell

public abstract class AbstractCell<V> extends Cell<V>
Base abstract class for Cell implementations. Unless you have a very good reason not to, every cell implementation should probably extend this class.
  • Constructor Details

  • Method Details

    • 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<V>
      Returns:
      whether the cell is a counter cell 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<V>
      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.
    • isTombstone

      public boolean isTombstone()
      Description copied from class: Cell
      Whether the cell is a tombstone or not.
      Specified by:
      isTombstone in class Cell<V>
      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<V>
      Returns:
      whether the cell is an expiring one or not.
    • markCounterLocalToBeCleared

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

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

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

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

      public Cell<?> 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
    • 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.
    • 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.
    • 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
    • maxTimestamp

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

      public static <V1, V2> boolean equals(Cell<V1> left, Cell<V2> right)
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object