Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Jan 22, 2025
1 parent 885ae70 commit 2b6fb72
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion pkg/tso/allocator_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ type AllocatorManager struct {
// member is for election use
member ElectionMember
// TSO config
rootPath string
storage endpoint.TSOStorage
saveInterval time.Duration
updatePhysicalInterval time.Duration
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/keypath/absolute_key_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func ExternalTimestampPath() string {
return fmt.Sprintf(externalTimestampPathFormat, ClusterID())
}

// RecoveringMarkPath returns the path to save the recovering mark.
func RecoveringMarkPath() string {
return fmt.Sprintf(recoveringMarkPathFormat, ClusterID())
}
Expand Down
20 changes: 10 additions & 10 deletions tests/server/api/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (suite *scheduleTestSuite) checkOriginAPI(cluster *tests.TestCluster) {

suite.assertSchedulerExists(urlPrefix, "evict-leader-scheduler")
resp := make(map[string]any)
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, "evict-leader-scheduler")
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, "evict-leader-scheduler")
re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp))
re.Len(resp["store-id-ranges"], 1)
input1 := make(map[string]any)
Expand Down Expand Up @@ -186,15 +186,15 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
name: "balance-leader-scheduler",
createdName: "balance-leader-scheduler",
extraTestFunc: func(name string) {
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
resp := make(map[string]any)
tu.Eventually(re, func() bool {
re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp))
return resp["batch"] == 4.0
})
dataMap := make(map[string]any)
dataMap["batch"] = 3
updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name)
updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name)
body, err := json.Marshal(dataMap)
re.NoError(err)
re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re)))
Expand Down Expand Up @@ -244,7 +244,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
createdName: "balance-hot-region-scheduler",
extraTestFunc: func(name string) {
resp := make(map[string]any)
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
expectMap := map[string]any{
"min-hot-byte-rate": 100.0,
"min-hot-key-rate": 10.0,
Expand Down Expand Up @@ -318,7 +318,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
name: "split-bucket-scheduler",
createdName: "split-bucket-scheduler",
extraTestFunc: func(name string) {
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
resp := make(map[string]any)
tu.Eventually(re, func() bool {
re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp))
Expand Down Expand Up @@ -377,7 +377,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
createdName: "balance-witness-scheduler",
extraTestFunc: func(name string) {
resp := make(map[string]any)
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
tu.Eventually(re, func() bool {
re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp))
return resp["batch"] == 4.0
Expand Down Expand Up @@ -434,7 +434,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
args: []arg{{"store_id", 1}},
extraTestFunc: func(name string) {
resp := make(map[string]any)
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
expectedMap := make(map[string]any)
expectedMap["1"] = []any{map[string]any{"end-key": "", "start-key": ""}}
tu.Eventually(re, func() bool {
Expand Down Expand Up @@ -478,14 +478,14 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
// Test the scheduler config handler.
extraTestFunc: func(name string) {
resp := make(map[string]any)
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
tu.Eventually(re, func() bool {
re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp))
return resp["start-key"] == "" && resp["end-key"] == "" && resp["range-name"] == "test"
})
resp["start-key"] = "a_00"
resp["end-key"] = "a_99"
updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name)
updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name)
body, err := json.Marshal(resp)
re.NoError(err)
re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re)))
Expand All @@ -503,7 +503,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
// Test the scheduler config handler.
extraTestFunc: func(name string) {
resp := make(map[string]any)
listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name)
expectedMap := make(map[string]any)
expectedMap["3"] = []any{map[string]any{"end-key": "", "start-key": ""}}
tu.Eventually(re, func() bool {
Expand Down

0 comments on commit 2b6fb72

Please sign in to comment.