Ian Maxon has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/3195

Change subject: [NO ISSUE] Fix logging in NCServiceIT
......................................................................

[NO ISSUE] Fix logging in NCServiceIT

This test had a strange logging setup; the logging
for the actual IT was not configured to log outside
of /tmp, and the NCService processes had no log4j2
configuration set.

Change-Id: I4a5944891adf6b073dee01e8418b2449e1179949
---
M asterixdb/NOTICE
M 
asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
M asterixdb/src/main/licenses/templates/asterix-notice.ftl
M hyracks-fullstack/NOTICE
M 
hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-notice.ftl
M 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/CCDriver.java
M 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
M 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/ControllerConfig.java
M 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCDriver.java
M 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCLogConfigurationFactory.java
M 
hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NodeControllerService.java
M hyracks-fullstack/hyracks/hyracks-server/pom.xml
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/NCServiceIT.java
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksNCServiceProcess.java
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksServerProcess.java
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksVirtualCluster.java
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/cc.conf
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-blue.conf
M 
hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-red.conf
M hyracks-fullstack/pom.xml
21 files changed, 120 insertions(+), 36 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/95/3195/1

diff --git a/asterixdb/NOTICE b/asterixdb/NOTICE
index 3f18a61..7615782 100644
--- a/asterixdb/NOTICE
+++ b/asterixdb/NOTICE
@@ -1,5 +1,5 @@
 Apache AsterixDB
-Copyright 2015-2018 The Apache Software Foundation
+Copyright 2015-2019 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
diff --git 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
index ae13e42..1301c01 100644
--- 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -125,6 +125,7 @@
         }
         ccApplication.registerConfig(configManager);
         final CCConfig ccConfig = createCCConfig(configManager);
+        configManager.processConfig();
         cc = new ClusterControllerService(ccConfig, ccApplication);
 
         nodeNames = ccConfig.getConfigManager().getNodeNames();
diff --git a/asterixdb/src/main/licenses/templates/asterix-notice.ftl 
b/asterixdb/src/main/licenses/templates/asterix-notice.ftl
index 41cd8a0..c825397 100644
--- a/asterixdb/src/main/licenses/templates/asterix-notice.ftl
+++ b/asterixdb/src/main/licenses/templates/asterix-notice.ftl
@@ -22,7 +22,7 @@
 <#else>
 Apache AsterixDB
 </#if>
-Copyright 2015-2018 The Apache Software Foundation
+Copyright 2015-${.now?string('yyyy')} The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
diff --git a/hyracks-fullstack/NOTICE b/hyracks-fullstack/NOTICE
index 9ca26a7..77f31ad 100644
--- a/hyracks-fullstack/NOTICE
+++ b/hyracks-fullstack/NOTICE
@@ -1,5 +1,5 @@
 Apache Hyracks and Algebricks
-Copyright 2015-2018 The Apache Software Foundation
+Copyright 2015-2019 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
diff --git 
a/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-notice.ftl
 
b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-notice.ftl
index 077e7bc..8a2eb05 100644
--- 
a/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-notice.ftl
+++ 
b/hyracks-fullstack/hyracks-fullstack-license/src/main/licenses/templates/hyracks-notice.ftl
@@ -18,7 +18,7 @@
 -->
 <#-- TODO(mblow): share notice file template with asterixdb via maven artifact 
-->
 Apache Hyracks and Algebricks
-Copyright 2015-2018 The Apache Software Foundation
+Copyright 2015-${.now?string('yyyy')} The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/CCDriver.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/CCDriver.java
index c4ad139..8b58046 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/CCDriver.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/CCDriver.java
@@ -53,6 +53,7 @@
             CCLogConfigurationFactory logCfgFactory = new 
CCLogConfigurationFactory(ccConfig);
             ConfigurationFactory.setConfigurationFactory(logCfgFactory);
             cfg.removeLogger("Console");
+            configManager.processConfig();
             ctx.start(logCfgFactory.getConfiguration(ctx, 
ConfigurationSource.NULL_SOURCE));
             ClusterControllerService ccService = new 
ClusterControllerService(ccConfig, application);
             ccService.start();
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
index b5dacfb..b2e4a5e 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
@@ -161,7 +161,6 @@
             throw new IllegalArgumentException("ICCApplication cannot be 
null");
         }
         this.application = application;
-        configManager.processConfig();
         File jobLogFolder = new File(ccConfig.getRootDir(), "logs/jobs");
         jobLog = new LogFile(jobLogFolder);
 
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..79ad71f 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
@@ -18,6 +18,7 @@
  */
 package org.apache.hyracks.control.common.controllers;
 
+import java.io.File;
 import java.io.Serializable;
 import java.net.URL;
 import java.util.function.Function;
