-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify scheduler codes #62
Simplify scheduler codes #62
Conversation
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
|
||
// GenRangeCluster gets a range cluster by specifying start key and end key. | ||
// The cluster can only know the regions within [startKey, endKey]. | ||
func GenRangeCluster(cluster opt.Cluster, startKey, endKey []byte) *RangeCluster { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove RangeCluster
totally?
// balanceLeaderRetryLimit is the limit to retry schedule for selected source store and target store. | ||
const balanceLeaderRetryLimit = 10 | ||
|
||
type balanceLeaderScheduler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep balanceLeaderScheduler
though it's not included in the course outline.
scheduler/server/server.go
Outdated
@@ -556,76 +536,17 @@ func (s *Server) SetReplicationConfig(cfg config.ReplicationConfig) error { | |||
func (s *Server) SetPDServerConfig(cfg config.PDServerConfig) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these API too, we don't need to change configs dynamically.
scheduler/server/server.go
Outdated
func (s *Server) GetLabelProperty() config.LabelPropertyConfig { | ||
return s.scheduleOpt.LoadLabelPropertyConfig().Clone() | ||
} | ||
|
||
// SetClusterVersion sets the version of cluster. | ||
func (s *Server) SetClusterVersion(v string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clean all things related with cluster version
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
b67ab83
to
04b1642
Compare
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
8d2d722
to
39b095c
Compare
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
scheduler/server/cluster_test.go
Outdated
@@ -1143,34 +1068,6 @@ func (s *testClusterInfoSuite) TestRegionHeartbeat(c *C) { | |||
} | |||
} | |||
|
|||
func heartbeatRegions(c *C, cluster *RaftCluster, regions []*core.RegionInfo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this?
@@ -90,42 +88,3 @@ func (s *testClusterWorkerSuite) TestValidRequestRegion(c *C) { | |||
c.Assert(cluster.validRequestRegion(r5), IsNil) | |||
cluster.stop() | |||
} | |||
|
|||
func (s *testClusterWorkerSuite) TestAskSplit(c *C) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! forget to restore it.
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
scheduler/server/config/config.go
Outdated
@@ -419,6 +419,8 @@ func (c *Config) configFromFile(path string) (*toml.MetaData, error) { | |||
|
|||
// ScheduleConfig is the schedule configuration. | |||
type ScheduleConfig struct { | |||
// SplitMergeInterval is the minimum interval time to permit merge after split. | |||
SplitMergeInterval typeutil.Duration `toml:"split-merge-interval,omitempty" json:"split-merge-interval"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be deleted
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* remove persistent config Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove label property Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove label & location related score Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove unused codes Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove leveldb_kv Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove snapshotcount filter and peer count filter Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove unused code Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove unused cache Signed-off-by: Yang Keao <keao.yang@yahoo.com> * change Schedule function signature Signed-off-by: Yang Keao <keao.yang@yahoo.com> * simplify balance region source calc Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove unused code Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove dynamic config setting Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove push driver Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove range_cluster Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove cluster_version Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove unused function and variable Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove unused config Signed-off-by: Yang Keao <keao.yang@yahoo.com> * format Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove unused functions Signed-off-by: Yang Keao <keao.yang@yahoo.com> * restore some tests Signed-off-by: Yang Keao <keao.yang@yahoo.com> * format Signed-off-by: Yang Keao <keao.yang@yahoo.com> * remove SplitMergeInterval Signed-off-by: Yang Keao <keao.yang@yahoo.com>
leveldb_kv
And fix related tests.