zhaijack commented on issue #414: Test failure in UpdateLedgerOpTest
URL: https://github.com/apache/bookkeeper/issues/414#issuecomment-321207830
 
 
   discussed this issue with @sijie on slack channel, and work together to 
figure out the reason. Thanks @sijie for the help.
   Here is how 
[CompositeConfiguration](https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/CompositeConfiguration.html)
 works: 
   ```
   CompositeConfiguration allows you to add multiple Configuration objects to 
an aggregated configuration. If you add Configuration1, and then 
Configuration2, any properties shared will mean that the value defined by 
Configuration1 will be returned. If Configuration1 doesn't have the property, 
then Configuration2 will be checked. You can add multiple different types or 
the same type of properties file.
   
   When querying properties the order in which child configurations have been 
added is relevant. To deal with property updates, a so-called in-memory 
configuration is used. Per default, such a configuration is created 
automatically. All property writes target this special configuration. There are 
constructors which allow you to provide a specific in-memory configuration. If 
used that way, the in-memory configuration is always the last one in the list 
of child configurations. This means that for query operations all other 
configurations take precedence.
   ```
   To achieve this goal, setProperty will first 
[clearProperty](https://github.com/apache/commons-configuration/blob/trunk/src/main/java/org/apache/commons/configuration2/CompositeConfiguration.java#L361)
 and then do addProperty.
   
   While in our use case:
   ServerConfiguration conf = new ServerConfiguration(baseConf); 
   conf.setAllowLoopback(true);  < == this will clear the value in baseConf 
first, and cause we get un-wanted value.
   
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to