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


##########
src/java/org/apache/cassandra/db/rows/ArrayCell.java:
##########
@@ -83,23 +86,23 @@ public CellPath path()
 
     public Cell<?> withUpdatedColumn(ColumnMetadata newColumn)
     {
-        return new ArrayCell(newColumn, timestamp, ttl, localDeletionTime, 
value, path);
+        return new ArrayCell(newColumn, timestamp, ttl, 
deletionTimeGuavaUintToLong(localDeletionTimeGuavaUint), value, path);
     }
 
     public Cell<?> withUpdatedValue(ByteBuffer newValue)
     {
-        return new ArrayCell(column, timestamp, ttl, localDeletionTime, 
ByteBufferUtil.getArray(newValue), path);
+        return new ArrayCell(column, timestamp, ttl, 
deletionTimeGuavaUintToLong(localDeletionTimeGuavaUint), 
ByteBufferUtil.getArray(newValue), path);
     }
 
-    public Cell<?> withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, 
int newLocalDeletionTime)
+    public Cell<?> withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, 
long newLocalDeletionTime)
     {
         return new ArrayCell(column, newTimestamp, ttl, newLocalDeletionTime, 
value, path);
     }
 
     @Override
     public Cell<?> withSkippedValue()
     {
-        return new ArrayCell(column, timestamp, ttl, localDeletionTime, 
EMPTY_BYTE_ARRAY, path);
+        return new ArrayCell(column, timestamp, ttl, 
deletionTimeGuavaUintToLong(localDeletionTimeGuavaUint), EMPTY_BYTE_ARRAY, 
path);

Review Comment:
   Actually, the three with* methods that call `localDeletionTime` could 
benefit from a private constructor that takes the unsigned int, so we don't 
need to transform the deletion time twice:
   ```java
   public ArrayCell(ColumnMetadata column, long timestamp, int ttl, long 
localDeletionTime, byte[] value, CellPath path)
   {
       this(column, timestamp, ttl, 
deletionTimeLongToGuavaUint(localDeletionTime), value, path);
   }
   
   private ArrayCell(ColumnMetadata column, long timestamp, int ttl, int 
localDeletionTimeGuavaUint, byte[] value, CellPath path)
   {
       super(column);
       this.timestamp = timestamp;
       this.ttl = ttl;
       this.localDeletionTimeGuavaUint = localDeletionTimeGuavaUint;
       this.value = value;
       this.path = path;
   }
   
   public Cell<?> withUpdatedColumn(ColumnMetadata newColumn)
   {
       return new ArrayCell(newColumn, timestamp, ttl, 
localDeletionTimeGuavaUint, value, 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