use of org.tikv.kvproto.Kvrpcpb.RawGetRequest in project client-java by tikv.
the class RegionStoreClient method rawGet.
// APIs for Raw Scan/Put/Get/Delete
public Optional<ByteString> rawGet(BackOffer backOffer, ByteString key) {
Long clusterId = pdClient.getClusterId();
Histogram.Timer requestTimer = GRPC_RAW_REQUEST_LATENCY.labels("client_grpc_raw_get", clusterId.toString()).startTimer();
try {
Supplier<RawGetRequest> factory = () -> RawGetRequest.newBuilder().setContext(makeContext(storeType, backOffer.getSlowLog())).setKey(key).build();
RegionErrorHandler<RawGetResponse> handler = new RegionErrorHandler<RawGetResponse>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawGetResponse resp = callWithRetry(backOffer, TikvGrpc.getRawGetMethod(), factory, handler);
return rawGetHelper(resp);
} finally {
requestTimer.observeDuration();
}
}
use of org.tikv.kvproto.Kvrpcpb.RawGetRequest in project tispark by pingcap.
the class RegionStoreClient method rawGet.
// APIs for Raw Scan/Put/Get/Delete
public ByteString rawGet(BackOffer backOffer, ByteString key) {
Supplier<RawGetRequest> factory = () -> RawGetRequest.newBuilder().setContext(region.getContext()).setKey(key).build();
KVErrorHandler<RawGetResponse> handler = new KVErrorHandler<>(regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawGetResponse resp = callWithRetry(backOffer, TikvGrpc.getRawGetMethod(), factory, handler);
return rawGetHelper(resp);
}
Aggregations