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

namespace isolation: http interface and classifier #747

Merged
merged 23 commits into from Sep 25, 2017

Conversation

Projects
None yet
7 participants
@dantin
Collaborator

dantin commented Sep 12, 2017

  • Configure namespace related info through pd-ctl/api
  • Add table_namespace_classifier to return namespace name for region/store based on the namespace configuration
@sre-bot

This comment has been minimized.

Show comment
Hide comment
@sre-bot

sre-bot Sep 12, 2017

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

sre-bot commented Sep 12, 2017

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

dantin added some commits Sep 12, 2017

@dantin dantin changed the title from [WIP] resource isolation to namespace isolation: http interface demo Sep 15, 2017

dantin added some commits Sep 15, 2017

@dantin dantin requested review from nolouch and disksing Sep 18, 2017

@ming-relax ming-relax changed the title from namespace isolation: http interface demo to namespace isolation: http interface and classifier Sep 19, 2017

Show outdated Hide outdated pdctl/command/namespace_command.go Outdated
Show outdated Hide outdated pdctl/command/namespace_command.go Outdated
Show outdated Hide outdated pdctl/command/namespace_command.go Outdated
Show outdated Hide outdated server/api/namespace.go Outdated
Show outdated Hide outdated server/api/namespace.go Outdated
Show outdated Hide outdated server/table_namespace_classifier_test.go Outdated
Show outdated Hide outdated server/table_namespace_classifier.go Outdated
Show outdated Hide outdated server/table_namespace_classifier.go Outdated
Show outdated Hide outdated server/core/tablecodec.go Outdated
Show outdated Hide outdated server/core/namespaces.go Outdated
// 1. relation between a Name and several tables
// 2. relation between a Name and several stores
// It is used to bind tables with stores
type Namespace struct {

This comment has been minimized.

@siddontang

siddontang Sep 20, 2017

Member

Seem it is TableNamespace, not a Namespace.

@siddontang

siddontang Sep 20, 2017

Member

Seem it is TableNamespace, not a Namespace.

This comment has been minimized.

@ming-relax

ming-relax Sep 21, 2017

Collaborator

Will there be other namespace? How about change table_namespace_classifier.go to namespace_classifier.go?

@ming-relax

ming-relax Sep 21, 2017

Collaborator

Will there be other namespace? How about change table_namespace_classifier.go to namespace_classifier.go?

This comment has been minimized.

@siddontang

siddontang Sep 21, 2017

Member

We may have other namespace implementation later. So we can't assume there is only one table namespace.

@siddontang

siddontang Sep 21, 2017

Member

We may have other namespace implementation later. So we can't assume there is only one table namespace.

}
}
func (c tableNamespaceClassifier) GetAllNamespaces() []string {

This comment has been minimized.

@siddontang

siddontang Sep 20, 2017

Member

Will we call this function frequently?
/cc @disksing

@siddontang

siddontang Sep 20, 2017

Member

Will we call this function frequently?
/cc @disksing

This comment has been minimized.

@disksing

disksing Sep 20, 2017

Member

Now it is called every time we call scheduler.Schedule().

@disksing

disksing Sep 20, 2017

Member

Now it is called every time we call scheduler.Schedule().

This comment has been minimized.

@siddontang

siddontang Sep 21, 2017

Member

Seem this is not effective.

@siddontang

siddontang Sep 21, 2017

Member

Seem this is not effective.

type defaultTableIDDecoder struct{}
var tablePrefix = []byte{'t'}

This comment has been minimized.

@siddontang

siddontang Sep 20, 2017

Member

seem we should also consider table index.

@disksing

@siddontang

siddontang Sep 20, 2017

Member

seem we should also consider table index.

@disksing

This comment has been minimized.

@disksing

disksing Sep 20, 2017

Member

Just table prefix is ok. We have no plan to separate rows and indexes into different namespaces.

@disksing

disksing Sep 20, 2017

Member

Just table prefix is ok. We have no plan to separate rows and indexes into different namespaces.

dantin and others added some commits Sep 20, 2017

new GetRegionNamespace (#766)
* new GetRegionNamespace Method, checking both StartKey and EndKey

* go fmt server/table_namespace_classifier.go

* go fmt server/core/tablecodec.go
@disksing

This comment has been minimized.

Show comment
Hide comment
@disksing

disksing Sep 25, 2017

Member

LGTM.

Member

disksing commented Sep 25, 2017

LGTM.

@disksing

This comment has been minimized.

Show comment
Hide comment
@disksing
Member

disksing commented Sep 25, 2017

@nolouch

LGTM

@disksing disksing merged commit d5f6a6f into namespace Sep 25, 2017

4 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr 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 dantin/namespace branch Sep 25, 2017

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