Class PartitionUpdate.Builder

java.lang.Object
org.apache.cassandra.db.partitions.PartitionUpdate.Builder
Enclosing class:
PartitionUpdate

public static class PartitionUpdate.Builder extends Object
Builder for PartitionUpdates This class is not thread safe, but the PartitionUpdate it produces is (since it is immutable).
  • Constructor Details

  • Method Details

    • add

      public void add(Row row)
      Adds a row to this update. There is no particular assumption made on the order of row added to a partition update. It is further allowed to add the same row (more precisely, multiple row objects for the same clustering). Note however that the columns contained in the added row must be a subset of the columns used when creating this update.
      Parameters:
      row - the row to add.
    • addPartitionDeletion

      public void addPartitionDeletion(DeletionTime deletionTime)
    • add

      public void add(RangeTombstone range)
    • partitionKey

      public DecoratedKey partitionKey()
    • metadata

      public TableMetadata metadata()
    • build

      public PartitionUpdate build()
    • columns

      public RegularAndStaticColumns columns()
    • partitionLevelDeletion

      public DeletionTime partitionLevelDeletion()
    • updateAllTimestamp

      public PartitionUpdate.Builder updateAllTimestamp(long newTimestamp)
      Modify this update to set every timestamp for live data to newTimestamp and every deletion timestamp to newTimestamp - 1. There is no reason to use that expect on the Paxos code path, where we need ensure that anything inserted use the ballot timestamp (to respect the order of update decided by the Paxos algorithm). We use newTimestamp - 1 for deletions because tombstones always win on timestamp equality and we don't want to delete our own insertions (typically, when we overwrite a collection, we first set a complex deletion to delete the previous collection before adding new elements. If we were to set that complex deletion to the same timestamp that the new elements, it would delete those elements). And since tombstones always wins on timestamp equality, using -1 guarantees our deletion will still delete anything from a previous update.
    • toString

      public String toString()
      Overrides:
      toString in class Object