use of org.tikv.kvproto.Kvrpcpb.RawBatchDeleteResponse in project client-java by tikv.
the class RegionStoreClient method rawBatchDelete.
public void rawBatchDelete(BackOffer backoffer, List<ByteString> keys, boolean atomicForCAS) {
Long clusterId = pdClient.getClusterId();
Histogram.Timer requestTimer = GRPC_RAW_REQUEST_LATENCY.labels("client_grpc_raw_batch_delete", clusterId.toString()).startTimer();
try {
if (keys.isEmpty()) {
return;
}
Supplier<RawBatchDeleteRequest> factory = () -> RawBatchDeleteRequest.newBuilder().setContext(makeContext(storeType, backoffer.getSlowLog())).addAllKeys(keys).setForCas(atomicForCAS).build();
RegionErrorHandler<RawBatchDeleteResponse> handler = new RegionErrorHandler<RawBatchDeleteResponse>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawBatchDeleteResponse resp = callWithRetry(backoffer, TikvGrpc.getRawBatchDeleteMethod(), factory, handler);
handleRawBatchDelete(resp);
} finally {
requestTimer.observeDuration();
}
}
use of org.tikv.kvproto.Kvrpcpb.RawBatchDeleteResponse in project tispark by pingcap.
the class RegionStoreClient method rawBatchDelete.
public void rawBatchDelete(BackOffer backoffer, List<ByteString> keys, boolean atomic) {
if (keys.isEmpty()) {
return;
}
Supplier<RawBatchDeleteRequest> factory = () -> RawBatchDeleteRequest.newBuilder().setContext(region.getContext()).addAllKeys(keys).setForCas(atomic).build();
KVErrorHandler<RawBatchDeleteResponse> handler = new KVErrorHandler<>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawBatchDeleteResponse resp = callWithRetry(backoffer, TikvGrpc.getRawBatchDeleteMethod(), factory, handler);
handleRawBatchDelete(resp);
}
Aggregations