我有一个具有以下模式的索引表:
Row CF CQ
Name POB DOB
如何有效删除多行(例如John Doe:纽约:01/01/75,Jane Doe:迈阿密:06/21/80)?
使用要删除的所有Range
(行)的BatchDeleter
和setRanges
https://accumulo.apache.org/1.7/apidocs/org/apache/accumulo/core/client/BatchDeleter.html
BatchDeleter deleter= conn.createBatchDeleter("Table Name", new Authorizations(), 1, config);
Collection<Range> ranges = new ArrayList<Range>();
Scanner tableScannerRange= conn.createScanner("TableName", new Authorizations());
tableScannerRange.setRange(new Range("XXXX"));
for (Entry<Key, Value> entry : tableScannerRange) {
ranges.add(new Range(entry.getKey().getRow()));
}
deleter.setRanges(ranges);
deleter.delete();
或使用Put-Delete
Mutation mutation_data = new Mutation(" ");
mutation_data.putDelete(CF,CQ);