private void doDelete(DecoratedKey indexKey, Clustering indexClustering, DeletionTime deletion, OpOrder.Group opGroup) { Row row = BTreeRow.emptyDeletedRow(indexClustering, Row.Deletion.regular(deletion)); PartitionUpdate upd = partitionUpdate(indexKey, row); indexCfs.apply(upd, UpdateTransaction.NO_OP, opGroup, null); logger.trace("Removed index entry for value {}", indexKey); }
private void doDelete(DecoratedKey indexKey, Clustering indexClustering, DeletionTime deletion, OpOrder.Group opGroup) { Row row = BTreeRow.emptyDeletedRow(indexClustering, Row.Deletion.regular(deletion)); PartitionUpdate upd = partitionUpdate(indexKey, row); indexCfs.apply(upd, UpdateTransaction.NO_OP, opGroup, null); logger.trace("Removed index entry for value {}", indexKey); }
private void doDelete(DecoratedKey indexKey, Clustering indexClustering, DeletionTime deletion, OpOrder.Group opGroup) { Row row = BTreeRow.emptyDeletedRow(indexClustering, Row.Deletion.regular(deletion)); PartitionUpdate upd = partitionUpdate(indexKey, row); indexCfs.apply(upd, UpdateTransaction.NO_OP, opGroup, null); logger.trace("Removed index entry for value {}", indexKey); }
public Row next(Clustering clustering) { if (clustering == Clustering.STATIC_CLUSTERING) return staticRow(current, columns, true); Row row = rawIter.next(clustering); RangeTombstone rt = current.deletionInfo.rangeCovering(clustering); // A search iterator only return a row, so it doesn't allow to directly account for deletion that should apply to to row // (the partition deletion or the deletion of a range tombstone that covers it). So if needs be, reuse the row deletion // to carry the proper deletion on the row. DeletionTime activeDeletion = partitionDeletion; if (rt != null && rt.deletionTime().supersedes(activeDeletion)) activeDeletion = rt.deletionTime(); if (row == null) return activeDeletion.isLive() ? null : BTreeRow.emptyDeletedRow(clustering, Row.Deletion.regular(activeDeletion)); return row.filter(columns, activeDeletion, true, metadata); } };
public Row next(Clustering clustering) { if (clustering == Clustering.STATIC_CLUSTERING) return staticRow(current, columns, true); Row row = rawIter.next(clustering); RangeTombstone rt = current.deletionInfo.rangeCovering(clustering); // A search iterator only return a row, so it doesn't allow to directly account for deletion that should apply to to row // (the partition deletion or the deletion of a range tombstone that covers it). So if needs be, reuse the row deletion // to carry the proper deletion on the row. DeletionTime activeDeletion = partitionDeletion; if (rt != null && rt.deletionTime().supersedes(activeDeletion)) activeDeletion = rt.deletionTime(); if (row == null) return activeDeletion.isLive() ? null : BTreeRow.emptyDeletedRow(clustering, Row.Deletion.regular(activeDeletion)); return row.filter(columns, activeDeletion, true, metadata); } };
public Row next(Clustering clustering) { if (clustering == Clustering.STATIC_CLUSTERING) return staticRow(current, columns, true); Row row = rawIter.next(clustering); RangeTombstone rt = current.deletionInfo.rangeCovering(clustering); // A search iterator only return a row, so it doesn't allow to directly account for deletion that should apply to to row // (the partition deletion or the deletion of a range tombstone that covers it). So if needs be, reuse the row deletion // to carry the proper deletion on the row. DeletionTime activeDeletion = partitionDeletion; if (rt != null && rt.deletionTime().supersedes(activeDeletion)) activeDeletion = rt.deletionTime(); if (row == null) return activeDeletion.isLive() ? null : BTreeRow.emptyDeletedRow(clustering, Row.Deletion.regular(activeDeletion)); return row.filter(columns, activeDeletion, true, metadata); } };
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); }
private static Row emptyRow(Clustering clustering, DeletionTime deletion) { // Returning null for an empty row is slightly ugly, but the case where there is no pre-existing row is fairly common // (especially when building the view), so we want to avoid a dummy allocation of an empty row every time. // And MultiViewUpdateBuilder knows how to deal with that. return deletion.isLive() ? null : BTreeRow.emptyDeletedRow(clustering, Row.Deletion.regular(deletion)); }
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.SimpleBuilder delete() { assert !initiated : "If called, delete() should be called before any other column value addition"; builder.addRowDeletion(Row.Deletion.regular(new DeletionTime(timestamp, nowInSec))); return this; }
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); }
private static Row emptyRow(Clustering clustering, DeletionTime deletion) { // Returning null for an empty row is slightly ugly, but the case where there is no pre-existing row is fairly common // (especially when building the view), so we want to avoid a dummy allocation of an empty row every time. // And MultiViewUpdateBuilder knows how to deal with that. return deletion.isLive() ? null : BTreeRow.emptyDeletedRow(clustering, Row.Deletion.regular(deletion)); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }
public Row.SimpleBuilder delete() { assert !initiated : "If called, delete() should be called before any other column value addition"; builder.addRowDeletion(Row.Deletion.regular(new DeletionTime(timestamp, nowInSec))); return this; }
private static Row emptyRow(Clustering clustering, DeletionTime deletion) { // Returning null for an empty row is slightly ugly, but the case where there is no pre-existing row is fairly common // (especially when building the view), so we want to avoid a dummy allocation of an empty row every time. // And MultiViewUpdateBuilder knows how to deal with that. return deletion.isLive() ? null : BTreeRow.emptyDeletedRow(clustering, Row.Deletion.regular(deletion)); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING && !metadata.isSuper()) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING && !metadata.isSuper()) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING && !metadata.isSuper()) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }
public Row.SimpleBuilder delete() { assert !initiated : "If called, delete() should be called before any other column value addition"; builder.addRowDeletion(Row.Deletion.regular(new DeletionTime(timestamp, nowInSec))); return this; }
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); }