Documentation ¶
Overview ¶
Package client provides tcp connection to kvserver.
Package client provides tcp connection to kvserver.
Package client provides tcp connection to kvserver.
Index ¶
Constants ¶
const ( ReadTimeoutShort = 30 * time.Second // For requests that read/write several key-values. ReadTimeoutMedium = 60 * time.Second // For requests that may need scan region. // MaxWriteExecutionTime is the MaxExecutionDurationMs field for write requests. // Because the last deadline check is before proposing, let us give it 10 more seconds // after proposing. MaxWriteExecutionTime = ReadTimeoutShort - 10*time.Second )
Timeout durations.
const ( GrpcInitialWindowSize = 1 << 30 GrpcInitialConnWindowSize = 1 << 30 )
Grpc window size
Variables ¶
var MaxRecvMsgSize = math.MaxInt64 - 1
MaxRecvMsgSize set max gRPC receive message size received from server. If any message size is larger than current value, an error will be reported from gRPC.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Close should release all data. Close() error // CloseAddr closes gRPC connections to the address. It will reconnect the next time it's used. CloseAddr(addr string) error // SendRequest sends Request. SendRequest(ctx context.Context, addr string, req *tikvrpc.Request, timeout time.Duration) (*tikvrpc.Response, error) }
Client is a client that sends RPC. It should not be used after calling Close().
func NewInterceptedClient ¶
NewInterceptedClient creates a Client which can execute interceptor.
func NewReqCollapse ¶
NewReqCollapse creates a reqCollapse.
type Opt ¶
type Opt func(*RPCClient)
Opt is the option for the client.
func WithSecurity ¶
WithSecurity is used to set the security config.
type RPCClient ¶
RPCClient is RPC client struct. TODO: Add flow control between RPC clients in TiDB ond RPC servers in TiKV. Since we use shared client connection to communicate to the same TiKV, it's possible that there are too many concurrent requests which overload the service of TiKV.
func NewRPCClient ¶
NewRPCClient creates a client that manages connections and rpc calls with tikv-servers.