public static BufferCell live(ColumnDefinition column, long timestamp, ByteBuffer value, CellPath path) { return new BufferCell(column, timestamp, NO_TTL, NO_DELETION_TIME, value, path); }
private Cell cell(ColumnDefinition column, ByteBuffer value, CellPath path) { if (value == null) return BufferCell.tombstone(column, timestamp, nowInSec, path); return ttl == LivenessInfo.NO_TTL ? BufferCell.live(column, timestamp, value, path) : BufferCell.expiring(column, timestamp, ttl, nowInSec, value, path); }
public static BufferCell tombstone(ColumnDefinition column, long timestamp, int nowInSec) { return tombstone(column, timestamp, nowInSec, null); }
public static BufferCell live(ColumnDefinition column, long timestamp, ByteBuffer value) { return live(column, timestamp, value, null); }
public Cell purge(DeletionPurger purger, int nowInSec) { if (!isLive(nowInSec)) { if (purger.shouldPurge(timestamp(), localDeletionTime())) return null; // We slightly hijack purging to convert expired but not purgeable columns to tombstones. The reason we do that is // that once a column has expired it is equivalent to a tombstone but actually using a tombstone is more compact since // we don't keep the column value. The reason we do it here is that 1) it's somewhat related to dealing with tombstones // so hopefully not too surprising and 2) we want to this and purging at the same places, so it's simpler/more efficient // to do both here. if (isExpiring()) { // Note that as long as the expiring column and the tombstone put together live longer than GC grace seconds, // we'll fulfil our responsibility to repair. See discussion at // http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/repair-compaction-and-tombstone-rows-td7583481.html return BufferCell.tombstone(column, timestamp(), localDeletionTime() - ttl(), path()).purge(purger, nowInSec); } } return this; }
public static BufferCell expiring(ColumnDefinition column, long timestamp, int ttl, int nowInSec, ByteBuffer value) { return expiring(column, timestamp, ttl, nowInSec, value, null); }
public static BufferCell tombstone(ColumnDefinition column, long timestamp, int nowInSec) { return tombstone(column, timestamp, nowInSec, null); }
public static BufferCell live(ColumnDefinition column, long timestamp, ByteBuffer value) { return live(column, timestamp, value, null); }
public Cell purge(DeletionPurger purger, int nowInSec) { if (!isLive(nowInSec)) { if (purger.shouldPurge(timestamp(), localDeletionTime())) return null; // We slightly hijack purging to convert expired but not purgeable columns to tombstones. The reason we do that is // that once a column has expired it is equivalent to a tombstone but actually using a tombstone is more compact since // we don't keep the column value. The reason we do it here is that 1) it's somewhat related to dealing with tombstones // so hopefully not too surprising and 2) we want to this and purging at the same places, so it's simpler/more efficient // to do both here. if (isExpiring()) { // Note that as long as the expiring column and the tombstone put together live longer than GC grace seconds, // we'll fulfil our responsibility to repair. See discussion at // http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/repair-compaction-and-tombstone-rows-td7583481.html return BufferCell.tombstone(column, timestamp(), localDeletionTime() - ttl(), path()).purge(purger, nowInSec); } } return this; }
public static BufferCell expiring(ColumnDefinition column, long timestamp, int ttl, int nowInSec, ByteBuffer value) { return expiring(column, timestamp, ttl, nowInSec, value, null); }
public Cell withUpdatedTimestampAndLocalDeletionTime(long newTimestamp, int newLocalDeletionTime) { return new BufferCell(column, newTimestamp, ttl, newLocalDeletionTime, value, path); }
private Cell cell(ColumnDefinition column, ByteBuffer value, CellPath path) { if (value == null) return BufferCell.tombstone(column, timestamp, nowInSec, path); return ttl == LivenessInfo.NO_TTL ? BufferCell.live(column, timestamp, value, path) : BufferCell.expiring(column, timestamp, ttl, nowInSec, value, path); }
public static BufferCell tombstone(ColumnDefinition column, long timestamp, int nowInSec) { return tombstone(column, timestamp, nowInSec, null); }
public static BufferCell live(ColumnDefinition column, long timestamp, ByteBuffer value) { return live(column, timestamp, value, null); }
public Cell purge(DeletionPurger purger, int nowInSec) { if (!isLive(nowInSec)) { if (purger.shouldPurge(timestamp(), localDeletionTime())) return null; // We slightly hijack purging to convert expired but not purgeable columns to tombstones. The reason we do that is // that once a column has expired it is equivalent to a tombstone but actually using a tombstone is more compact since // we don't keep the column value. The reason we do it here is that 1) it's somewhat related to dealing with tombstones // so hopefully not too surprising and 2) we want to this and purging at the same places, so it's simpler/more efficient // to do both here. if (isExpiring()) { // Note that as long as the expiring column and the tombstone put together live longer than GC grace seconds, // we'll fulfil our responsibility to repair. See discussion at // http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/repair-compaction-and-tombstone-rows-td7583481.html return BufferCell.tombstone(column, timestamp(), localDeletionTime() - ttl(), path()).purge(purger, nowInSec); } } return this; }
public static BufferCell expiring(ColumnDefinition column, long timestamp, int ttl, int nowInSec, ByteBuffer value) { return expiring(column, timestamp, ttl, nowInSec, value, null); }
public static BufferCell live(ColumnDefinition column, long timestamp, ByteBuffer value, CellPath path) { return new BufferCell(column, timestamp, NO_TTL, NO_DELETION_TIME, value, path); }