adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1106148007
##########
src/java/org/apache/cassandra/db/rows/Cell.java:
##########
@@ -59,14 +68,24 @@
public interface Factory<V>
{
- Cell<V> create(ColumnMetadata column, long timestamp, int ttl, int
localDeletionTime, V value, CellPath path);
+ Cell<V> create(ColumnMetadata column, long timestamp, int ttl, long
localDeletionTime, V value, CellPath path);
}
protected Cell(ColumnMetadata column)
{
super(column);
}
+ public static int deletionTimeLongToGuavaUint(long deletionTime)
+ {
+ return deletionTime == NO_DELETION_TIME ?
UnsignedInteger.MAX_VALUE.intValue() :
UnsignedInteger.valueOf(deletionTime).intValue();
+ }
+
+ public static long deletionTimeGuavaUintToLong(int deletionTimeGuavaUint)
+ {
+ return deletionTimeGuavaUint == UnsignedInteger.MAX_VALUE.intValue() ?
NO_DELETION_TIME :
UnsignedInteger.fromIntBits(deletionTimeGuavaUint).longValue();
Review Comment:
Instead of `UnsignedInteger.fromIntBits(deletionTimeGuavaUint).longValue()`,
perhaps we could use `UnsignedInts.toLong(deletionTimeGuavaUint)` and skip the
instantiation of `UnsignedInteger`.
That method is marked as beta, which is always scary. However,
`UnsignedInteger#longValue` still calls to it, so we are using the beta method
anyway.
--
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]