use of org.tikv.kvproto.Pdpb.Timestamp in project client-java by tikv.
the class PDClient method getTimestamp.
@Override
public TiTimestamp getTimestamp(BackOffer backOffer) {
Supplier<TsoRequest> request = () -> tsoReq;
PDErrorHandler<TsoResponse> handler = new PDErrorHandler<>(r -> r.getHeader().hasError() ? buildFromPdpbError(r.getHeader().getError()) : null, this);
TsoResponse resp = callWithRetry(backOffer, PDGrpc.getTsoMethod(), request, handler);
Timestamp timestamp = resp.getTimestamp();
return new TiTimestamp(timestamp.getPhysical(), timestamp.getLogical());
}
use of org.tikv.kvproto.Pdpb.Timestamp in project tispark by pingcap.
the class PDClient method getTimestamp.
@Override
public TiTimestamp getTimestamp(BackOffer backOffer) {
Supplier<TsoRequest> request = () -> tsoReq;
PDErrorHandler<TsoResponse> handler = new PDErrorHandler<>(r -> r.getHeader().hasError() ? buildFromPdpbError(r.getHeader().getError()) : null, this);
TsoResponse resp = callWithRetry(backOffer, PDGrpc.getTsoMethod(), request, handler);
Timestamp timestamp = resp.getTimestamp();
return new TiTimestamp(timestamp.getPhysical(), timestamp.getLogical());
}
Aggregations