gianm commented on a change in pull request #8908: fix sql compatible null
handling config work with runtime.properties
URL: https://github.com/apache/incubator-druid/pull/8908#discussion_r347962062
##########
File path: core/src/main/java/org/apache/druid/common/config/NullHandling.java
##########
@@ -50,16 +50,22 @@
* It does not take effect in all unit tests since we don't use Guice
Injection.
*/
@Inject
- private static NullValueHandlingConfig INSTANCE = new
NullValueHandlingConfig(
- Boolean.valueOf(System.getProperty(NULL_HANDLING_CONFIG_STRING, "true"))
- );
+ private static NullValueHandlingConfig INSTANCE;
+
+ private static volatile Boolean isReplaceWithDefault = null;
Review comment:
I'm not sure having a volatile static is a good idea for something that will
be used by multiple threads while processing every row. Your benchmark checked
single-threaded performance but this could degrade under multithreading.
Could you please either look into this, or do a hybrid of your last two
approaches (require explicit initialization in tests, of a non-volatile static,
and if-guard it in methods that use it).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]