Skip to content
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

*: balance based on read flow #708

Merged
merged 15 commits into from Sep 12, 2017
Merged

*: balance based on read flow #708

merged 15 commits into from Sep 12, 2017

Conversation

UncP
Copy link
Contributor

@UncP UncP commented Aug 17, 2017

No description provided.

@CLAassistant
Copy link

CLAassistant commented Aug 17, 2017

CLA assistant check
All committers have signed the CLA.

Signed-off-by: UncP <uncp.xu@gmail.com>
@UncP UncP changed the title update kvproto [WIP]balance based on read flow Aug 17, 2017
Signed-off-by: UncP <uncp.xu@gmail.com>
Signed-off-by: UncP <uncp.xu@gmail.com>
Signed-off-by: UncP <uncp.xu@gmail.com>
Signed-off-by: UncP <uncp.xu@gmail.com>
hotRegionsPrefix = "pd/api/v1/hotspot/regions"
hotStoresPrefix = "pd/api/v1/hotspot/stores"
hotRegionsPrefix = "pd/api/v1/hotspot/regions"
hotReadRegionsPrefix = "pd/api/v1/hotspot/readregions"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe regions/write and regions/read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"pd/api/v1/hotspot/regions"

this is for write, maybe

"pd/api/v1/hotspot/read"

this is for read ?

regionInfo := cluster.getRegion(r.RegionID)
leaderStoreID := regionInfo.Leader.GetStoreId()
storeIDs := regionInfo.GetStoreIds()
for storeID := range storeIDs {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need the loop. We can update leaderStoreID directly.

@nolouch nolouch changed the title [WIP]balance based on read flow *: balance based on read flow Sep 12, 2017
@nolouch
Copy link
Contributor

nolouch commented Sep 12, 2017

@nolouch
Copy link
Contributor

nolouch commented Sep 12, 2017

/run-full-test

Copy link
Contributor

@disksing disksing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the rest LGTM.

server/cache.go Outdated
}

func newClusterInfo(id IDAllocator) *clusterInfo {
return &clusterInfo{
id: id,
stores: newStoresInfo(),
regions: newRegionsInfo(),
readStatistics: cache.NewDefaultCache(writeStatCacheMaxLen),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename writeStatCacheMaxLen to a better one.

@disksing
Copy link
Contributor

LGTM. PTAL @zhangjinpeng1987 @overvenus

@zhangjinpeng87
Copy link
Member

LGTM

@zhangjinpeng87 zhangjinpeng87 merged commit bcd5c8f into master Sep 12, 2017
@sre-bot sre-bot added the contribution Indicates that the PR was contributed by an external member. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Indicates that the PR was contributed by an external member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants