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

[ISSUE-378][HugePartition][Part-1] Record every partition data size for one app #458

Merged
merged 2 commits into from
Jan 6, 2023

Conversation

zuston
Copy link
Member

@zuston zuston commented Jan 6, 2023

What changes were proposed in this pull request?

Record every partition data size for one app

Why are the changes needed?

This is a subtask for #378

Does this PR introduce any user-facing change?

No

How was this patch tested?

  1. UTs

@zuston zuston requested a review from jerqi January 6, 2023 11:30
/**
* shuffleId -> partitionId -> partition shuffle data size
*/
private Map<Integer, Map<Integer, Long>> partitionDataSizes;
Copy link
Contributor

Choose a reason for hiding this comment

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

AtomicLong?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will be added by the ConcurrentHashMap.computeIfPresent, this is a thread safe operation. Right?

Copy link
Contributor

Choose a reason for hiding this comment

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

What will it happen if two threads add the same partition?

Copy link
Member Author

Choose a reason for hiding this comment

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

This will guarded by computeIfPresent to keep thread safe when having multiple threads.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can see the code of computeIfpresent. computeIfpresent don't guard the atomicity. Only the one partition will be added.

Copy link
Member Author

@zuston zuston Jan 6, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, my mistake. I just see the default method of Map.

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2023

Codecov Report

Merging #458 (8f4d52b) into master (2b756c3) will increase coverage by 0.07%.
The diff coverage is 86.95%.

@@             Coverage Diff              @@
##             master     #458      +/-   ##
============================================
+ Coverage     58.67%   58.74%   +0.07%     
- Complexity     1655     1664       +9     
============================================
  Files           199      199              
  Lines         11214    11236      +22     
  Branches        997      999       +2     
============================================
+ Hits           6580     6601      +21     
- Misses         4242     4243       +1     
  Partials        392      392              
Impacted Files Coverage Δ
...pache/uniffle/server/ShuffleServerGrpcService.java 0.80% <0.00%> (ø)
...ava/org/apache/uniffle/server/ShuffleTaskInfo.java 94.44% <87.50%> (-5.56%) ⬇️
.../org/apache/uniffle/server/ShuffleTaskManager.java 76.34% <100.00%> (+0.45%) ⬆️
.../uniffle/server/storage/StorageManagerFactory.java 75.00% <0.00%> (+8.33%) ⬆️

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

Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @zuston

@jerqi
Copy link
Contributor

jerqi commented Jan 6, 2023

Could you modify the title? What's n?

@zuston
Copy link
Member Author

zuston commented Jan 6, 2023

Could you modify the title? What's n?

n means several subtasks. In the next PR, it will named as 2/n.

@jerqi
Copy link
Contributor

jerqi commented Jan 6, 2023

Could you modify the title? What's n?

n means several subtasks. In the next PR, it will named as 2/n.

So n is 3 or 4? If we can't ensure what n is. Could we use [Part-1] directly?

@zuston
Copy link
Member Author

zuston commented Jan 6, 2023

Could you modify the title? What's n?

n means several subtasks. In the next PR, it will named as 2/n.

So n is 3 or 4? If we can't ensure what n is. Could we use [Part-1] directly?

Yes. It' OK for me. Could you help modify the title?

@jerqi jerqi changed the title [ISSUE-378][HugePartition][1/n] Record every partition data size for one app [ISSUE-378][HugePartition][Part-1] Record every partition data size for one app Jan 6, 2023
@jerqi
Copy link
Contributor

jerqi commented Jan 6, 2023

Could you modify the title? What's n?

n means several subtasks. In the next PR, it will named as 2/n.

So n is 3 or 4? If we can't ensure what n is. Could we use [Part-1] directly?

Yes. It' OK for me. Could you help modify the title?

OK.

@zuston zuston merged commit ebaff6a into apache:master Jan 6, 2023
@zuston
Copy link
Member Author

zuston commented Jan 6, 2023

Thanks @jerqi

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.

None yet

3 participants