title: How to mass delete multiple rows in hbase?
body: <p>I have the following rows with these keys in hbase table "mytable"</p>
  
  <pre><code>user_1
  user_2
  user_3
  ...
  user_9999999
  </code></pre>
  
  <p>I want to use the Hbase shell to delete rows from:</p>
  
  <p>user_500 to user_900</p>
  
  <p>I know there is no way to delete, but is there a way I could use the "BulkDeleteProcessor" to do this?</p>
  
  <p>I see here:</p>
  
  <blockquote>
    <p><a href="https://github.com/apache/hbase/blob/master/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestBulkDeleteProtocol.java">https://github.com/apache/hbase/blob/master/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestBulkDeleteProtocol.java</a></p>
  </blockquote>
  
  <p>I want to just paste in imports and then paste this into the shell, but have no idea how to go about this. Does anyone know how I can use this endpoint from the jruby hbase shell?</p>
  
  <pre><code>   Table ht = TEST_UTIL.getConnection().getTable("my_table");
      long noOfDeletedRows = 0L;
      Batch.Call&lt;BulkDeleteService, BulkDeleteResponse&gt; callable =
        new Batch.Call&lt;BulkDeleteService, BulkDeleteResponse&gt;() {
        ServerRpcController controller = new ServerRpcController();
        BlockingRpcCallback&lt;BulkDeleteResponse&gt; rpcCallback =
          new BlockingRpcCallback&lt;BulkDeleteResponse&gt;();
  
        public BulkDeleteResponse call(BulkDeleteService service) throws IOException {
          Builder builder = BulkDeleteRequest.newBuilder();
          builder.setScan(ProtobufUtil.toScan(scan));
          builder.setDeleteType(deleteType);
          builder.setRowBatchSize(rowBatchSize);
          if (timeStamp != null) {
            builder.setTimestamp(timeStamp);
          }
          service.delete(controller, builder.build(), rpcCallback);
          return rpcCallback.get();
        }
      };
      Map&lt;byte[], BulkDeleteResponse&gt; result = ht.coprocessorService(BulkDeleteService.class, scan
          .getStartRow(), scan.getStopRow(), callable);
      for (BulkDeleteResponse response : result.values()) {
        noOfDeletedRows += response.getRowsDeleted();
      }
      ht.close();
  </code></pre>
  
  <p>If there exists no way to do this through JRuby, Java or alternate way to quickly delete multiple rows is fine.</p>