public void delete(String cfName, CellName name, long timestamp) { int localDeleteTime = (int) (System.currentTimeMillis() / 1000); addOrGet(cfName).addTombstone(name, localDeleteTime, timestamp); }
public void delete(IndexedEntry entry, OpOrder.Group opGroup) { int localDeletionTime = (int) (System.currentTimeMillis() / 1000); ColumnFamily cfi = ArrayBackedSortedColumns.factory.create(indexCfs.metadata); cfi.addTombstone(entry.indexEntry, localDeletionTime, entry.timestamp); indexCfs.apply(entry.indexValue, cfi, SecondaryIndexManager.nullUpdater, opGroup, null); if (logger.isDebugEnabled()) logger.debug("removed index entry for cleaned-up value {}:{}", entry.indexValue, cfi); }
public void deleteForCleanup(ByteBuffer rowKey, Cell cell, OpOrder.Group opGroup) { if (!cell.isLive()) return; DecoratedKey valueKey = getIndexKeyFor(getIndexedValue(rowKey, cell)); int localDeletionTime = (int) (System.currentTimeMillis() / 1000); ColumnFamily cfi = ArrayBackedSortedColumns.factory.create(indexCfs.metadata, false, 1); cfi.addTombstone(makeIndexColumnName(rowKey, cell), localDeletionTime, cell.timestamp()); indexCfs.apply(valueKey, cfi, SecondaryIndexManager.nullUpdater, opGroup, null); if (logger.isDebugEnabled()) logger.debug("removed index entry for cleaned-up value {}:{}", valueKey, cfi); }
/** * Remove all CF attributes from schema * * @param timestamp Timestamp to use * * @return Mutation to use to completely remove cf from schema */ public Mutation dropFromSchema(long timestamp) { Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(ksName)); ColumnFamily cf = mutation.addOrGet(SchemaColumnFamiliesCf); int ldt = (int) (System.currentTimeMillis() / 1000); Composite prefix = SchemaColumnFamiliesCf.comparator.make(cfName); cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt)); for (ColumnDefinition cd : allColumns()) cd.deleteFromSchema(mutation, timestamp); for (TriggerDefinition td : triggers.values()) td.deleteFromSchema(mutation, cfName, timestamp); for (String indexName : Keyspace.open(this.ksName).getColumnFamilyStore(this.cfName).getBuiltIndexes()) { ColumnFamily indexCf = mutation.addOrGet(IndexCf); indexCf.addTombstone(indexCf.getComparator().makeCellName(indexName), ldt, timestamp); } return mutation; }
cfamily.addTombstone(cname, col.getValue(), col.timestamp);