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

avoid resize #5009

Merged
merged 2 commits into from
Sep 9, 2019
Merged

avoid resize #5009

merged 2 commits into from
Sep 9, 2019

Conversation

fanghuabing
Copy link
Contributor

The threshold of an HashMap is the product of current capacity and load factor.

Threshold = (Current Capacity) * (Load Factor)

For example, if the HashMap is created with initial capacity of 16 and load factor of 0.75f, then threshold will be,

Threshold = 16 * 0.75 = 12

That means, the capacity of the HashMap is increased from 16 to 32 after the 12th element (key-value pair) is added into the HashMap.

Copy link

@Moriadry-zz Moriadry-zz left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you for your contribution! :)

@codecov-io
Copy link

codecov-io commented Sep 5, 2019

Codecov Report

Merging #5009 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5009      +/-   ##
============================================
+ Coverage     63.89%   63.93%   +0.04%     
- Complexity      450      451       +1     
============================================
  Files           769      769              
  Lines         33176    33176              
  Branches       5216     5230      +14     
============================================
+ Hits          21197    21212      +15     
+ Misses         9547     9537      -10     
+ Partials       2432     2427       -5
Impacted Files Coverage Δ Complexity Δ
...java/org/apache/dubbo/common/utils/ClassUtils.java 71.13% <100%> (ø) 0 <0> (ø) ⬇️
.../apache/dubbo/qos/protocol/QosProtocolWrapper.java 70.73% <0%> (-12.2%) 0% <0%> (ø)
.../dubbo/remoting/transport/netty4/NettyChannel.java 60.22% <0%> (-3.41%) 0% <0%> (ø)
...che/dubbo/common/compiler/support/JdkCompiler.java 64.54% <0%> (ø) 0% <0%> (ø) ⬇️
...org/apache/dubbo/registry/redis/RedisRegistry.java 48.15% <0%> (+0.28%) 31% <0%> (ø) ⬇️
.../java/org/apache/dubbo/config/ReferenceConfig.java 60.94% <0%> (+0.36%) 0% <0%> (ø) ⬇️
...org/apache/dubbo/config/context/ConfigManager.java 66.66% <0%> (+0.79%) 0% <0%> (ø) ⬇️
...dubbo/remoting/exchange/support/DefaultFuture.java 93.75% <0%> (+1.04%) 0% <0%> (ø) ⬇️
...ache/dubbo/common/compiler/support/ClassUtils.java 50.26% <0%> (+1.04%) 0% <0%> (ø) ⬇️
...e/dubbo/remoting/transport/netty/NettyChannel.java 60.22% <0%> (+1.13%) 21% <0%> (+1%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 101c5ec...7a6a1c7. Read the comment docs.

@apache apache deleted a comment from CLAassistant Sep 8, 2019
@htynkn htynkn merged commit 8b1f60a into apache:master Sep 9, 2019
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.

4 participants