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

server: balance by namespace. #754

Merged
merged 5 commits into from Sep 15, 2017

Conversation

Projects
None yet
6 participants
@disksing
Member

disksing commented Sep 15, 2017

refer #742

Show outdated Hide outdated server/namespace/classifer.go
Show outdated Hide outdated server/namespace_cluster.go

disksing added some commits Sep 15, 2017

@dantin

This comment has been minimized.

Show comment
Hide comment
@dantin

dantin Sep 15, 2017

Collaborator

LGTM

Collaborator

dantin commented Sep 15, 2017

LGTM

// DefaultNamespace.
var DefaultClassifer = defaultClassifer{}
var DefaultClassifier = defaultClassifier{}

This comment has been minimized.

@ming-relax

ming-relax Sep 15, 2017

Collaborator

Just want to make sure we are on the same page here:

My understanding here is that, we need to define another function

func CreateClassifier(*RaftCluster) Classifer {
  // Look into the name space configuration set by API, if there is a valid one, then return a 
  // classifier that implements the Classifier interface.
  // Otherwise, return the DefaultClassifier
}

And your cooridnator will use CreateClassifier(*RaftCluster) function instead of the DefaultClassifier.

When we add a namespace via the API, we need also to update the classifier in schedulerController.

@ming-relax

ming-relax Sep 15, 2017

Collaborator

Just want to make sure we are on the same page here:

My understanding here is that, we need to define another function

func CreateClassifier(*RaftCluster) Classifer {
  // Look into the name space configuration set by API, if there is a valid one, then return a 
  // classifier that implements the Classifier interface.
  // Otherwise, return the DefaultClassifier
}

And your cooridnator will use CreateClassifier(*RaftCluster) function instead of the DefaultClassifier.

When we add a namespace via the API, we need also to update the classifier in schedulerController.

This comment has been minimized.

@siddontang

siddontang Sep 15, 2017

Member

I think we can use a register mechanism.

@siddontang

siddontang Sep 15, 2017

Member

I think we can use a register mechanism.

This comment has been minimized.

@disksing

disksing Sep 15, 2017

Member

The GetClassifier function is supposed to be in package server, maybe as a method of RaftCluster. The RaftCluster can create a classifier based on config, then use it to create a coordinator instance.

@disksing

disksing Sep 15, 2017

Member

The GetClassifier function is supposed to be in package server, maybe as a method of RaftCluster. The RaftCluster can create a classifier based on config, then use it to create a coordinator instance.

This comment has been minimized.

@ming-relax
@ming-relax
@ming-relax

This comment has been minimized.

Show comment
Hide comment
@ming-relax

ming-relax Sep 15, 2017

Collaborator

LGTM

Collaborator

ming-relax commented Sep 15, 2017

LGTM

@disksing

This comment has been minimized.

Show comment
Hide comment
@disksing
Member

disksing commented Sep 15, 2017

/cc @nolouch

@nolouch

nolouch approved these changes Sep 15, 2017 edited

LGTM

allStats := c.Cluster.RegionWriteStats()
stats := make([]*core.RegionStat, 0, len(allStats))
for _, s := range allStats {
if c.GetRegion(s.RegionID) != nil {

This comment has been minimized.

@nolouch

nolouch Sep 15, 2017

Member

should also check region

@nolouch

nolouch Sep 15, 2017

Member

should also check region

This comment has been minimized.

@disksing

disksing Sep 15, 2017

Member

GetRegion checks namespace inside.

@disksing

disksing Sep 15, 2017

Member

GetRegion checks namespace inside.

This comment has been minimized.

@nolouch

nolouch Sep 15, 2017

Member

got it

@nolouch

nolouch Sep 15, 2017

Member

got it

@disksing disksing merged commit aabbff0 into namespace Sep 15, 2017

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
jenkins-ci-pd/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@disksing disksing deleted the disksing/cluster branch Sep 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment