Defines a protocol to delete data in bulk based on a scan. The scan can be range scan or with
conditions(filters) etc.
Example:
Scan scan = new Scan();
// set scan properties(rowkey range, filters, timerange etc).
HTable ht = ...;
long noOfDeletedRows = 0L;
Batch.Call<BulkDeleteProtocol, BulkDeleteResponse> callable =
new Batch.Call<BulkDeleteProtocol, BulkDeleteResponse>() {
public BulkDeleteResponse call(BulkDeleteProtocol instance) throws IOException {
return instance.deleteRows(scan, BulkDeleteProtocol.DeleteType, timestamp, rowBatchSize);
}
};
Map<byte[], BulkDeleteResponse> result = ht.coprocessorExec(BulkDeleteProtocol.class,
scan.getStartRow(), scan.getStopRow(), callable);
for (BulkDeleteResponse response : result.values()) {
noOfDeletedRows = response.getRowsDeleted();
}