drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaltekruse <...@git.apache.org>
Subject [GitHub] drill pull request: Enhanced logging and associated code hygiene
Date Mon, 20 Jul 2015 19:11:28 GMT
Github user jaltekruse commented on a diff in the pull request:

    --- Diff: common/src/main/java/org/apache/drill/common/config/DrillConfig.java ---
    @@ -44,31 +46,37 @@
     import com.google.common.collect.ImmutableList;
     import com.typesafe.config.Config;
     import com.typesafe.config.ConfigFactory;
    +import com.typesafe.config.ConfigRenderOptions;
     public final class DrillConfig extends NestedConfig{
    -//  private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillConfig.class);
    +  private static final Logger logger = getLogger(DrillConfig.class);
       private final ObjectMapper mapper;
       private final ImmutableList<String> startupArguments;
       public static final boolean ON_OSX = System.getProperty("os.name").contains("OS X");
    -  @SuppressWarnings("restriction")  private static final long MAX_DIRECT_MEMORY = sun.misc.VM.maxDirectMemory();
    +  @SuppressWarnings("restriction")
    +  private static final long MAX_DIRECT_MEMORY = sun.misc.VM.maxDirectMemory();
       private volatile List<Queue<Object>> sinkQueues = new CopyOnWriteArrayList<Queue<Object>>(new
    -  public DrillConfig(Config config, boolean enableServer) {
    +  public DrillConfig(Config config, boolean enableServerConfigs) {
    -    logger.debug("Setting up config object.");
    +    logger.debug("Setting up DrillConfig object.");
    +    if (logger.isTraceEnabled()) {
    --- End diff --
    I understand that this is to avoid the call the render() function if we don't need to
log the statement, but isn't reading config file pretty rare to require this kind of optimization
here? Did you notice a slow down on the drillbit startup time if we were always rendering
the options, even if we were not logging them?

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message