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