Search in sources :

Example 1 with BulkLoadHFileRequest

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

the class SecureBulkLoadEndpoint method secureBulkLoadHFiles.

@Override
public void secureBulkLoadHFiles(RpcController controller, SecureBulkLoadHFilesRequest request, RpcCallback<SecureBulkLoadHFilesResponse> done) {
    boolean loaded = false;
    Map<byte[], List<Path>> map = null;
    try {
        SecureBulkLoadManager secureBulkLoadManager = this.env.getRegionServerServices().getSecureBulkLoadManager();
        BulkLoadHFileRequest bulkLoadHFileRequest = ConvertSecureBulkLoadHFilesRequest(request);
        map = secureBulkLoadManager.secureBulkLoadHFiles(this.env.getRegion(), convert(bulkLoadHFileRequest));
        loaded = map != null && !map.isEmpty();
    } catch (IOException e) {
        CoprocessorRpcUtils.setControllerException(controller, e);
    }
    done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(loaded).build());
}
Also used : SecureBulkLoadManager(org.apache.hadoop.hbase.regionserver.SecureBulkLoadManager) BulkLoadHFileRequest(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest) List(java.util.List) IOException(java.io.IOException)

Example 2 with BulkLoadHFileRequest

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

the class SecureBulkLoadEndpoint method ConvertSecureBulkLoadHFilesRequest.

private BulkLoadHFileRequest ConvertSecureBulkLoadHFilesRequest(SecureBulkLoadHFilesRequest request) {
    BulkLoadHFileRequest.Builder bulkLoadHFileRequest = BulkLoadHFileRequest.newBuilder();
    RegionSpecifier region = ProtobufUtil.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, this.env.getRegionInfo().getRegionName());
    bulkLoadHFileRequest.setRegion(region).setFsToken(request.getFsToken()).setBulkToken(request.getBulkToken()).setAssignSeqNum(request.getAssignSeqNum()).addAllFamilyPath(request.getFamilyPathList());
    return bulkLoadHFileRequest.build();
}
Also used : BulkLoadHFileRequest(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest) RegionSpecifier(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier)

Aggregations

BulkLoadHFileRequest (org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest)2 IOException (java.io.IOException)1 List (java.util.List)1 RegionSpecifier (org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier)1 SecureBulkLoadManager (org.apache.hadoop.hbase.regionserver.SecureBulkLoadManager)1