Skip to content

Commit

Permalink
remove WithCallerID
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Nov 15, 2024
1 parent 1c5d544 commit 10ff91d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
10 changes: 0 additions & 10 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ type RPCClient interface {
// SetExternalTimestamp sets external timestamp
SetExternalTimestamp(ctx context.Context, timestamp uint64) error

// WithCallerID returns a new RPCClient with the specified caller ID. Caller
// ID can be understood as the name of the binary file.
WithCallerID(callerID caller.ID) RPCClient
// 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:
Expand Down Expand Up @@ -1448,13 +1445,6 @@ func (c *client) respForErr(observer prometheus.Observer, start time.Time, err e
return nil
}

// WithCallerID implements the RPCClient interface.
func (c *client) WithCallerID(callerID caller.ID) RPCClient {
newClient := *c
newClient.callerID = callerID
return &newClient
}

// WithCallerComponent implements the RPCClient interface.
func (c *client) WithCallerComponent(callerComponent caller.Component) RPCClient {
newClient := *c
Expand Down
3 changes: 1 addition & 2 deletions tests/integrations/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1291,10 +1291,9 @@ func (suite *clientTestSuite) TestGetRegionByID() {
reflect.DeepEqual(peers[0], r.Leader)
})

// test WithCallerID and WithCallerComponent
// test WithCallerComponent
testutil.Eventually(re, func() bool {
r, err := suite.client.
WithCallerID(caller.GetCallerID()).
WithCallerComponent(caller.GetComponent(0)).
GetRegionByID(context.Background(), regionID)
re.NoError(err)
Expand Down

0 comments on commit 10ff91d

Please sign in to comment.