use of org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest in project hbase by apache.
the class SecureBulkLoadClient method prepareBulkLoad.
public String prepareBulkLoad(final Connection conn) throws IOException {
try {
ClientServiceCallable<String> callable = new ClientServiceCallable<String>(conn, table.getName(), HConstants.EMPTY_START_ROW, this.rpcControllerFactory.newController()) {
@Override
protected String rpcCall() throws Exception {
byte[] regionName = getLocation().getRegionInfo().getRegionName();
RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
PrepareBulkLoadRequest request = PrepareBulkLoadRequest.newBuilder().setTableName(ProtobufUtil.toProtoTableName(table.getName())).setRegion(region).build();
PrepareBulkLoadResponse response = getStub().prepareBulkLoad(null, request);
return response.getBulkToken();
}
};
return RpcRetryingCallerFactory.instantiate(conn.getConfiguration(), null).<String>newCaller().callWithRetries(callable, Integer.MAX_VALUE);
} catch (Throwable throwable) {
throw new IOException(throwable);
}
}
Aggregations