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

Calculate chunkserver left space of each physical pool #199

Merged
merged 1 commit into from
Jan 13, 2021

Conversation

SeanHai
Copy link
Contributor

@SeanHai SeanHai commented Dec 25, 2020

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@SeanHai SeanHai force-pushed the curve_ops_tool branch 4 times, most recently from 80882cd to 755f8af Compare December 30, 2020 01:40
@@ -795,6 +795,34 @@ int MDSClient::ListServersInCluster(std::vector<ServerInfo>* servers) {
return 0;
}

int MDSClient::ListServersInCluster(std::unordered_map<PoolIdType,
Copy link
Contributor

Choose a reason for hiding this comment

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

不需要增加这个函数吧,上面的ListServerInCluster里面得出的ServerInfo里面有server所属的physicalPoolID,physicalPoolName字段,在外面解析即可

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不需要增加这个函数吧,上面的ListServerInCluster里面得出的ServerInfo里面有server所属的physicalPoolID,physicalPoolName字段,在外面解析即可

done

double var = sum / leftSize.second.size();
std:: cout.setf(std::ios::fixed);
std::cout<< std::setprecision(2);
std::cout<< name << leftSize.first;
Copy link
Contributor

Choose a reason for hiding this comment

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

这样打出来是chunkfilepool 1 left,非常不清晰。建议改成pool 1 chunkfilepool left,pool 2 chunkfilepool left这种。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这样打出来是chunkfilepool 1 left,非常不清晰。建议改成pool 1 chunkfilepool left,pool 2 chunkfilepool left这种。

done

@@ -812,6 +840,29 @@ int MDSClient::ListChunkServersInCluster(
return 0;
}

int MDSClient::ListChunkServersInCluster(std::unordered_map<PoolIdType,
Copy link
Contributor

Choose a reason for hiding this comment

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

这个函数可以这么写,但是上面那个ListServer的接口没必要加,直接用之前的ListServerInCluster也可以实现。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个函数可以这么写,但是上面那个ListServer的接口没必要加,直接用之前的ListServerInCluster也可以实现。

done

@SeanHai SeanHai force-pushed the curve_ops_tool branch 3 times, most recently from fa1a990 to 898514e Compare January 6, 2021 01:39
@@ -771,7 +771,7 @@ int MDSClient::GetCopySetsInCluster(std::vector<CopysetInfo>* copysets) {

int MDSClient::ListServersInCluster(std::vector<ServerInfo>* servers) {
assert(servers != nullptr);
// 先列出逻辑池
// 先列出物理池
Copy link
Contributor

Choose a reason for hiding this comment

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

英文表达

Copy link
Contributor Author

Choose a reason for hiding this comment

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

英文表达

done

std::vector<ChunkServerInfo>>* chunkservers) {
assert(chunkservers != nullptr);
std::vector<ServerInfo> servers;
if (ListServersInCluster(&servers) != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

没有直接listchunkserverinphysicalpool的接口吗?这个看起来很迂回

Copy link
Contributor Author

Choose a reason for hiding this comment

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

没有直接listchunkserverinphysicalpool的接口吗?这个看起来很迂回

没有,它是一层一层的, chunkserver->server->zone->physicalpool->cluster

@ilixiaocui ilixiaocui merged commit c2f5f4f into opencurve:master Jan 13, 2021
ilixiaocui pushed a commit to ilixiaocui/curve that referenced this pull request Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants