Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // SendRequest sends Request SendRequest(ctx context.Context, req *Request, timeout time.Duration) (*Response, error) // Cloase close client and releases all data Close() error }
Client is a client that sends RPC. It should not be used after calling Close().
type CmdType ¶
type CmdType uint16
CmdType represents the concrete request type in Request or response type in Response.
const ( CmdStartSubTask CmdType = 1 + iota CmdOperateSubTask CmdUpdateSubTask CmdQueryStatus CmdQueryError CmdQueryTaskOperation CmdQueryWorkerConfig CmdHandleSubTaskSQLs CmdExecDDL CmdBreakDDLLock CmdSwitchRelayMaster CmdOperateRelay CmdPurgeRelay CmdUpdateRelay CmdMigrateRelay CmdFetchDDLInfo )
CmdType values.
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient stores raw grpc connection and worker client
func NewGRPCClient ¶
func NewGRPCClient(addr string) (*GRPCClient, error)
NewGRPCClient initializes a new grpc client from worker address
func NewGRPCClientWrap ¶
func NewGRPCClientWrap(conn *grpc.ClientConn, client pb.WorkerClient) (*GRPCClient, error)
NewGRPCClientWrap initializes a new grpc client from given grpc connection and worker client
func (*GRPCClient) SendRequest ¶
func (c *GRPCClient) SendRequest(ctx context.Context, req *Request, timeout time.Duration) (*Response, error)
SendRequest implements Client.SendRequest
type Request ¶
type Request struct { Type CmdType StartSubTask *pb.StartSubTaskRequest OperateSubTask *pb.OperateSubTaskRequest UpdateSubTask *pb.UpdateSubTaskRequest QueryStatus *pb.QueryStatusRequest QueryError *pb.QueryErrorRequest QueryTaskOperation *pb.QueryTaskOperationRequest QueryWorkerConfig *pb.QueryWorkerConfigRequest HandleSubTaskSQLs *pb.HandleSubTaskSQLsRequest ExecDDL *pb.ExecDDLRequest BreakDDLLock *pb.BreakDDLLockRequest SwitchRelayMaster *pb.SwitchRelayMasterRequest OperateRelay *pb.OperateRelayRequest PurgeRelay *pb.PurgeRelayRequest UpdateRelay *pb.UpdateRelayRequest MigrateRelay *pb.MigrateRelayRequest }
Request wraps all dm-worker rpc requests.
func (*Request) IsStreamAPI ¶
IsStreamAPI checks whether a request is streaming API based on CmdType
type Response ¶
type Response struct { Type CmdType StartSubTask *pb.OperateSubTaskResponse OperateSubTask *pb.OperateSubTaskResponse UpdateSubTask *pb.OperateSubTaskResponse QueryStatus *pb.QueryStatusResponse QueryError *pb.QueryErrorResponse QueryTaskOperation *pb.QueryTaskOperationResponse QueryWorkerConfig *pb.QueryWorkerConfigResponse HandleSubTaskSQLs *pb.CommonWorkerResponse ExecDDL *pb.CommonWorkerResponse BreakDDLLock *pb.CommonWorkerResponse SwitchRelayMaster *pb.CommonWorkerResponse OperateRelay *pb.OperateRelayResponse PurgeRelay *pb.CommonWorkerResponse UpdateRelay *pb.CommonWorkerResponse MigrateRelay *pb.CommonWorkerResponse FetchDDLInfo pb.Worker_FetchDDLInfoClient }
Response wraps all dm-worker rpc responses.
Click to show internal directories.
Click to hide internal directories.