@@ -40,8 +41,8 @@
         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
@@ -120,6 +121,8 @@
     }
 
     public String getLogDir() {
-        return 
configManager.getAppConfig().getString(ControllerConfig.Option.LOG_DIR);
+        String relPath = 
configManager.getAppConfig().getString(ControllerConfig.Option.LOG_DIR);
+        String fullPath = new File(relPath).getAbsolutePath();
+        return fullPath;
     }
 }
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCDriver.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCDriver.java
index fdd271c..b460735 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCDriver.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NCDriver.java
@@ -52,6 +52,7 @@
             Configuration cfg = ctx.getConfiguration();
             NCLogConfigurationFactory logCfgFactory = new 
NCLogConfigurationFactory(ncConfig);
             ConfigurationFactory.setConfigurationFactory(logCfgFactory);
+            configManager.processConfig();
             cfg.removeLogger("Console");
             ctx.start(logCfgFactory.getConfiguration(ctx, 
ConfigurationSource.NULL_SOURCE));
             final NodeControllerService ncService = new 
NodeControllerService(ncConfig, application);
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 990d6c9..587696c 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
@@ -30,6 +30,7 @@
 import org.apache.logging.log4j.core.config.builder.api.LayoutComponentBuilder;
 import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
 
+import java.io.File;
 import java.net.URI;
 
 public class NCLogConfigurationFactory extends ConfigurationFactory {
@@ -41,7 +42,7 @@
 
     public Configuration 
createConfiguration(ConfigurationBuilder<BuiltConfiguration> builder) {
         String nodeId = config.getNodeId();
-        String logDir = config.getLogDir();
+        File logDir = new File(config.getLogDir());
         builder.setStatusLevel(Level.WARN);
         builder.setConfigurationName("RollingBuilder");
         // create a rolling file appender
@@ -50,10 +51,11 @@
         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", new File(logDir, "nc-" + nodeId + 
".log").getAbsolutePath())
+                .addAttribute("filePattern",
+                        new File(logDir, "nc-" + nodeId + 
"-%d{MM-dd-yy}.log.gz").getAbsolutePath())
+                .add(defaultLayout).addComponent(triggeringPolicy);
         builder.add(defaultRoll);
 
         // create the new logger
@@ -61,9 +63,10 @@
 
         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);
