org.apache.hadoop.hbase.coprocessor.example
Interface BulkDeleteProtocol

All Superinterfaces:
CoprocessorProtocol, VersionedProtocol
All Known Implementing Classes:
BulkDeleteEndpoint

public interface BulkDeleteProtocol
extends CoprocessorProtocol

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();
  }
 


Nested Class Summary
static interface BulkDeleteProtocol.DeleteType
           
 
Field Summary
 
Fields inherited from interface org.apache.hadoop.hbase.ipc.CoprocessorProtocol
VERSION
 
Method Summary
 BulkDeleteResponse delete(Scan scan, byte deleteType, Long timestamp, int rowBatchSize)
           
 
Methods inherited from interface org.apache.hadoop.hbase.ipc.VersionedProtocol
getProtocolSignature, getProtocolVersion
 

Method Detail

delete

BulkDeleteResponse delete(Scan scan,
                          byte deleteType,
                          Long timestamp,
                          int rowBatchSize)
Parameters:
scan -
deleteType -
timestamp -
rowBatchSize - The number of rows which need to be accumulated by scan and delete as one batch
Returns:


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.