@Override public UpdateRequest deleteSegment(UUID segment, UUID dataId) { _mutation.withRow(CF_DEDUP_DATA, dataId) .delete(); _mutation.withRow(CF_DEDUP_MD, queue) .deleteColumn(segment); return this; }
@Override public UpdateRequest deleteSegment(UUID segment, UUID dataId) { _mutation.withRow(CF_DEDUP_DATA, dataId) .delete(); _mutation.withRow(CF_DEDUP_MD, queue) .deleteColumn(segment); return this; }
@Override public <K> void deleteRow(Iterable<? extends ColumnFamily<K, ?>> columnFamilies, K rowKey) { for (ColumnFamily<K, ?> cf : columnFamilies) { withRow(cf, rowKey).delete(); } }
@Override public void delete(String channel, ByteBuffer slabId) { // Deletes don't need to be durable. If a delete is lost, the next reader to come along and find no events // will execute the delete again. MutationBatch mutation = _keyspace.prepareMutationBatch(ConsistencyLevel.CL_ANY); mutation.withRow(ColumnFamilies.MANIFEST, channel) .deleteColumn(slabId); mutation.withRow(ColumnFamilies.SLAB, slabId) .delete(); execute(mutation); _deleteMeter.mark(); }
public void deleteRow() { row().delete(); } }
@Override public void delete(String channel, ByteBuffer slabId) { // Deletes don't need to be durable. If a delete is lost, the next reader to come along and find no events // will execute the delete again. MutationBatch mutation = _keyspace.prepareMutationBatch(ConsistencyLevel.CL_ANY); mutation.withRow(ColumnFamilies.MANIFEST, channel) .deleteColumn(slabId); mutation.withRow(ColumnFamilies.SLAB, slabId) .delete(); execute(mutation); _deleteMeter.mark(); }
@Override public <K> void deleteRow(Iterable<? extends ColumnFamily<K, ?>> columnFamilies, K rowKey) { for (ColumnFamily<K, ?> cf : columnFamilies) { withRow(cf, rowKey).delete(); } }
@Override public <K> void deleteRow(Iterable<? extends ColumnFamily<K, ?>> columnFamilies, K rowKey) { for (ColumnFamily<K, ?> cf : columnFamilies) { withRow(cf, rowKey).delete(); } }
public void deleteRow() { row().delete(); } }
private void deleteRowsForColumnRange() throws Exception { for (char keyName = 'A'; keyName <= 'Z'; keyName++) { MutationBatch m = keyspace.prepareMutationBatch(); String rowKey = Character.toString(keyName); m.withRow(CF_COLUMN_RANGE_TEST, rowKey).delete(); m.execute(); m.discardMutations(); } }
private void deleteRowsForCFPopulation() throws Exception { MutationBatch m = keyspace.prepareMutationBatch(); for (int year = 2001; year <= 2014; year ++) { m.withRow(CF_POPULATION, year).delete(); } m.execute(); }
public static void deleteRowsForColumnRange(Keyspace keyspace) throws Exception { for (char keyName = 'A'; keyName <= 'Z'; keyName++) { MutationBatch m = keyspace.prepareMutationBatch(); String rowKey = Character.toString(keyName); m.withRow(CF_COLUMN_RANGE_TEST, rowKey).delete(); m.execute(); m.discardMutations(); } } }
private void deleteRowFromKS(Keyspace ks, int ... rowKeys) throws ConnectionException { MutationBatch mb = ks.prepareMutationBatch(); for (int rowKey : rowKeys) { mb.withRow(CF_DUAL_WRITES, rowKey).delete(); } mb.execute(); }
public static void deleteRowsForAccountsTable(Keyspace keyspace) throws Exception { for (char keyName = 'A'; keyName <= 'Z'; keyName++) { MutationBatch m = keyspace.prepareMutationBatch(); String rowKey = Character.toString(keyName); m.withRow(CF_ACCOUNTS, rowKey).delete(); m.execute(); m.discardMutations(); } } }
public void deleteRows(int numRows) throws Exception { MutationBatch mb = keyspace.prepareMutationBatch(); for (int i=0; i<numRows; i++) { mb.withRow(CF_USER_INFO, "acct_" + i).delete(); mb.execute(); mb.discardMutations(); } }
@Override public void deleteObject(String objectName, Integer chunkCount) throws Exception, NotFoundException { if (chunkCount == null) { ObjectMetadata attr = readMetadata(objectName); if (attr.getChunkCount() == null) throw new NotFoundException("Object not found :" + objectName); chunkCount = attr.getChunkCount(); } MutationBatch m = keyspace.prepareMutationBatch().withRetryPolicy(retryPolicy); for (int i = 0; i < chunkCount; i++) { m.withRow(cf, getRowKey(objectName, i)).delete(); } m.withRow(cf, objectName).delete(); m.execute(); }
@ParameterizedTimed(type="AstyanaxStorageProvider") @Override public void deleteObject(Table tbl, String blobId, Integer chunkCount) { AstyanaxTable table = (AstyanaxTable) checkNotNull(tbl, "table"); for (AstyanaxStorage storage : table.getWriteStorage()) { BlobPlacement placement = (BlobPlacement) storage.getPlacement(); MutationBatch mutation = placement.getKeyspace().prepareMutationBatch(CONSISTENCY_STRONG); mutation.withRow(placement.getBlobColumnFamily(), storage.getRowKey(blobId)) .delete(); execute(mutation); } }
@Override public void clearMessages() throws MessageQueueException { LOG.info("Clearing messages from '" + getName() + "'"); MutationBatch mb = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel); for (MessageQueueShard partition : shardReaderPolicy.listShards()) { mb.withRow(queueColumnFamily, partition.getName()).delete(); } try { mb.execute(); } catch (ConnectionException e) { throw new MessageQueueException("Failed to clear messages from queue " + getName(), e); } }
@Override public void deleteQueue() throws MessageQueueException { LOG.info("Deleting queue '" + getName() + "'"); MutationBatch mb = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel); for (MessageQueueShard partition : shardReaderPolicy.listShards()) { mb.withRow(queueColumnFamily, partition.getName()).delete(); } mb.withRow(queueColumnFamily, getName()); try { mb.execute(); } catch (ConnectionException e) { throw new MessageQueueException("Failed to clear messages from queue " + getName(), e); } }