laurentgo commented on a change in pull request #1207: [CALCITE-3062] Do not
populate provenanceMap if not debug
URL: https://github.com/apache/calcite/pull/1207#discussion_r284352662
##########
File path:
core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
##########
@@ -276,6 +276,9 @@ public VolcanoPlanner(RelOptCostFactory costFactory, //
super(costFactory == null ? VolcanoCost.FACTORY : costFactory, //
externalContext);
this.zeroCost = this.costFactory.makeZeroCost();
+ // If LOGGER is debug enabled, enable provenance information to be captured
+ this.provenanceMap = LOGGER.isDebugEnabled() ? new HashMap<>()
+ : Util.blackholeMap();
Review comment:
I agree with @jacques-n that naming is subjective, and I would also
recommend to explain why it is confusing and if you have suggestions. Blackhole
is used regularly in programming for methods/classes which can be used to write
data, but you cannot read it back (similar to a black hole in astronomy). My
inspiration came from JMH framework and their `Blackhole` class:
https://hg.openjdk.java.net/code-tools/jmh/file/1c11c886e0c8/jmh-core/src/main/java/org/openjdk/jmh/infra/Blackhole.java#l147.
I'd be okay with `DevNullMap` (assuming everybody is familiar with
`/dev/null`...)
I'd like also to avoid too much bikeshedding on the name. If name is the
only comment left, and there's no strong consensus for or against a name, I'll
plan to merge this change in 1 or 2 days...
----------------------------------------------------------------
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