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

[#678] improvement: Write hdfs files asynchronously when detectStorage #680

Merged
merged 18 commits into from
Mar 6, 2023

Conversation

smallzhongfeng
Copy link
Contributor

@smallzhongfeng smallzhongfeng commented Mar 3, 2023

What changes were proposed in this pull request?

Write files to hdfs asynchronously and reduce the time of detectStorage

Why are the changes needed?

Fix: #678

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Origin uts.

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2023

Codecov Report

Merging #680 (8bb7310) into master (313ddd6) will increase coverage by 2.24%.
The diff coverage is 77.96%.

@@             Coverage Diff              @@
##             master     #680      +/-   ##
============================================
+ Coverage     60.79%   63.04%   +2.24%     
- Complexity     1839     1840       +1     
============================================
  Files           221      207      -14     
  Lines         12655    10677    -1978     
  Branches       1069     1064       -5     
============================================
- Hits           7694     6731     -963     
+ Misses         4553     3600     -953     
+ Partials        408      346      -62     
Impacted Files Coverage Δ
...ategy/storage/AppBalanceSelectStorageStrategy.java 70.00% <ø> (-2.00%) ⬇️
...trategy/storage/AbstractSelectStorageStrategy.java 60.56% <76.00%> (+33.29%) ⬆️
...orage/LowestIOSampleCostSelectStorageStrategy.java 72.72% <88.88%> (+1.81%) ⬆️
...tor/pkg/controller/sync/coordinator/coordinator.go
...oy/kubernetes/operator/pkg/controller/util/util.go
...eploy/kubernetes/operator/pkg/utils/coordinator.go
...pkg/controller/sync/shuffleserver/shuffleserver.go
deploy/kubernetes/operator/pkg/utils/rss.go
...rnetes/operator/pkg/webhook/inspector/inspector.go
... and 8 more

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

@jerqi
Copy link
Contributor

jerqi commented Mar 3, 2023

We should avoid multple threads operate the same file.

@smallzhongfeng
Copy link
Contributor Author

We should avoid multple threads operate the same file.

It is the same file, but it is written to a different path.

@xianjingfeng
Copy link
Member

Maybe we should use CountdownLaunch + (parallelStream or thread pool).

@smallzhongfeng
Copy link
Contributor Author

This doesn't seem to be caused by this pr.

Errors: 
Error:    QuorumTest.case2:337->registerShuffleServer:281 » StatusRuntime DEADLINE_EXCEE...

@xianjingfeng
Copy link
Member

This doesn't seem to be caused by this pr.

Errors: 
Error:    QuorumTest.case2:337->registerShuffleServer:281 » StatusRuntime DEADLINE_EXCEE...

Same problem as #667 .

Copy link
Contributor

@advancedxy advancedxy left a comment

Choose a reason for hiding this comment

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

Generally LGTM

@@ -90,6 +91,7 @@ public void selectStorageTest() throws Exception {
assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());

// compare with two remote path
final Configuration configuration = new Configuration();
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems this line is not needed anymore?

I didn't see the var configuration is used in this method anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

* Different strategies will have different sorting methods of remote paths
* @return A comparator is to calculate the RankValue
*/
abstract Comparator<Map.Entry<String, RankValue>> getComparator();
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's make this method as

  protected Comparator<Map.Entry<String, RankValue>> getComparator() {
    return null;
  }

? So AppBalanceSelectorStorageStrategy doesn't need to override this.

smallzhongfeng added 2 commits March 6, 2023 16:24
@advancedxy advancedxy merged commit d140e4e into apache:master Mar 6, 2023
@smallzhongfeng
Copy link
Contributor Author

Thanks all! @advancedxy @xianjingfeng @jerqi

advancedxy pushed a commit to advancedxy/incubator-uniffle that referenced this pull request Mar 21, 2023
…tStorage` (apache#680)

### What changes were proposed in this pull request?
Write files to hdfs asynchronously and reduce the time of detectStorage

### Why are the changes needed?
Fix: apache#678 

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Origin uts.
xianjingfeng pushed a commit to xianjingfeng/incubator-uniffle that referenced this pull request Apr 5, 2023
…tStorage` (apache#680)

### What changes were proposed in this pull request?
Write files to hdfs asynchronously and reduce the time of detectStorage

### Why are the changes needed?
Fix: apache#678 

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Origin uts.
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] Write hdfs files asynchronously when detectStorage
5 participants