Search in sources :

Example 1 with CleanupBulkLoadResponse

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

the class SecureBulkLoadEndpointClient method cleanupBulkLoad.

public void cleanupBulkLoad(final String bulkToken) throws IOException {
    try {
        CoprocessorRpcChannel channel = table.coprocessorService(HConstants.EMPTY_START_ROW);
        SecureBulkLoadProtos.SecureBulkLoadService instance = ProtobufUtil.newServiceStub(SecureBulkLoadProtos.SecureBulkLoadService.class, channel);
        ServerRpcController controller = new ServerRpcController();
        CoprocessorRpcUtils.BlockingRpcCallback<CleanupBulkLoadResponse> rpcCallback = new CoprocessorRpcUtils.BlockingRpcCallback<>();
        CleanupBulkLoadRequest request = CleanupBulkLoadRequest.newBuilder().setBulkToken(bulkToken).build();
        instance.cleanupBulkLoad(controller, request, rpcCallback);
        if (controller.failedOnException()) {
            throw controller.getFailedOn();
        }
    } catch (Throwable throwable) {
        throw new IOException(throwable);
    }
}
Also used : CoprocessorRpcUtils(org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils) CleanupBulkLoadRequest(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CleanupBulkLoadRequest) CoprocessorRpcChannel(org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel) IOException(java.io.IOException) ServerRpcController(org.apache.hadoop.hbase.ipc.ServerRpcController) CleanupBulkLoadResponse(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CleanupBulkLoadResponse) SecureBulkLoadProtos(org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos)

Aggregations

IOException (java.io.IOException)1 CoprocessorRpcChannel (org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel)1 CoprocessorRpcUtils (org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils)1 ServerRpcController (org.apache.hadoop.hbase.ipc.ServerRpcController)1 CleanupBulkLoadRequest (org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CleanupBulkLoadRequest)1 CleanupBulkLoadResponse (org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CleanupBulkLoadResponse)1 SecureBulkLoadProtos (org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos)1