public abstract class AbstractGRPCClient<BlockingStubT extends io.grpc.stub.AbstractStub<BlockingStubT>,FutureStubT extends io.grpc.stub.AbstractFutureStub<FutureStubT>> extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected FutureStubT |
asyncStub |
protected BlockingStubT |
blockingStub |
protected ChannelFactory |
channelFactory |
protected TiConfiguration |
conf |
protected org.slf4j.Logger |
logger |
protected long |
timeout |
Modifier | Constructor and Description |
---|---|
protected |
AbstractGRPCClient(TiConfiguration conf,
ChannelFactory channelFactory) |
protected |
AbstractGRPCClient(TiConfiguration conf,
ChannelFactory channelFactory,
BlockingStubT blockingStub,
FutureStubT asyncStub) |
Modifier and Type | Method and Description |
---|---|
protected <ReqT,RespT> |
callAsyncWithRetry(BackOffer backOffer,
io.grpc.MethodDescriptor<ReqT,RespT> method,
Supplier<ReqT> requestFactory,
io.grpc.stub.StreamObserver<RespT> responseObserver,
ErrorHandler<RespT> handler) |
<ReqT,RespT> |
callServerStreamingWithRetry(BackOffer backOffer,
io.grpc.MethodDescriptor<ReqT,RespT> method,
Supplier<ReqT> requestFactory,
ErrorHandler<StreamingResponse> handler) |
<ReqT,RespT> |
callWithRetry(BackOffer backOffer,
io.grpc.MethodDescriptor<ReqT,RespT> method,
Supplier<ReqT> requestFactory,
ErrorHandler<RespT> handler) |
protected boolean |
checkHealth(BackOffer backOffer,
String addressStr,
HostMapping hostMapping) |
protected abstract FutureStubT |
getAsyncStub() |
protected abstract BlockingStubT |
getBlockingStub() |
TiConfiguration |
getConf() |
long |
getTimeout() |
void |
setTimeout(long timeout) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
protected final org.slf4j.Logger logger
protected final ChannelFactory channelFactory
protected TiConfiguration conf
protected long timeout
protected BlockingStubT extends io.grpc.stub.AbstractStub<BlockingStubT> blockingStub
protected FutureStubT extends io.grpc.stub.AbstractFutureStub<FutureStubT> asyncStub
protected AbstractGRPCClient(TiConfiguration conf, ChannelFactory channelFactory)
protected AbstractGRPCClient(TiConfiguration conf, ChannelFactory channelFactory, BlockingStubT blockingStub, FutureStubT asyncStub)
public TiConfiguration getConf()
public <ReqT,RespT> RespT callWithRetry(BackOffer backOffer, io.grpc.MethodDescriptor<ReqT,RespT> method, Supplier<ReqT> requestFactory, ErrorHandler<RespT> handler)
protected <ReqT,RespT> void callAsyncWithRetry(BackOffer backOffer, io.grpc.MethodDescriptor<ReqT,RespT> method, Supplier<ReqT> requestFactory, io.grpc.stub.StreamObserver<RespT> responseObserver, ErrorHandler<RespT> handler)
public <ReqT,RespT> StreamingResponse callServerStreamingWithRetry(BackOffer backOffer, io.grpc.MethodDescriptor<ReqT,RespT> method, Supplier<ReqT> requestFactory, ErrorHandler<StreamingResponse> handler)
public void setTimeout(long timeout)
public long getTimeout()
protected abstract BlockingStubT getBlockingStub()
protected abstract FutureStubT getAsyncStub()
protected boolean checkHealth(BackOffer backOffer, String addressStr, HostMapping hostMapping)
Copyright © 2024 PingCAP. All rights reserved.