Skip to content

Commit

Permalink
*: decouple operator handler and server
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Sep 13, 2023
1 parent b8d9c6e commit 9e41039
Show file tree
Hide file tree
Showing 11 changed files with 588 additions and 531 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ require (
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/petermattis/goid v0.0.0-20211229010228-4d14c490ee36 // indirect
github.com/pingcap/tipb v0.0.0-20220718022156-3e2483c20a9e // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand Down
42 changes: 42 additions & 0 deletions pkg/errs/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2023 TiKV Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package errs

import "github.com/pingcap/errors"

var (
// ErrOperatorNotFound is error info for operator not found.
ErrOperatorNotFound = errors.New("operator not found")
// ErrAddOperator is error info for already have an operator when adding operator.
ErrAddOperator = errors.New("failed to add operator, maybe already have one")
// ErrRegionNotAdjacent is error info for region not adjacent.
ErrRegionNotAdjacent = errors.New("two regions are not adjacent")
// ErrRegionNotFound is error info for region not found.
ErrRegionNotFound = func(regionID uint64) error {
return errors.Errorf("region %v not found", regionID)
}
// ErrRegionAbnormalPeer is error info for region has abnormal peer.
ErrRegionAbnormalPeer = func(regionID uint64) error {
return errors.Errorf("region %v has abnormal peer", regionID)
}
// ErrStoreNotFoundByID is error info for store not found.
ErrStoreNotFoundByID = func(storeID uint64) error {
return errors.Errorf("store %v not found", storeID)
}
// ErrPluginNotFound is error info for plugin not found.
ErrPluginNotFound = func(pluginPath string) error {
return errors.Errorf("plugin is not found: %s", pluginPath)
}
)
Loading

0 comments on commit 9e41039

Please sign in to comment.