File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed
src/java/org/apache/cassandra Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public boolean isCounterCell()
5555
5656 public boolean isLive (long nowInSec )
5757 {
58- return localDeletionTime () == NO_DELETION_TIME || ( ttl () != NO_TTL && nowInSec < localDeletionTime ());
58+ return isLive ( nowInSec , localDeletionTime (), ttl ());
5959 }
6060
6161 public boolean isTombstone ()
Original file line number Diff line number Diff line change @@ -177,6 +177,11 @@ public long localDeletionTime()
177177 */
178178 public abstract boolean isLive (long nowInSec );
179179
180+ public final boolean isLive (long nowInSec , long localDeletionTime , int ttl )
181+ {
182+ return localDeletionTime == NO_DELETION_TIME || ttl != NO_TTL && nowInSec < localDeletionTime ;
183+ }
184+
180185 /**
181186 * For cells belonging to complex types (non-frozen collection and UDT), the
182187 * path to the cell.
Original file line number Diff line number Diff line change 3737import org .apache .cassandra .db .commitlog .CommitLogPosition ;
3838import org .apache .cassandra .db .commitlog .IntervalSet ;
3939import org .apache .cassandra .db .partitions .PartitionStatisticsCollector ;
40+ import org .apache .cassandra .db .rows .ArrayCell ;
4041import org .apache .cassandra .db .rows .Cell ;
4142import org .apache .cassandra .db .rows .Unfiltered ;
4243import org .apache .cassandra .io .sstable .SSTable ;
@@ -229,10 +230,27 @@ public void update(LivenessInfo newInfo)
229230 public void update (Cell <?> cell )
230231 {
231232 ++currentPartitionCells ;
232- updateTimestamp (cell .timestamp ());
233- updateTTL (cell .ttl ());
234- updateLocalDeletionTime (cell .localDeletionTime ());
235- if (!cell .isLive (nowInSec ))
233+ long timestamp ;
234+ int ttl ;
235+ long localDeletionTime ;
236+ if (cell .getClass () == ArrayCell .class )
237+ {
238+ timestamp = cell .timestamp ();
239+ ttl = cell .ttl ();
240+ localDeletionTime = cell .localDeletionTime ();
241+ }
242+ else
243+ {
244+ timestamp = cell .timestamp ();
245+ ttl = cell .ttl ();
246+ localDeletionTime = cell .localDeletionTime ();
247+ }
248+ updateTimestamp (timestamp );
249+ updateTTL (ttl );
250+ updateLocalDeletionTime (localDeletionTime );
251+
252+ // isLive(nowInSec) is not used to avoid additional non-monomorphic calls of Cell methods
253+ if (!cell .isLive (nowInSec , localDeletionTime , ttl ))
236254 updateTombstoneCount ();
237255 }
238256
You can’t perform that action at this time.
0 commit comments