public static BTreeRow create(Clustering clustering, LivenessInfo primaryKeyLivenessInfo, Deletion deletion, Object[] btree) { int minDeletionTime = Math.min(minDeletionTime(primaryKeyLivenessInfo), minDeletionTime(deletion.time())); if (minDeletionTime != Integer.MIN_VALUE) { for (ColumnData cd : BTree.<ColumnData>iterable(btree)) minDeletionTime = Math.min(minDeletionTime, minDeletionTime(cd)); } return create(clustering, primaryKeyLivenessInfo, deletion, btree, minDeletionTime); }
public static BTreeRow create(Clustering clustering, LivenessInfo primaryKeyLivenessInfo, Deletion deletion, Object[] btree) { int minDeletionTime = Math.min(minDeletionTime(primaryKeyLivenessInfo), minDeletionTime(deletion.time())); if (minDeletionTime != Integer.MIN_VALUE) { for (ColumnData cd : BTree.<ColumnData>iterable(btree)) minDeletionTime = Math.min(minDeletionTime, minDeletionTime(cd)); } return create(clustering, primaryKeyLivenessInfo, deletion, btree, minDeletionTime); }
protected Row garbageFilterRow(Row dataRow, Row tombRow) { if (cellLevelGC) { return Rows.removeShadowedCells(dataRow, tombRow, activeDeletionTime, nowInSec); } else { DeletionTime deletion = Ordering.natural().max(tombRow.deletion().time(), activeDeletionTime); return dataRow.filter(cf, deletion, false, metadata); } }
private void indexPrimaryKey(final Clustering clustering, final LivenessInfo liveness, final Row.Deletion deletion) { if (liveness.timestamp() != LivenessInfo.NO_TIMESTAMP) insert(key.getKey(), clustering, null, liveness, opGroup); if (!deletion.isLive()) delete(key.getKey(), clustering, deletion.time(), opGroup); }
private Row transformAndFilter(LivenessInfo info, Deletion deletion, Function<ColumnData, ColumnData> function) { Object[] transformed = BTree.transformAndFilter(btree, function); if (btree == transformed && info == this.primaryKeyLivenessInfo && deletion == this.deletion) return this; if (info.isEmpty() && deletion.isLive() && BTree.isEmpty(transformed)) return null; int minDeletionTime = minDeletionTime(transformed, info, deletion.time()); return BTreeRow.create(clustering, info, deletion, transformed, minDeletionTime); }
protected Row garbageFilterRow(Row dataRow, Row tombRow) { if (cellLevelGC) { return Rows.removeShadowedCells(dataRow, tombRow, activeDeletionTime, nowInSec); } else { DeletionTime deletion = Ordering.natural().max(tombRow.deletion().time(), activeDeletionTime); return dataRow.filter(cf, deletion, false, metadata); } }
protected Row garbageFilterRow(Row dataRow, Row tombRow) { if (cellLevelGC) { return Rows.removeShadowedCells(dataRow, tombRow, activeDeletionTime, nowInSec); } else { DeletionTime deletion = Ordering.natural().max(tombRow.deletion().time(), activeDeletionTime); return dataRow.filter(cf, deletion, false, metadata); } }
/** * Wether the deletion is live or not, that is if its an actual deletion or not. * * @return {@code true} if this represents no deletion of the row, {@code false} if that's an actual * deletion. */ public boolean isLive() { return time().isLive(); }
private Row transformAndFilter(LivenessInfo info, Deletion deletion, Function<ColumnData, ColumnData> function) { Object[] transformed = BTree.transformAndFilter(btree, function); if (btree == transformed && info == this.primaryKeyLivenessInfo && deletion == this.deletion) return this; if (info.isEmpty() && deletion.isLive() && BTree.isEmpty(transformed)) return null; int minDeletionTime = minDeletionTime(transformed, info, deletion.time()); return BTreeRow.create(clustering, info, deletion, transformed, minDeletionTime); }
/** * Wether the deletion is live or not, that is if its an actual deletion or not. * * @return {@code true} if this represents no deletion of the row, {@code false} if that's an actual * deletion. */ public boolean isLive() { return time().isLive(); }
public Row purge(DeletionPurger purger, int nowInSec, boolean enforceStrictLiveness) { if (!hasDeletion(nowInSec)) return this; LivenessInfo newInfo = purger.shouldPurge(primaryKeyLivenessInfo, nowInSec) ? LivenessInfo.EMPTY : primaryKeyLivenessInfo; Deletion newDeletion = purger.shouldPurge(deletion.time()) ? Deletion.LIVE : deletion; // when enforceStrictLiveness is set, a row is considered dead when it's PK liveness info is not present if (enforceStrictLiveness && newDeletion.isLive() && newInfo.isEmpty()) return null; return transformAndFilter(newInfo, newDeletion, (cd) -> cd.purge(purger, nowInSec)); }
/** * Wether the deletion is live or not, that is if its an actual deletion or not. * * @return {@code true} if this represents no deletion of the row, {@code false} if that's an actual * deletion. */ public boolean isLive() { return time().isLive(); }
public Row purge(DeletionPurger purger, int nowInSec) { if (!hasDeletion(nowInSec)) return this; LivenessInfo newInfo = purger.shouldPurge(primaryKeyLivenessInfo, nowInSec) ? LivenessInfo.EMPTY : primaryKeyLivenessInfo; Deletion newDeletion = purger.shouldPurge(deletion.time()) ? Deletion.LIVE : deletion; return transformAndFilter(newInfo, newDeletion, (cd) -> cd.purge(purger, nowInSec)); }
/** * Wether the deletion is live or not, that is if its an actual deletion or not. * * @return {@code true} if this represents no deletion of the row, {@code false} if that's an actual * deletion. */ public boolean isLive() { return time().isLive(); }
private Row transformAndFilter(LivenessInfo info, Deletion deletion, Function<ColumnData, ColumnData> function) { Object[] transformed = BTree.transformAndFilter(btree, function); if (btree == transformed && info == this.primaryKeyLivenessInfo && deletion == this.deletion) return this; if (info.isEmpty() && deletion.isLive() && BTree.isEmpty(transformed)) return null; int minDeletionTime = minDeletionTime(transformed, info, deletion.time()); return BTreeRow.create(clustering, info, deletion, transformed, minDeletionTime); }
private void indexPrimaryKey(final Clustering clustering, final LivenessInfo liveness, final Row.Deletion deletion) { if (liveness.timestamp() != LivenessInfo.NO_TIMESTAMP) insert(key.getKey(), clustering, null, liveness, opGroup); if (!deletion.isLive()) delete(key.getKey(), clustering, deletion.time(), opGroup); }
private Row transformAndFilter(LivenessInfo info, Deletion deletion, Function<ColumnData, ColumnData> function) { Object[] transformed = BTree.transformAndFilter(btree, function); if (btree == transformed && info == this.primaryKeyLivenessInfo && deletion == this.deletion) return this; if (info.isEmpty() && deletion.isLive() && BTree.isEmpty(transformed)) return null; int minDeletionTime = minDeletionTime(transformed, info, deletion.time()); return BTreeRow.create(clustering, info, deletion, transformed, minDeletionTime); }
public Row purge(DeletionPurger purger, int nowInSec, boolean enforceStrictLiveness) { if (!hasDeletion(nowInSec)) return this; LivenessInfo newInfo = purger.shouldPurge(primaryKeyLivenessInfo, nowInSec) ? LivenessInfo.EMPTY : primaryKeyLivenessInfo; Deletion newDeletion = purger.shouldPurge(deletion.time()) ? Deletion.LIVE : deletion; // when enforceStrictLiveness is set, a row is considered dead when it's PK liveness info is not present if (enforceStrictLiveness && newDeletion.isLive() && newInfo.isEmpty()) return null; return transformAndFilter(newInfo, newDeletion, (cd) -> cd.purge(purger, nowInSec)); }
private void indexPrimaryKey(final Clustering clustering, final LivenessInfo liveness, final Row.Deletion deletion) { if (liveness.timestamp() != LivenessInfo.NO_TIMESTAMP) insert(key.getKey(), clustering, null, liveness, opGroup); if (!deletion.isLive()) delete(key.getKey(), clustering, deletion.time(), opGroup); }
public Row purge(DeletionPurger purger, int nowInSec, boolean enforceStrictLiveness) { if (!hasDeletion(nowInSec)) return this; LivenessInfo newInfo = purger.shouldPurge(primaryKeyLivenessInfo, nowInSec) ? LivenessInfo.EMPTY : primaryKeyLivenessInfo; Deletion newDeletion = purger.shouldPurge(deletion.time()) ? Deletion.LIVE : deletion; // when enforceStrictLiveness is set, a row is considered dead when it's PK liveness info is not present if (enforceStrictLiveness && newDeletion.isLive() && newInfo.isEmpty()) return null; return transformAndFilter(newInfo, newDeletion, (cd) -> cd.purge(purger, nowInSec)); }