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

optimize: replace Random by ThreadLocalRandom in RandomLoadBalance #2573

Merged
merged 5 commits into from
Apr 23, 2020

Conversation

horoc
Copy link
Member

@horoc horoc commented Apr 19, 2020

ThreadLocalRandom will achieve less contention.
Replace Random by ThreadLocalRandom in RandomLoadBalance,refer to the implement of RandomLoadBalance in dubbo.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

test case LoadBalanceTest already exist.

Ⅳ. Describe how to verify it

test case LoadBalanceTest already exist.

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Apr 19, 2020

Codecov Report

Merging #2573 into develop will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2573   +/-   ##
==========================================
  Coverage      51.03%   51.04%           
- Complexity      2804     2806    +2     
==========================================
  Files            554      554           
  Lines          17756    17755    -1     
  Branches        2062     2062           
==========================================
+ Hits            9062     9063    +1     
  Misses          7812     7812           
+ Partials         882      880    -2     
Impacted Files Coverage Δ Complexity Δ
...seata/discovery/loadbalance/RandomLoadBalance.java 100.00% <100.00%> (ø) 2.00 <0.00> (ø)
...in/java/io/seata/server/session/GlobalSession.java 84.72% <0.00%> (+0.46%) 72.00% <0.00%> (+1.00%)
...o/seata/server/coordinator/DefaultCoordinator.java 55.15% <0.00%> (+0.51%) 29.00% <0.00%> (+1.00%)

@funky-eyes
Copy link
Contributor

please help to see if other classes need to be processed

@horoc
Copy link
Member Author

horoc commented Apr 19, 2020

please help to see if other classes need to be processed

Already checked, no more classes need to be processed.

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@xingfudeshi xingfudeshi added the first-time contributor first-time contributor label Apr 20, 2020
Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@zjinlei zjinlei added this to the 1.3.0 milestone Apr 21, 2020
@funky-eyes
Copy link
Contributor

please try again for ci @slievrly

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@l81893521 l81893521 merged commit ad40b6e into apache:develop Apr 23, 2020
xiaowan pushed a commit to xiaowan/seata that referenced this pull request Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants