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

[Refactor] Make coordinator class more organized #386

Merged
merged 12 commits into from
Dec 6, 2022

Conversation

smallzhongfeng
Copy link
Contributor

What changes were proposed in this pull request?

Split coordinator class into different folders by their correlation.

Why are the changes needed?

To resolve #384

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Origin tests.

@jerqi jerqi requested a review from zuston December 4, 2022 11:25
@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2022

Codecov Report

Merging #386 (3312b73) into master (9a552b4) will decrease coverage by 0.01%.
The diff coverage is 83.33%.

@@             Coverage Diff              @@
##             master     #386      +/-   ##
============================================
- Coverage     58.63%   58.62%   -0.02%     
  Complexity     1590     1590              
============================================
  Files           193      193              
  Lines         10920    10921       +1     
  Branches        958      958              
============================================
- Hits           6403     6402       -1     
- Misses         4138     4139       +1     
- Partials        379      380       +1     
Impacted Files Coverage Δ
.../org/apache/uniffle/coordinator/AccessManager.java 94.28% <ø> (ø)
.../apache/uniffle/coordinator/CoordinatorServer.java 65.26% <ø> (ø)
...ava/org/apache/uniffle/coordinator/ServerNode.java 83.78% <ø> (ø)
...ache/uniffle/coordinator/SimpleClusterManager.java 86.82% <ø> (ø)
.../uniffle/coordinator/access/AccessCheckResult.java 92.30% <ø> (ø)
.../apache/uniffle/coordinator/access/AccessInfo.java 92.30% <ø> (ø)
...rdinator/access/checker/AbstractAccessChecker.java 100.00% <ø> (ø)
...inator/access/checker/AccessCandidatesChecker.java 85.50% <ø> (ø)
...nator/access/checker/AccessClusterLoadChecker.java 96.96% <ø> (ø)
...coordinator/access/checker/AccessQuotaChecker.java 94.73% <ø> (ø)
... and 21 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@smallzhongfeng
Copy link
Contributor Author

smallzhongfeng commented Dec 4, 2022

Error:  High: org.apache.uniffle.coordinator.ApplicationManager.REMOTE_PATH_SCHEMA is a mutable collection [org.apache.uniffle.coordinator.ApplicationManager] At ApplicationManager.java:[line 53] MS_MUTABLE_COLLECTION

Waht could I resolve this? I haven't met before. @zuston

@zuston
Copy link
Member

zuston commented Dec 5, 2022

Error:  High: org.apache.uniffle.coordinator.ApplicationManager.REMOTE_PATH_SCHEMA is a mutable collection [org.apache.uniffle.coordinator.ApplicationManager] At ApplicationManager.java:[line 53] MS_MUTABLE_COLLECTION

Waht could I resolve this? I haven't met before. @zuston

Make it final?

@zuston
Copy link
Member

zuston commented Dec 5, 2022

  1. Should we put checker and access folders together? Because they are related.
  2. Another concern is the package renaming, which will make this PR incompatible with original config, like ‘org.apache.uniffle.coordinator.checker.AccessClusterLoadChecker’. Further more, I suggest that we'd better not to use the package name as the config of strategy in the future @jerqi Do you think so?

@jerqi
Copy link
Contributor

jerqi commented Dec 5, 2022

  1. Should we put checker and access folders together? Because they are related.
  2. Another concern is the package renaming, which will make this PR incompatible with original config, like ‘org.apache.uniffle.coordinator.checker.AccessClusterLoadChecker’. Further more, I suggest that we'd better not to use the package name as the config of strategy in the future @jerqi Do you think so?
  1. move checker directory to access directory?
  2. Em..it's ok for me actually. We can add a document to explain how migrate to higher version if we make some imcompatible changes. Or we add short name for some configs. Or we introduce the deprecated configuration option.

@zuston
Copy link
Member

zuston commented Dec 5, 2022

+1. Short name or concrete strategy name will be better.

@jerqi
Copy link
Contributor

jerqi commented Dec 5, 2022

+1. Short name or concrete strategy name will be better.

If we use short name, this pr will also be imcompatible change.

@zuston
Copy link
Member

zuston commented Dec 5, 2022

+1. Short name or concrete strategy name will be better.

If we use short name, this pr will also be incompatible change.

Yes. The refactor process will always make incompatible change. I think it could be optimized in later PRs, currently the strategies are bound to package name, it looks unreasonable.

We should reach a consensus that this way is no longer supported for new PRs. Do you think so?

By the way, I just think more when reviewing this PR.

@jerqi
Copy link
Contributor

jerqi commented Dec 5, 2022

+1. Short name or concrete strategy name will be better.

If we use short name, this pr will also be incompatible change.

Yes. The refactor process will always make incompatible change. I think it could be optimized in later PRs, currently the strategies are bound to package name, it looks unreasonable.

We should reach a consensus that this way is no longer supported for new PRs. Do you think so?

By the way, I just think more when reviewing this PR.

I'm ok for that it is bound to package. Other systems have also similar style.

@kaijchen
Copy link
Contributor

kaijchen commented Dec 5, 2022

@smallzhongfeng is this a refactor? If so, please change [Improvement] to [Refactor] in title.

@smallzhongfeng
Copy link
Contributor Author

Yes. The refactor process will always make incompatible change. I think it could be optimized in later PRs, currently the strategies are bound to package name, it looks unreasonable.

We should reach a consensus that this way is no longer supported for new PRs. Do you think so?

By the way, I just think more when reviewing this PR.

I make it final, but it doesn't work.

@smallzhongfeng
Copy link
Contributor Author

  • move checker directory to access directory?
  • Em..it's ok for me actually. We can add a document to explain how migrate to higher version if we make some imcompatible changes. Or we add short name for some configs. Or we introduce the deprecated configuration option.
  1. I will move it.
  2. What should I do? Do I need to add a migration document?

@smallzhongfeng
Copy link
Contributor Author

@smallzhongfeng is this a refactor? If so, please change [Improvement] to [Refactor] in title.

I think so. @jerqi @zuston WDYT?

@jerqi
Copy link
Contributor

jerqi commented Dec 5, 2022

  • move checker directory to access directory?
  • Em..it's ok for me actually. We can add a document to explain how migrate to higher version if we make some imcompatible changes. Or we add short name for some configs. Or we introduce the deprecated configuration option.
  1. I will move it.
  2. What should I do? Do I need to add a migration document?
  1. Yes, if you have imcompatible feature, you should add migration document, you can refer to https://github.com/apache/spark/blob/master/docs/core-migration-guide.md

@smallzhongfeng
Copy link
Contributor Author

Error:  High: org.apache.uniffle.coordinator.ApplicationManager.REMOTE_PATH_SCHEMA is a mutable collection [org.apache.uniffle.coordinator.ApplicationManager] At ApplicationManager.java:[line 53] MS_MUTABLE_COLLECTION

Waht could I resolve this? I haven't met before. @zuston

What is the problem? I haven't met it before.@jerqi

@jerqi
Copy link
Contributor

jerqi commented Dec 5, 2022

@@ -0,0 +1,25 @@
---
layout: page
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel that it's enough to have an entire document. We don't need to separate it into modules, such as coordinator, server, client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's ok for me, updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

The file name is still coordinator-migration-guide.md.

smallzhongfeng added 2 commits December 6, 2022 01:08
@jerqi jerqi changed the title [Improvement] Make coordinator class more organized [Refactor] Make coordinator class more organized Dec 6, 2022
@jerqi
Copy link
Contributor

jerqi commented Dec 6, 2022

LGTM, @zuston Do you have another suggestion? Let @zuston approve and merge this pr.

Copy link
Member

@zuston zuston left a comment

Choose a reason for hiding this comment

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

LGTM

@zuston zuston merged commit 8847ece into apache:master Dec 6, 2022
@zuston
Copy link
Member

zuston commented Dec 6, 2022

Thanks @jerqi @smallzhongfeng Merged.

@smallzhongfeng
Copy link
Contributor Author

Belated thanks. @jerqi @zuston

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.

[Improvement] Make coordinator class more organized
5 participants