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

Support keyLock in LockGroup #38

Merged
merged 3 commits into from
Sep 25, 2019
Merged

Support keyLock in LockGroup #38

merged 3 commits into from
Sep 25, 2019

Conversation

zhoney
Copy link
Contributor

@zhoney zhoney commented Sep 24, 2019

Change-Id: I9af3b76a264ddd061195997842e66a47df7c2fe9

@codecov
Copy link

codecov bot commented Sep 24, 2019

Codecov Report

Merging #38 into master will increase coverage by 1.35%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #38      +/-   ##
============================================
+ Coverage     76.68%   78.04%   +1.35%     
- Complexity      556      571      +15     
============================================
  Files            54       54              
  Lines          1814     1817       +3     
  Branches        268      268              
============================================
+ Hits           1391     1418      +27     
+ Misses          306      281      -25     
- Partials        117      118       +1
Impacted Files Coverage Δ Complexity Δ
...ava/com/baidu/hugegraph/version/CommonVersion.java 50% <ø> (ø) 1 <0> (ø) ⬇️
...java/com/baidu/hugegraph/concurrent/LockGroup.java 100% <100%> (+100%) 10 <2> (+10) ⬆️
...n/java/com/baidu/hugegraph/concurrent/KeyLock.java 11.36% <0%> (+11.36%) 3% <0%> (+3%) ⬆️
...ava/com/baidu/hugegraph/concurrent/AtomicLock.java 20% <0%> (+20%) 2% <0%> (+2%) ⬆️

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 0ff4b0e...b430807. Read the comment docs.

this.locksMap.putIfAbsent(lockName, new KeyLock());
}
return (KeyLock) this.locksMap.get(lockName);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

add test

Change-Id: I9af3b76a264ddd061195997842e66a47df7c2fe9
Lock lock = this.group.lock("lock");
Assert.assertTrue(lock instanceof ReentrantLock);
Lock lock1 = this.group.lock("lock");
Assert.assertTrue(lock == lock1);
Copy link
Contributor

Choose a reason for hiding this comment

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

assertSame

Change-Id: I1c43e69a33de74c98925fabbcb0d3b42e0ec7a29
Change-Id: I43360da8b4c701bf02d635a7270af96a433ca5c7
@Linary Linary merged commit 4eda631 into master Sep 25, 2019
@Linary Linary deleted the keylock branch September 25, 2019 13:17
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.

3 participants