diff --git a/client/client.go b/client/client.go index 272d6c597b5..2fc9bd3ef0d 100644 --- a/client/client.go +++ b/client/client.go @@ -102,16 +102,6 @@ type RPCClient interface { // SetExternalTimestamp sets external timestamp SetExternalTimestamp(ctx context.Context, timestamp uint64) error - // WithCallerComponent returns a new RPCClient with the specified caller - // component. Caller component refers to the specific part or module within - // the process. You can set the component in two ways: - // * Define it manually, like `caller.Component("DDL")`. - // * Use the provided helper function, `caller.GetComponent(upperLayer)`. - // The upperLayer parameter specifies the depth of the caller stack, - // where 0 means the current function. Adjust the upperLayer value based - // on your needs. - WithCallerComponent(callerComponent caller.Component) RPCClient - router.Client tso.Client metastorage.Client @@ -138,6 +128,15 @@ type Client interface { // UpdateOption updates the client option. UpdateOption(option opt.DynamicOption, value any) error + // WithCallerComponent returns a new Client with the specified caller + // component. Caller component refers to the specific part or module within + // the process. You can set the component in two ways: + // * Define it manually, like `caller.Component("DDL")`. + // * Use the provided helper function, `caller.GetComponent(upperLayer)`. + // The upperLayer parameter specifies the depth of the caller stack, + // where 0 means the current function. Adjust the upperLayer value based + // on your needs. + WithCallerComponent(callerComponent caller.Component) Client // Close closes the client. Close() @@ -1364,7 +1363,7 @@ func (c *client) respForErr(observer prometheus.Observer, start time.Time, err e } // WithCallerComponent implements the RPCClient interface. -func (c *client) WithCallerComponent(callerComponent caller.Component) RPCClient { +func (c *client) WithCallerComponent(callerComponent caller.Component) Client { newClient := *c newClient.callerComponent = callerComponent return &newClient