use of org.tikv.kvproto.Kvrpcpb.RawDeleteRangeRequest in project tispark by pingcap.
the class RegionStoreClient method rawDeleteRange.
/**
* Delete raw keys in the range of [startKey, endKey)
*
* @param backOffer BackOffer
* @param startKey startKey
* @param endKey endKey
*/
public void rawDeleteRange(BackOffer backOffer, ByteString startKey, ByteString endKey) {
Supplier<RawDeleteRangeRequest> factory = () -> RawDeleteRangeRequest.newBuilder().setContext(region.getContext()).setStartKey(startKey).setEndKey(endKey).build();
KVErrorHandler<RawDeleteRangeResponse> handler = new KVErrorHandler<>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawDeleteRangeResponse resp = callWithRetry(backOffer, TikvGrpc.getRawDeleteRangeMethod(), factory, handler);
rawDeleteRangeHelper(resp);
}
use of org.tikv.kvproto.Kvrpcpb.RawDeleteRangeRequest in project client-java by tikv.
the class RegionStoreClient method rawDeleteRange.
/**
* Delete raw keys in the range of [startKey, endKey)
*
* @param backOffer BackOffer
* @param startKey startKey
* @param endKey endKey
*/
public void rawDeleteRange(BackOffer backOffer, ByteString startKey, ByteString endKey) {
Long clusterId = pdClient.getClusterId();
Histogram.Timer requestTimer = GRPC_RAW_REQUEST_LATENCY.labels("client_grpc_raw_delete_range", clusterId.toString()).startTimer();
try {
Supplier<RawDeleteRangeRequest> factory = () -> RawDeleteRangeRequest.newBuilder().setContext(makeContext(storeType, backOffer.getSlowLog())).setStartKey(startKey).setEndKey(endKey).build();
RegionErrorHandler<RawDeleteRangeResponse> handler = new RegionErrorHandler<RawDeleteRangeResponse>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawDeleteRangeResponse resp = callWithRetry(backOffer, TikvGrpc.getRawDeleteRangeMethod(), factory, handler);
rawDeleteRangeHelper(resp);
} finally {
requestTimer.observeDuration();
}
}
Aggregations