exceptionfactory commented on a change in pull request #5390:
URL: https://github.com/apache/nifi/pull/5390#discussion_r708608680



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/leader/election/CuratorLeaderElectionManager.java
##########
@@ -64,10 +64,10 @@
 
     private volatile boolean stopped = true;
 
-    private final Map<String, LeaderRole> leaderRoles = new HashMap<>();
-    private final Map<String, RegisteredRole> registeredRoles = new 
HashMap<>();
+    private final ConcurrentMap<String, LeaderRole> leaderRoles = new 
ConcurrentHashMap<>();
+    private final ConcurrentMap<String, RegisteredRole> registeredRoles = new 
ConcurrentHashMap<>();
 
-    private final Map<String, TimedBuffer<TimestampedLong>> leaderChanges = 
new HashMap<>();
+    private final ConcurrentMap<String, TimedBuffer<TimestampedLong>> 
leaderChanges = new ConcurrentHashMap<>();

Review comment:
       Access to these Maps does not appear to have changed, so it is necessary 
to change the property type from `Map` to `ConcurrentMap`, or would it be 
sufficient to just change the implementation from `HashMap` to 
`ConcurrentHashMap`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to