You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/12/19 18:04:34 UTC

[GitHub] keith-turner commented on a change in pull request #841: Refactored SiteConfiguration

keith-turner commented on a change in pull request #841: Refactored SiteConfiguration
URL: https://github.com/apache/accumulo/pull/841#discussion_r243018723
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
 ##########
 @@ -315,6 +224,6 @@ public void set(Property property, String value) {
    *          property value
    */
   public void set(String key, String value) {
-    getConfiguration().setProperty(key, value);
+    config.put(key, value);
 
 Review comment:
   This is not thread safe.  One possible strategy would be to have a volatile pointer to an immutable map.  This method could always rebuild the map and then set the pointer.  This is an inefficient implementation for this method.  However, I am assuming this method is only used by test and does not need to be efficient.  This approach allows the normal/non-test use to be very efficient and avoid synchronization, while still keeping things sane for multiple threads in test.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services