Skip to content

Commit d210b55

Browse files
committed
rename
Signed-off-by: tongjian <1045931706@qq.com>
1 parent 276da6e commit d210b55

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

client/opt/option.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ func WithAllowRouterServiceHandleStoreRequest() GetStoreOption {
261261
return func(op *GetStoreOp) { op.AllowRouterServiceHandle = true }
262262
}
263263

264-
// WithPDLeaderOnlyStoreRequest means the store request must be handled by PD leader.
265-
func WithPDLeaderOnlyStoreRequest() GetStoreOption {
264+
// WithPDLeaderHandleStoreRequestOnly means the store request must be handled by PD leader.
265+
func WithPDLeaderHandleStoreRequestOnly() GetStoreOption {
266266
return func(op *GetStoreOp) {
267267
op.AllowRouterServiceHandle = false
268268
}
@@ -324,8 +324,8 @@ func WithOutputMustContainAllKeyRange() GetRegionOption {
324324
return func(op *GetRegionOp) { op.OutputMustContainAllKeyRange = true }
325325
}
326326

327-
// WithPDLeaderOnly means the request must be handled by PD leader.
328-
func WithPDLeaderOnly() GetRegionOption {
327+
// WithAllowPDLeaderOnly means the request must be handled by PD leader.
328+
func WithAllowPDLeaderOnly() GetRegionOption {
329329
return func(op *GetRegionOp) {
330330
op.AllowRouterServiceHandle = false
331331
op.AllowFollowerHandle = false

client/opt/option_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ func TestOptions(t *testing.T) {
120120
WithAllowRouterServiceHandle()(&op)
121121
re.True(op.AllowFollowerHandle)
122122
re.True(op.AllowRouterServiceHandle)
123-
WithPDLeaderOnly()(&op)
123+
WithAllowPDLeaderOnly()(&op)
124124
re.False(op.AllowFollowerHandle)
125125
re.False(op.AllowRouterServiceHandle)
126126

127127
storeOp := GetStoreOp{}
128128
re.False(storeOp.AllowRouterServiceHandle)
129129
WithAllowRouterServiceHandleStoreRequest()(&storeOp)
130130
re.True(storeOp.AllowRouterServiceHandle)
131-
WithPDLeaderOnlyStoreRequest()(&storeOp)
131+
WithPDLeaderHandleStoreRequestOnly()(&storeOp)
132132
re.False(storeOp.AllowRouterServiceHandle)
133133
}
134134

0 commit comments

Comments
 (0)