Search in sources :

Example 1 with CleanupBulkLoadRequest

use of org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest in project hbase by apache.

the class SecureBulkLoadClient method cleanupBulkLoad.

public void cleanupBulkLoad(final Connection conn, final String bulkToken) throws IOException {
    try {
        ClientServiceCallable<Void> callable = new ClientServiceCallable<Void>(conn, table.getName(), HConstants.EMPTY_START_ROW, this.rpcControllerFactory.newController()) {

            @Override
            protected Void rpcCall() throws Exception {
                byte[] regionName = getLocation().getRegionInfo().getRegionName();
                RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
                CleanupBulkLoadRequest request = CleanupBulkLoadRequest.newBuilder().setRegion(region).setBulkToken(bulkToken).build();
                getStub().cleanupBulkLoad(null, request);
                return null;
            }
        };
        RpcRetryingCallerFactory.instantiate(conn.getConfiguration(), null).<Void>newCaller().callWithRetries(callable, Integer.MAX_VALUE);
    } catch (Throwable throwable) {
        throw new IOException(throwable);
    }
}
Also used : CleanupBulkLoadRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest) IOException(java.io.IOException) RegionSpecifier(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)

Aggregations

IOException (java.io.IOException)1 CleanupBulkLoadRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest)1 RegionSpecifier (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)1