use of org.tikv.kvproto.Kvrpcpb.RawDeleteRequest in project tispark by pingcap.
the class RegionStoreClient method rawDelete.
public void rawDelete(BackOffer backOffer, ByteString key) {
Supplier<RawDeleteRequest> factory = () -> RawDeleteRequest.newBuilder().setContext(region.getContext()).setKey(key).build();
KVErrorHandler<RawDeleteResponse> handler = new KVErrorHandler<>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawDeleteResponse resp = callWithRetry(backOffer, TikvGrpc.getRawDeleteMethod(), factory, handler);
rawDeleteHelper(resp, region);
}
use of org.tikv.kvproto.Kvrpcpb.RawDeleteRequest in project client-java by tikv.
the class RegionStoreClient method rawDelete.
public void rawDelete(BackOffer backOffer, ByteString key, boolean atomicForCAS) {
Long clusterId = pdClient.getClusterId();
Histogram.Timer requestTimer = GRPC_RAW_REQUEST_LATENCY.labels("client_grpc_raw_delete", clusterId.toString()).startTimer();
try {
Supplier<RawDeleteRequest> factory = () -> RawDeleteRequest.newBuilder().setContext(makeContext(storeType, backOffer.getSlowLog())).setKey(key).setForCas(atomicForCAS).build();
RegionErrorHandler<RawDeleteResponse> handler = new RegionErrorHandler<RawDeleteResponse>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawDeleteResponse resp = callWithRetry(backOffer, TikvGrpc.getRawDeleteMethod(), factory, handler);
rawDeleteHelper(resp, region);
} finally {
requestTimer.observeDuration();
}
}
Aggregations