我有一个索引表,其中包含以下架构:
Row CF CQ
Name POB DOB
我怎样才能有效删除多行(即John Doe:纽约:01/01/75,Jane Doe:Miami:06/21/80)?
答案 0 :(得分:1)
使用您要删除的所有BatchDeleter
(行)中的setRanges
和Range
https://accumulo.apache.org/1.7/apidocs/org/apache/accumulo/core/client/BatchDeleter.html
答案 1 :(得分:0)
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();
答案 2 :(得分:0)
或使用Put Delete
Mutation mutation_data = new Mutation(" ");
mutation_data.putDelete(CF,CQ);