public static BTreeRow emptyDeletedRow(Clustering clustering, Deletion deletion) { assert !deletion.isLive(); return new BTreeRow(clustering, LivenessInfo.EMPTY, deletion, BTree.empty(), Integer.MIN_VALUE); }
public Row readStaticRow() throws IOException { Row row = super.readStaticRow(); if (!row.deletion().isLive()) return BTreeRow.emptyDeletedRow(row.clustering(), row.deletion()); return Rows.EMPTY_STATIC_ROW; }
public static BTreeRow emptyDeletedRow(Clustering clustering, Deletion deletion) { assert !deletion.isLive(); return new BTreeRow(clustering, LivenessInfo.EMPTY, deletion, BTree.empty(), Integer.MIN_VALUE); }
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 withRowDeletion(DeletionTime newDeletion) { // Note that: // - it is a contract with the caller that the new deletion shouldn't shadow anything in // the row, and so in particular it can't shadow the row deletion. So if there is a // already a row deletion we have nothing to do. // - we set the minLocalDeletionTime to MIN_VALUE because we know the deletion is live return newDeletion.isLive() || !deletion.isLive() ? this : new BTreeRow(clustering, primaryKeyLivenessInfo, Deletion.regular(newDeletion), btree, Integer.MIN_VALUE); }
public boolean isEmpty() { return primaryKeyLivenessInfo().isEmpty() && deletion().isLive() && BTree.isEmpty(btree); }
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 boolean isEmpty() { return primaryKeyLivenessInfo().isEmpty() && deletion().isLive() && BTree.isEmpty(btree); }
public Row readStaticRow() throws IOException { if (header.hasStatic()) { Row staticRow = UnfilteredSerializer.serializer.deserializeStaticRow(in, header, helper); if (!staticRow.deletion().isLive()) return BTreeRow.emptyDeletedRow(staticRow.clustering(), staticRow.deletion()); } return Rows.EMPTY_STATIC_ROW; }
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 readStaticRow() throws IOException { if (header.hasStatic()) { Row staticRow = UnfilteredSerializer.serializer.deserializeStaticRow(in, header, helper); if (!staticRow.deletion().isLive()) return BTreeRow.emptyDeletedRow(staticRow.clustering(), staticRow.deletion()); } return Rows.EMPTY_STATIC_ROW; }
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 static BTreeRow emptyDeletedRow(Clustering clustering, Deletion deletion) { assert !deletion.isLive(); return new BTreeRow(clustering, LivenessInfo.EMPTY, deletion, BTree.empty(), Integer.MIN_VALUE); }
public boolean isEmpty() { return primaryKeyLivenessInfo().isEmpty() && deletion().isLive() && BTree.isEmpty(btree); }
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)); }
public Row readStaticRow() throws IOException { if (header.hasStatic()) { Row staticRow = UnfilteredSerializer.serializer.deserializeStaticRow(in, header, helper); if (!staticRow.deletion().isLive()) return BTreeRow.emptyDeletedRow(staticRow.clustering(), staticRow.deletion()); } return Rows.EMPTY_STATIC_ROW; }
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)); }
public Row withRowDeletion(DeletionTime newDeletion) { // Note that: // - it is a contract with the caller that the new deletion shouldn't shadow anything in // the row, and so in particular it can't shadow the row deletion. So if there is a // already a row deletion we have nothing to do. // - we set the minLocalDeletionTime to MIN_VALUE because we know the deletion is live return newDeletion.isLive() || !deletion.isLive() ? this : new BTreeRow(clustering, primaryKeyLivenessInfo, Deletion.regular(newDeletion), btree, Integer.MIN_VALUE); }
public Row readStaticRow() throws IOException { Row row = super.readStaticRow(); if (!row.deletion().isLive()) return BTreeRow.emptyDeletedRow(row.clustering(), row.deletion()); return Rows.EMPTY_STATIC_ROW; }