adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1106128052


##########
src/java/org/apache/cassandra/db/rows/Cell.java:
##########
@@ -108,7 +127,7 @@ public ByteBuffer buffer()
      * @return the cell local deletion time, or {@code NO_DELETION_TIME} if 
the cell is neither
      * a tombstone nor an expiring one.
      */
-    public abstract int localDeletionTime();
+    public abstract long localDeletionTime();

Review Comment:
   Every implementation of this method contains a call to 
`Cell.deletionTimeGuavaUintToLong`. Instead, we could have an additional 
`protected` method that returns the unsigned int, and put the call to 
`Cell.deletionTimeGuavaUintToLong` here:
   ```java
   public long localDeletionTime()
   {
       return deletionTimeGuavaUintToLong(localDeletionTimeAsUnsignedInt());
   }
   
   protected abstract int localDeletionTimeAsUnsignedInt();
   ```
   This simplifies a bit the implementations and might skip a conversion on the 
first constructor of `NativeCell`:
   ```java
   public NativeCell(NativeAllocator allocator,
                     OpOrder.Group writeOp,
                     Cell<?> cell)
   {
       this(allocator,
            writeOp,
            cell.column(),
            cell.timestamp(),
            cell.ttl(),
            cell.localDeletionTimeAsUnsignedInt(),
            cell.buffer(),
            cell.path());
   }
   
   public NativeCell(NativeAllocator allocator,
                     OpOrder.Group writeOp,
                     ColumnMetadata column,
                     long timestamp,
                     int ttl,
                     long localDeletionTime,
                     ByteBuffer value,
                     CellPath path)
   {
       this(allocator, writeOp, column, timestamp, ttl, 
deletionTimeLongToGuavaUint(lo
   }
   
   private NativeCell(NativeAllocator allocator,
                      OpOrder.Group writeOp,
                      ColumnMetadata column,
                      long timestamp,
                      int ttl,
                      int localDeletionTimeUint,
                      ByteBuffer value,
                      CellPath path)
   {
   ...
   }
   ```



-- 
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]

Reply via email to