You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by ti...@apache.org on 2018/11/21 17:38:27 UTC

asterixdb git commit: [NO ISSUE][HYR][CONF] Fix default/description for DEFAULT_DIR

Repository: asterixdb
Updated Branches:
  refs/heads/master 7b26b0318 -> fa4dc5c28


[NO ISSUE][HYR][CONF] Fix default/description for DEFAULT_DIR

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Flip description and default value for
  ControllerConfig.Option.DEFAULT_DIR
- use FileUtil.joinPath to join paths

Change-Id: I055a4d8188ee5b553aecb11c16d0b150d9797353
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3035
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mb...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/fa4dc5c2
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/fa4dc5c2
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/fa4dc5c2

Branch: refs/heads/master
Commit: fa4dc5c281aaecaf6b77fe745082737cf69149f7
Parents: 7b26b03
Author: Till Westmann <ti...@apache.org>
Authored: Sat Nov 17 22:35:15 2018 -0800
Committer: Till Westmann <ti...@apache.org>
Committed: Wed Nov 21 09:38:10 2018 -0800

----------------------------------------------------------------------
 .../common/controllers/ControllerConfig.java    |  4 ++--
 .../control/nc/NCLogConfigurationFactory.java   | 21 ++++++++++----------
 2 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/fa4dc5c2/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/ControllerConfig.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/ControllerConfig.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/ControllerConfig.java
index 07e61ba..a800ac4 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/ControllerConfig.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/ControllerConfig.java
@@ -40,8 +40,8 @@ public class ControllerConfig implements Serializable {
         CONFIG_FILE_URL(OptionTypes.URL, (URL) null, "Specify URL to master configuration file"),
         DEFAULT_DIR(
                 OptionTypes.STRING,
-                "Directory where files are written to by default",
-                FileUtil.joinPath(System.getProperty(ConfigurationUtil.JAVA_IO_TMPDIR), "hyracks")),
+                FileUtil.joinPath(System.getProperty(ConfigurationUtil.JAVA_IO_TMPDIR), "hyracks"),
+                "Directory where files are written to by default"),
         LOG_DIR(
                 OptionTypes.STRING,
                 (Function<IApplicationConfig, String>) appConfig -> FileUtil

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/fa4dc5c2/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCLogConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCLogConfigurationFactory.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCLogConfigurationFactory.java
index f4d10cb..41f8e7b 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCLogConfigurationFactory.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCLogConfigurationFactory.java
@@ -18,10 +18,10 @@
  */
 package org.apache.hyracks.control.nc;
 
-import java.io.File;
 import java.net.URI;
 
 import org.apache.hyracks.control.common.controllers.NCConfig;
+import org.apache.hyracks.util.file.FileUtil;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.config.Configuration;
@@ -43,7 +43,6 @@ public class NCLogConfigurationFactory extends ConfigurationFactory {
     public Configuration createConfiguration(ConfigurationBuilder<BuiltConfiguration> builder) {
         String nodeId = config.getNodeId();
         String logDir = config.getLogDir();
-        logDir = logDir.endsWith(File.separator) ? logDir : logDir + File.separator;
         builder.setStatusLevel(Level.WARN);
         builder.setConfigurationName("RollingBuilder");
         // create a rolling file appender
@@ -52,20 +51,22 @@ public class NCLogConfigurationFactory extends ConfigurationFactory {
         ComponentBuilder triggeringPolicy = builder.newComponent("Policies")
                 .addComponent(builder.newComponent("CronTriggeringPolicy").addAttribute("schedule", "0 0 0 * * ?"))
                 .addComponent(builder.newComponent("SizeBasedTriggeringPolicy").addAttribute("size", "50M"));
-        AppenderComponentBuilder defaultRoll =
-                builder.newAppender("default", "RollingFile").addAttribute("fileName", logDir + "nc-" + nodeId + ".log")
-                        .addAttribute("filePattern", logDir + "nc-" + nodeId + "-%d{MM-dd-yy}.log.gz")
-                        .add(defaultLayout).addComponent(triggeringPolicy);
+        AppenderComponentBuilder defaultRoll = builder.newAppender("default", "RollingFile")
+                .addAttribute("fileName", FileUtil.joinPath(logDir, "nc-" + nodeId + ".log"))
+                .addAttribute("filePattern", FileUtil.joinPath(logDir, "nc-" + nodeId + "-%d{MM-dd-yy}.log.gz"))
+                .add(defaultLayout).addComponent(triggeringPolicy);
         builder.add(defaultRoll);
 
         // create the new logger
         builder.add(builder.newRootLogger(Level.INFO).add(builder.newAppenderRef("default")));
 
         LayoutComponentBuilder accessLayout = builder.newLayout("PatternLayout").addAttribute("pattern", "%m%n");
-        AppenderComponentBuilder accessRoll = builder.newAppender("access", "RollingFile")
-                .addAttribute("fileName", logDir + "access-" + nodeId + ".log")
-                .addAttribute("filePattern", logDir + "access-" + nodeId + "-%d{MM-dd-yy}.log.gz").add(accessLayout)
-                .addComponent(triggeringPolicy);
+        AppenderComponentBuilder accessRoll =
+                builder.newAppender("access", "RollingFile")
+                        .addAttribute("fileName", FileUtil.joinPath(logDir, "access-" + nodeId + ".log"))
+                        .addAttribute("filePattern",
+                                FileUtil.joinPath(logDir, "access-" + nodeId + "-%d{MM-dd-yy}.log.gz"))
+                        .add(accessLayout).addComponent(triggeringPolicy);
         builder.add(accessRoll);
         builder.add(builder.newLogger("org.apache.hyracks.http.server.CLFLogger", Level.forName("ACCESS", 550))
                 .add(builder.newAppenderRef("access")).addAttribute("additivity", false));