fix(pd): Ensure range attribute thread safety#2641
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2641 +/- ##
=============================================
- Coverage 45.35% 34.98% -10.37%
+ Complexity 496 383 -113
=============================================
Files 719 719
Lines 58465 58486 +21
Branches 7495 7495
=============================================
- Hits 26514 20464 -6050
- Misses 29230 35763 +6533
+ Partials 2721 2259 -462 ☔ View full report in Codecov by Sentry. |
| private Map<Integer, AtomicBoolean> state = new ConcurrentHashMap<>(); | ||
| private Map<Integer, Partition> partitions = new ConcurrentHashMap<>(); | ||
| private RangeMap<Long, Integer> range = TreeRangeMap.create(); | ||
| private RangeMap<Long, Integer> range = new SynchronizedRangeMap<Long, Integer>().rangeMap; |
| @@ -39,7 +41,7 @@ public class GraphCache { | |||
| private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); | |||
There was a problem hiding this comment.
@imbajin Can we improve and avoid this lombok.Data programming style in the future, which will cause internal members to be modified arbitrarily by external class?
|
Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label |
close #2634
Added a custom SynchronizedRangeMap that provides thread safe put/get and other methods to ensure thread safety of GraphCache range attr