+                .addAttribute("fileName", new File(logDir, "access-" + nodeId 
+ ".log").getAbsolutePath())
+                .addAttribute("filePattern",
+                        new File(logDir, "access-" + nodeId + 
"-%d{MM-dd-yy}.log.gz").getAbsolutePath())
+                .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));
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NodeControllerService.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NodeControllerService.java
index 653d6e0..d7da5a4 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NodeControllerService.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/NodeControllerService.java
@@ -193,7 +193,6 @@
         if (application == null) {
             throw new IllegalArgumentException("INCApplication cannot be 
null");
         }
-        configManager.processConfig();
         this.application = application;
         id = ncConfig.getNodeId();
         if (id == null) {
diff --git a/hyracks-fullstack/hyracks/hyracks-server/pom.xml 
b/hyracks-fullstack/hyracks/hyracks-server/pom.xml
index 8b59870..1a94210 100644
--- a/hyracks-fullstack/hyracks/hyracks-server/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-server/pom.xml
@@ -185,5 +185,9 @@
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
   </dependencies>
 </project>
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/NCServiceIT.java
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/NCServiceIT.java
index 4983ba1..544d414 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/NCServiceIT.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/NCServiceIT.java
@@ -19,16 +19,24 @@
 package org.apache.hyracks.test.server;
 
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.net.InetAddress;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
 import java.util.Iterator;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
+import org.apache.hyracks.test.server.process.HyracksCCProcess;
+import org.apache.hyracks.test.server.process.HyracksNCServiceProcess;
 import org.apache.hyracks.test.server.process.HyracksVirtualCluster;
 import org.apache.hyracks.util.file.FileUtil;
 import org.apache.logging.log4j.LogManager;
@@ -55,8 +63,13 @@
     @BeforeClass
     public static void setUp() throws Exception {
         cluster = new HyracksVirtualCluster(new File(APP_HOME), null);
-        cluster.addNCService(new File(RESOURCE_DIR, "nc-red.conf"), new 
File(LOG_DIR, "nc-red.log"));
-        cluster.addNCService(new File(RESOURCE_DIR, "nc-blue.conf"), new 
File(LOG_DIR, "nc-blue.log"));
+        File tempConf = new File(TARGET_DIR, "cc.conf");
+        FileUtils.copyFile(new File(RESOURCE_DIR, "cc.conf"), tempConf);
+        Files.write(tempConf.toPath(), ("log.dir: " + LOG_DIR).getBytes(), 
StandardOpenOption.APPEND);
+        File log4jPath = new File(FileUtil.joinPath("..", "..", "src", "test", 
"resources", "log4j2-hyracks-test.xml"));
+
+        cluster.addNCService(new File(RESOURCE_DIR, "nc-red.conf"), new 
File(LOG_DIR, "nc-red.log"), log4jPath);
+        cluster.addNCService(new File(RESOURCE_DIR, "nc-blue.conf"), new 
File(LOG_DIR, "nc-blue.log"), log4jPath);
 
         try {
             Thread.sleep(2000);
@@ -64,7 +77,7 @@
         }
 
         // Start CC
-        cluster.start(new File(RESOURCE_DIR, "cc.conf"), new File(LOG_DIR, 
"cc.log"));
+        cluster.start(tempConf, new File(LOG_DIR, "cc.log"), log4jPath);
 
         try {
             Thread.sleep(10000);
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
index b39def5..9546e3c 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksCCProcess.java
@@ -19,6 +19,7 @@
 package org.apache.hyracks.test.server.process;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hyracks.control.cc.CCDriver;
@@ -32,6 +33,11 @@
         this.workingDir = workingDir;
     }
 
+    public HyracksCCProcess(File configFile, File logFile, File appHome, File 
workingDir, File log4jPath) {
+        this(configFile, logFile, appHome, workingDir);
+        args.add("-Dlog4j.configurationFile=file://" + 
log4jPath.getAbsolutePath());
+    }
+
     @Override
     protected String getMainClassName() {
         return CCDriver.class.getName();
@@ -41,7 +47,8 @@
     @SuppressWarnings("squid:CommentedOutCodeLine")
     protected void addJvmArgs(List<String> cList) {
         // CC needs more than default memory
-        cList.add("-Xmx1024m");
+        args.add("-Xmx1024m");
+        cList.addAll(args);
         // 
cList.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005");
     }
 }
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksNCServiceProcess.java
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksNCServiceProcess.java
index 67fea0f..2c7c989 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksNCServiceProcess.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksNCServiceProcess.java
@@ -19,6 +19,7 @@
 package org.apache.hyracks.test.server.process;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hyracks.control.nc.service.NCService;
@@ -32,6 +33,11 @@
         this.workingDir = workingDir;
     }
 
+    public HyracksNCServiceProcess(File configFile, File logFile, File 
appHome, File workingDir, File log4jPath) {
+        this(configFile, logFile, appHome, workingDir);
+        args.add("-Dlog4j.configurationFile=file://" + 
log4jPath.getAbsolutePath());
+    }
+
     @Override
     protected String getMainClassName() {
         return NCService.class.getName();
@@ -40,6 +46,8 @@
     @Override
     protected void addJvmArgs(List<String> cList) {
         // NCService needs little memory
-        cList.add("-Xmx128m");
+        args.add("-Xmx128m");
+        cList.addAll(args);
     }
+
 }
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksServerProcess.java
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksServerProcess.java
index d157c6f..a8c363b 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksServerProcess.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksServerProcess.java
@@ -37,6 +37,7 @@
     protected File logFile = null;
     protected File appHome = null;
     protected File workingDir = null;
+    protected List<String> args = new ArrayList<>();
 
     public void start() throws IOException {
         String[] cmd = buildCommand();
@@ -114,6 +115,10 @@
     protected void addCmdLineArgs(List<String> cList) {
     }
 
+    public void addArg(String arg) {
+        args.add(arg);
+    }
+
     protected abstract String getMainClassName();
 
     private final String getClasspath() {
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksVirtualCluster.java
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksVirtualCluster.java
index fc7bf73..6c77628 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksVirtualCluster.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/test/server/process/HyracksVirtualCluster.java
@@ -35,11 +35,14 @@
 
     /**
      * Construct a Hyracks-based cluster.
-     * @param appHome - path to the installation root of the Hyracks 
application.
-     *                At least bin/hyracksnc (or the equivalent NC script for
-     *                the application) must exist in this directory.
-     * @param workingDir - directory to use as CWD for all child processes. May
-     *                be null, in which case the CWD of the invoking process 
is used.
+     *
+     * @param appHome
+     *            - path to the installation root of the Hyracks application.
+     *            At least bin/hyracksnc (or the equivalent NC script for
+     *            the application) must exist in this directory.
+     * @param workingDir
+     *            - directory to use as CWD for all child processes. May
+     *            be null, in which case the CWD of the invoking process is 
used.
      */
     public HyracksVirtualCluster(File appHome, File workingDir) {
         this.appHome = appHome;
@@ -48,8 +51,11 @@
 
     /**
      * Creates and starts an NCService.
-     * @param configFile - full path to an ncservice.conf. May be null to 
accept all defaults.
-     * @throws IOException - if there are errors starting the process.
+     *
+     * @param configFile
+     *            - full path to an ncservice.conf. May be null to accept all 
defaults.
+     * @throws IOException
+     *             - if there are errors starting the process.
      */
     public HyracksNCServiceProcess addNCService(File configFile, File logFile) 
throws IOException {
         HyracksNCServiceProcess proc = new HyracksNCServiceProcess(configFile, 
logFile, appHome, workingDir);
@@ -59,11 +65,30 @@
     }
 
     /**
+     * Creates and starts an NCService.
+     *
+     * @param configFile
+     *            - full path to an ncservice.conf. May be null to accept all 
defaults.
+     * @throws IOException
+     *             - if there are errors starting the process.
+     */
+    public HyracksNCServiceProcess addNCService(File configFile, File logFile, 
File log4jConfig) throws IOException {
+        HyracksNCServiceProcess proc =
+                new HyracksNCServiceProcess(configFile, logFile, appHome, 
workingDir, log4jConfig);
+        proc.start();
+        ncProcs.add(proc);
+        return proc;
+    }
+
+    /**
      * Starts the CC, initializing the cluster. Expects that any NCs referenced
      * in the cluster configuration have already been started with 
addNCService().
-     * @param ccConfigFile - full path to a cluster conf file. May be null to 
accept all
-     *                     defaults, although this is seldom useful since 
there are no NCs.
-     * @throws IOException - if there are errors starting the process.
+     *
+     * @param ccConfigFile
+     *            - full path to a cluster conf file. May be null to accept all
+     *            defaults, although this is seldom useful since there are no 
NCs.
+     * @throws IOException
+     *             - if there are errors starting the process.
      */
     public HyracksCCProcess start(File ccConfigFile, File logFile) throws 
IOException {
         ccProc = new HyracksCCProcess(ccConfigFile, logFile, appHome, 
workingDir);
@@ -72,6 +97,22 @@
     }
 
     /**
+     * Starts the CC, initializing the cluster. Expects that any NCs referenced
+     * in the cluster configuration have already been started with 
addNCService().
+     *
+     * @param ccConfigFile
+     *            - full path to a cluster conf file. May be null to accept all
+     *            defaults, although this is seldom useful since there are no 
NCs.
+     * @throws IOException
+     *             - if there are errors starting the process.
+     */
+    public HyracksCCProcess start(File ccConfigFile, File logFile, File 
log4jConfig) throws IOException {
+        ccProc = new HyracksCCProcess(ccConfigFile, logFile, appHome, 
workingDir, log4jConfig);
+        ccProc.start();
+        return ccProc;
+    }
+
+    /**
      * Stops all processes in the cluster.
      * QQQ Someday this should probably do a graceful stop of NCs rather than
      * killing the NCService.
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/cc.conf
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/cc.conf
index 419b8ca..9c80c7d 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/cc.conf
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/cc.conf
@@ -29,3 +29,4 @@
 address = 127.0.0.1
 console.listen.port = 12345
 
+[common]
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-blue.conf
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-blue.conf
index 9ddf4df..6eb38dd 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-blue.conf
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-blue.conf
@@ -18,5 +18,3 @@
 [ncservice]
 address=127.0.0.1
 port=9091
-logdir=-
-
diff --git 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-red.conf
 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-red.conf
index f854479..286bd32 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-red.conf
+++ 
b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-red.conf
@@ -18,5 +18,3 @@
 [ncservice]
 address=127.0.0.1
 port=9090
-logdir=-
-
diff --git a/hyracks-fullstack/pom.xml b/hyracks-fullstack/pom.xml
index 5987022..f7dc596 100644
--- a/hyracks-fullstack/pom.xml
+++ b/hyracks-fullstack/pom.xml
@@ -46,6 +46,7 @@
     <tag>HEAD</tag>
   </scm>
   <properties>
+    <root.dir>${basedir}</root.dir>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <file.encoding>UTF-8</file.encoding>
     <source.jdk.version>1.8</source.jdk.version>
@@ -54,6 +55,7 @@
     
<sonar.jacoco.reportPath>${env.PWD}/target/jacoco-merged.exec</sonar.jacoco.reportPath>
     <source-format.goal>format</source-format.goal>
     <source-format.skip>false</source-format.skip>
+    <maven.test.skip>false</maven.test.skip>
     <skipTests>false</skipTests>
     <skip.surefire.tests>${skipTests}</skip.surefire.tests>
     <skip.testResources>${maven.test.skip}</skip.testResources>

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/3195
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a5944891adf6b073dee01e8418b2449e1179949
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: stabilization-f69489
Gerrit-Owner: Ian Maxon <[email protected]>

Reply via email to