public static class PartitionUpdate.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(PartitionUpdate base,
int initialRowCapacity) |
Builder(TableMetadata metadata,
java.nio.ByteBuffer key,
RegularAndStaticColumns columns,
int initialRowCapacity) |
Builder(TableMetadata metadata,
DecoratedKey key,
RegularAndStaticColumns columnDefinitions,
int size) |
Builder(TableMetadata metadata,
DecoratedKey key,
RegularAndStaticColumns columns,
int initialRowCapacity,
boolean canHaveShadowedData) |
Modifier and Type | Method and Description |
---|---|
void |
add(RangeTombstone range) |
void |
add(Row row)
Adds a row to this update.
|
void |
addPartitionDeletion(DeletionTime deletionTime) |
PartitionUpdate |
build() |
RegularAndStaticColumns |
columns() |
TableMetadata |
metadata() |
DecoratedKey |
partitionKey() |
DeletionTime |
partitionLevelDeletion() |
java.lang.String |
toString() |
PartitionUpdate.Builder |
updateAllTimestamp(long newTimestamp)
Modify this update to set every timestamp for live data to
newTimestamp and
every deletion timestamp to newTimestamp - 1 . |
public Builder(TableMetadata metadata, DecoratedKey key, RegularAndStaticColumns columns, int initialRowCapacity, boolean canHaveShadowedData)
public Builder(TableMetadata metadata, DecoratedKey key, RegularAndStaticColumns columnDefinitions, int size)
public Builder(PartitionUpdate base, int initialRowCapacity)
public Builder(TableMetadata metadata, java.nio.ByteBuffer key, RegularAndStaticColumns columns, int initialRowCapacity)
public void add(Row row)
row
- the row to add.public void addPartitionDeletion(DeletionTime deletionTime)
public void add(RangeTombstone range)
public DecoratedKey partitionKey()
public TableMetadata metadata()
public PartitionUpdate build()
public RegularAndStaticColumns columns()
public DeletionTime partitionLevelDeletion()
public PartitionUpdate.Builder updateAllTimestamp(long newTimestamp)
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.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009- The Apache Software Foundation