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 Detail

    • Method Detail

      • 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.
      • 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
      • equals

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

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object