belliottsmith commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1106784459
##########
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:
What is it you think you’re gaining with this boxing? I have looked, and I
cannot see any additional protection, and we have to rely on escape analysis to
avoid significant performance penalty.
This kind of bit twiddling is all over the codebase and we can manage it
very successfully. It *shouldn’t* be seen as exotic or dangerous.
--
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]