adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1134098325
##########
src/java/org/apache/cassandra/db/DeletionTime.java:
##########
@@ -38,17 +42,41 @@ public class DeletionTime implements
Comparable<DeletionTime>, IMeasurableMemory
/**
* A special DeletionTime that signifies that there is no top-level (row)
tombstone.
*/
- public static final DeletionTime LIVE = new DeletionTime(Long.MIN_VALUE,
Integer.MAX_VALUE);
+ public static final DeletionTime LIVE = new DeletionTime(Long.MIN_VALUE,
Long.MAX_VALUE);
public static final Serializer serializer = new Serializer();
+ public static final Serializer legacySerializer = new LegacySerializer();
private final long markedForDeleteAt;
- private final int localDeletionTime;
+ protected final int localDeletionTimeUnsignedInteger;
+
+ public static DeletionTime build(long markedForDeleteAt, long
localDeletionTime)
+ {
+ // Negative ldts can only be a result of a corruption or when
scrubbing legacy sstables with overflown int ldts
+ return localDeletionTime < 0 || localDeletionTime >
Cell.MAX_DELETION_TIME
+ ? new InvalidDeletionTime(markedForDeleteAt, (int)
localDeletionTime)
+ : new DeletionTime(markedForDeleteAt, localDeletionTime);
+ }
+
+ // Do not use. This is a perf optimization where some data structures
known to hold valid uints are allowed to use it.
+ // You should use 'build' instead to not workaround validations,
corruption detections, etc
+ public static DeletionTime buildUnsafeWithUnsignedInteger(long
markedForDeleteAt, int localDeletionTimeUnsignedInteger)
Review Comment:
Nit: can have package visibility, so it's easier to prevent its usage by
classes other that `RangeTombstoneList`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]