asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [1/2] incubator-asterixdb git commit: Overhaul of Hyracks configuration management.
Date Tue, 10 May 2016 18:06:05 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master afe6bdbfc -> 5ba58de67


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
new file mode 100644
index 0000000..df92d1a
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
@@ -0,0 +1,220 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.hyracks.control.nc.service;
+
+import org.apache.commons.lang3.SystemUtils;
+import org.ini4j.Ini;
+import org.kohsuke.args4j.CmdLineParser;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.StringReader;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Stand-alone process which listens for configuration information from the
+ * CC and starts an NC. Intended to be a constantly-running service.
+ */
+public class NCService {
+
+    private static final Logger LOGGER = Logger.getLogger(NCService.class.getName());
+
+    /**
+     * The .ini read from the CC (*not* the ncservice.ini file)
+     */
+    private static Ini ini = new Ini();
+
+    /**
+     * The NCServiceConfig
+     */
+    private static NCServiceConfig config;
+
+    /**
+     * The child Process, if one is active
+     */
+    private static Process proc = null;
+
+    private static final String MAGIC_COOKIE = "hyncmagic";
+
+    private static String getStringINIOpt(Ini ini, String section, String key, String default_value)
{
+        String value = ini.get(section, key, String.class);
+        return (value != null) ? value : default_value;
+    }
+
+    private static int getIntINIOpt(Ini ini, String section, String key, int default_value)
{
+        Integer value = ini.get(section, key, Integer.class);
+        return (value != null) ? value : default_value;
+    }
+
+    private static List<String> buildCommand() throws IOException {
+        List<String> cList = new ArrayList<String>();
+        if (SystemUtils.IS_OS_WINDOWS) {
+            cList.add(config.command + ".bat");
+        }
+        else {
+            cList.add(config.command);
+        }
+        cList.add("-config-file");
+        // Store the Ini file from the CC locally so NCConfig can read it.
+        // QQQ should arrange to delete this when done
+        File tempIni = File.createTempFile("ncconf", ".conf");
+        ini.store(tempIni);
+        cList.add(tempIni.getCanonicalPath());
+        return cList;
+    }
+
+    private static void configEnvironment(Map<String,String> env) {
+        if (env.containsKey("JAVA_OPTS")) {
+            return;
+        }
+        String jvmargs = getStringINIOpt(ini, "localnc", "jvm.args", "-Xmx1536m");
+        env.put("JAVA_OPTS", jvmargs);
+    }
+
+    /**
+     * Attempts to launch the "real" NCDriver, based on the configuration
+     * information gathered so far.
+     * @return true if the process was successfully launched and has now
+     * exited with a 0 (normal) exit code. false if some configuration error
+     * prevented the process from being launched or the process returned
+     * a non-0 (abnormal) exit code.
+     */
+    private static boolean launchNCProcess() {
+        try {
+            ProcessBuilder pb = new ProcessBuilder(buildCommand());
+            configEnvironment(pb.environment());
+            // QQQ inheriting probably isn't right
+            pb.inheritIO();
+
+            if (LOGGER.isLoggable(Level.INFO)) {
+                LOGGER.info("Launching NCDriver process");
+            }
+            proc = pb.start();
+
+            boolean waiting = true;
+            int retval = 0;
+            while (waiting) {
+                try {
+                    retval = proc.waitFor();
+                    waiting = false;
+                } catch (InterruptedException ignored) {
+                }
+            }
+            if (LOGGER.isLoggable(Level.INFO)) {
+                LOGGER.info("NCDriver exited with return value " + retval);
+            }
+            return (retval == 0);
+        } catch (Exception e) {
+            if (LOGGER.isLoggable(Level.SEVERE)) {
+                LOGGER.log(Level.SEVERE, "Configuration from CC broken", e);
+            }
+            return false;
+        }
+    }
+
+    private static boolean acceptConnection(InputStream is) {
+        // Simple on-wire protocol: magic cookie (string), CC address (string),
+        // port (string), as encoded on CC by ObjectOutputStream. If we see
+        // anything else or have any error, crap out and await a different
+        // connection.
+        // QQQ This should probably be changed to directly accept the full
+        // config file from the CC, rather than calling back to the CC's
+        // "config" webservice to retrieve it. Revisit when the CC is fully
+        // parsing and validating the master config file.
+        try {
+            ObjectInputStream ois = new ObjectInputStream(is);
+            String magic = ois.readUTF();
+            if (! MAGIC_COOKIE.equals(magic)) {
+                LOGGER.severe("Connection used incorrect magic cookie");
+                return false;
+            }
+            String iniString = ois.readUTF();
+            ini = new Ini(new StringReader(iniString));
+            return launchNCProcess();
+        } catch (Exception e) {
+            LOGGER.log(Level.SEVERE, "Error decoding connection from server", e);
+        }
+        return false;
+    }
+
+    public static void main(String[] args) throws Exception {
+        // Register a shutdown hook which will kill the NC if the NC Service is killed.
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            @Override
+            public void run() {
+                if (proc != null) {
+                    proc.destroy();
+                }
+            }
+        });
+        config = new NCServiceConfig();
+        CmdLineParser cp = new CmdLineParser(config);
+        try {
+            cp.parseArgument(args);
+        } catch (Exception e) {
+            e.printStackTrace();
+            cp.printUsage(System.err);
+            System.exit(1);
+        }
+        config.loadConfigAndApplyDefaults();
+
+        // For now we implement a trivial listener which just
+        // accepts an IP/port combination from the CC. This could
+        // be made more advanced in several ways depending on whether
+        // we want to expand the functionality of this service.
+        // For now this gets the job done, without radically changing
+        // the NC itself so that Managix can continue to function.
+        InetAddress addr = config.address == null ? null : InetAddress.getByName(config.address);
+        int port = config.port;
+
+        // Loop forever - the NCService will always return to "waiting for CC" state
+        // when the child NC terminates for any reason.
+        while (true) {
+            ServerSocket listener = new ServerSocket(port, 5, addr);
+            try {
+                boolean launched = false;
+                while (!launched) {
+                    if (LOGGER.isLoggable(Level.INFO)) {
+                        LOGGER.info("Waiting for connection from CC on " + addr + ":" + port);
+                    }
+                    Socket socket = listener.accept();
+                    try {
+                        // QQQ Because acceptConnection() doesn't return if the
+                        // service is started appropriately, the socket remains
+                        // open but non-responsive.
+                        launched = acceptConnection(socket.getInputStream());
+                    } finally {
+                        socket.close();
+                    }
+                }
+            } finally {
+                listener.close();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCServiceConfig.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCServiceConfig.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCServiceConfig.java
new file mode 100644
index 0000000..af80b33
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCServiceConfig.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.hyracks.control.nc.service;
+
+import org.apache.hyracks.control.common.controllers.IniUtils;
+import org.ini4j.Ini;
+import org.kohsuke.args4j.Option;
+
+import java.io.IOException;
+import java.net.InetAddress;
+
+/**
+ * Command-line arguments for NC Service.
+ */
+public class NCServiceConfig {
+
+    /**
+     * Normally one should only pass this argument. Other arguments are for debugging and
test purposes.
+     * If an option is specified both in the config file and on the command line, the config
file
+     * version will take precedence.
+     */
+    @Option(name = "-config-file", usage = "Local NC configuration file (default: none)",
required = false)
+    public String configFile = null;
+
+    @Option(name = "-address", usage = "Address to listen on for connections from CC (default:
localhost)", required = false)
+    public String address = InetAddress.getLoopbackAddress().getHostAddress();
+
+    @Option(name = "-port", usage = "Port to listen on for connections from CC (default:
9090)", required = false)
+    public int port = 9090;
+
+    @Option(name = "-command", usage = "NC command to run (default: 'hyracksnc' on PATH)",
required = false)
+    public String command = "hyracksnc";
+
+    private Ini ini = null;
+
+    /**
+     * This method simply maps from the ini parameters to the NCServiceConfig's fields.
+     * It does not apply defaults or any logic.
+     */
+    private void loadINIFile() throws IOException {
+        ini = IniUtils.loadINIFile(configFile);
+        address = IniUtils.getString(ini, "ncservice", "address", address);
+        port = IniUtils.getInt(ini, "ncservice", "port", port);
+    }
+
+    /**
+     * Once all @Option fields have been loaded from command-line or otherwise
+     * specified programmatically, call this method to:
+     * 1. Load options from a config file (as specified by -config-file)
+     * 2. Set default values for certain derived values
+     */
+    public void loadConfigAndApplyDefaults() throws IOException {
+        if (configFile != null) {
+            loadINIFile();
+        }
+        // No defaults necessary beyond the static ones for this config
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-control/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/pom.xml b/hyracks-fullstack/hyracks/hyracks-control/pom.xml
index ddb4e89..bd8d739 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/pom.xml
@@ -46,5 +46,6 @@
     <module>hyracks-control-common</module>
     <module>hyracks-control-cc</module>
     <module>hyracks-control-nc</module>
+    <module>hyracks-nc-service</module>
   </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-dist/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dist/pom.xml b/hyracks-fullstack/hyracks/hyracks-dist/pom.xml
index 99f8eca..a7c7a15 100644
--- a/hyracks-fullstack/hyracks/hyracks-dist/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-dist/pom.xml
@@ -76,7 +76,7 @@
             <phase>package</phase>
             <configuration>
               <target>
-                <chmod file="target/appassembler/bin/*)" perm="755"/>
+                <chmod file="target/appassembler/bin/*" perm="755"/>
               </target>
             </configuration>
             <goals>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-server/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-server/pom.xml b/hyracks-fullstack/hyracks/hyracks-server/pom.xml
index facaae8..3bda1d3 100644
--- a/hyracks-fullstack/hyracks/hyracks-server/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-server/pom.xml
@@ -43,6 +43,30 @@
   <build>
     <plugins>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <version>2.6</version>
+        <configuration>
+          <runOrder>alphabetical</runOrder>
+          <forkMode>pertest</forkMode>
+          <systemProperties>
+            <property>
+              <name>java.util.logging.config.file</name>
+              <value>src/test/resources/logging.properties</value>
+            </property>
+          </systemProperties>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>appassembler-maven-plugin</artifactId>
         <version>1.3</version>
@@ -59,6 +83,10 @@
                   <name>hyracksnc</name>
                 </program>
                 <program>
+                  <mainClass>org.apache.hyracks.control.nc.service.NCService</mainClass>
+                  <name>hyracksncservice</name>
+                </program>
+                <program>
                   <mainClass>org.apache.hyracks.server.drivers.VirtualClusterDriver</mainClass>
                   <name>hyracks-virtual-cluster</name>
                 </program>
@@ -80,6 +108,24 @@
           <skip>true</skip>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.6</version>
+        <executions>
+          <execution>
+            <id>process-test-classes</id>
+            <phase>package</phase>
+            <configuration>
+              <target>
+                <chmod file="target/appassembler/bin/*" perm="755" />
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <dependencies>
@@ -97,5 +143,18 @@
       <type>jar</type>
       <scope>compile</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.hyracks</groupId>
+      <artifactId>hyracks-nc-service</artifactId>
+      <version>0.2.18-SNAPSHOT</version>
+      <type>jar</type>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>3.0.1</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/server/test/NCServiceIT.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/server/test/NCServiceIT.java
b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/server/test/NCServiceIT.java
new file mode 100644
index 0000000..7f431f6
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-server/src/test/java/org/apache/hyracks/server/test/NCServiceIT.java
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.hyracks.server.test;
+
+import junit.framework.Assert;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.lang3.StringUtils;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+public class NCServiceIT {
+
+    private static final String RESOURCE_DIR = StringUtils
+            .join(new String[]{System.getProperty("user.dir"), "src", "test", "resources",
"NCServiceIT"},
+                    File.separator);
+    private static final String APP_DIR = StringUtils
+            .join(new String[]{System.getProperty("user.dir"), "target", "appassembler",
"bin"},
+                    File.separator);
+    private static final Logger LOGGER = Logger.getLogger(NCServiceIT.class.getName());
+    private static List<Process> procs = new ArrayList<>();
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        // Start two NC Services - don't read their output as they don't terminate
+        procs.add(invoke(APP_DIR + File.separator + "hyracksncservice",
+                "-config-file", RESOURCE_DIR + File.separator + "nc-red.conf",
+                "-command", APP_DIR + File.separator + "hyracksnc"));
+        procs.add(invoke(APP_DIR + File.separator + "hyracksncservice",
+                "-config-file", RESOURCE_DIR + File.separator + "nc-blue.conf",
+                "-command", APP_DIR + File.separator + "hyracksnc"));
+        try {
+            Thread.sleep(2000);
+        }
+        catch (InterruptedException ignored) {
+        }
+
+        // Start CC
+        procs.add(invoke(APP_DIR + File.separator + "hyrackscc",
+                "-config-file", RESOURCE_DIR + File.separator + "cc.conf"));
+        try {
+            Thread.sleep(10000);
+        }
+        catch (InterruptedException ignored) {
+        }
+    }
+
+    @AfterClass
+    public static void tearDown() throws Exception {
+        for (Process p : procs) {
+            p.destroy();
+            p.waitFor();
+        }
+    }
+
+    private static String getHttp(String url) throws Exception {
+        HttpClient client = new HttpClient();
+        GetMethod get = new GetMethod(url);
+        int statusCode;
+        try {
+            statusCode = client.executeMethod(get);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw e;
+        }
+        String response = get.getResponseBodyAsString();
+        if (statusCode == HttpStatus.SC_OK) {
+            return response;
+        } else {
+            throw new Exception("HTTP error " + statusCode + ":\n" + response);
+        }
+    }
+
+    private static Process invoke(String... args) throws Exception {
+        ProcessBuilder pb = new ProcessBuilder(args);
+        pb.redirectErrorStream(true);
+        Process p = pb.start();
+        return p;
+    }
+
+    @Test
+    public void IsNodelistCorrect() throws Exception {
+        // Ping the nodelist HTTP API
+        String localhost = InetAddress.getLoopbackAddress().getHostAddress();
+        String response = getHttp("http://" + localhost + ":12345/rest/nodes");
+        JSONObject result = new JSONObject(response);
+        JSONArray nodes = result.getJSONArray("result");
+        int numNodes = nodes.length();
+        Assert.assertEquals("Wrong number of nodes!", numNodes, 2);
+        for (int i = 0; i < nodes.length(); i++) {
+            JSONObject node = nodes.getJSONObject(i);
+            String id = node.getString("node-id");
+            if (id.equals("red") || id.equals("blue")) {
+                continue;
+            }
+            Assert.fail("Unexpected node ID '" + id + "'!");
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        try {
+            setUp();
+        } catch (Exception e) {
+            e.printStackTrace();
+            LOGGER.severe("TEST CASE(S) FAILED");
+        } finally {
+            tearDown();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/cc.conf
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..25ac530
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/cc.conf
@@ -0,0 +1,11 @@
+[nc/red]
+address=127.0.0.1
+
+[nc/blue]
+address=127.0.0.1
+port=9091
+
+[cc]
+cluster.address = 127.0.0.1
+http.port = 12345
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-blue.conf
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..d070b59
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-blue.conf
@@ -0,0 +1,3 @@
+[ncservice]
+address=127.0.0.1
+port=9091

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-red.conf
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..58a8f1d
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/NCServiceIT/nc-red.conf
@@ -0,0 +1,4 @@
+[ncservice]
+address=127.0.0.1
+port=9090
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/logging.properties
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/logging.properties
b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/logging.properties
new file mode 100644
index 0000000..c888bb1
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-server/src/test/resources/logging.properties
@@ -0,0 +1,76 @@
+#/*
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+############################################################
+# Default Logging Configuration File
+#
+# You can use a different file by specifying a filename
+# with the java.util.logging.config.file system property.
+# For example java -Djava.util.logging.config.file=myfile
+############################################################
+
+############################################################
+# Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the INFO and above levels.
+
+handlers= java.util.logging.ConsoleHandler
+
+# To also add the FileHandler, use the following line instead.
+
+# handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overriden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+
+.level= WARNING
+# .level= INFO
+# .level= FINE
+# .level = FINEST
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+
+# java.util.logging.FileHandler.pattern = %h/java%u.log
+# java.util.logging.FileHandler.limit = 50000
+# java.util.logging.FileHandler.count = 1
+# java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+
+# Limit the message that are printed on the console to FINE and above.
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5ba58de6/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestNCApplicationContext.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestNCApplicationContext.java
b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestNCApplicationContext.java
index f619be0..c6a4430 100644
--- a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestNCApplicationContext.java
+++ b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestNCApplicationContext.java
@@ -21,6 +21,7 @@ package org.apache.hyracks.test.support;
 import java.io.Serializable;
 import java.util.concurrent.ThreadFactory;
 
+import org.apache.hyracks.api.application.IApplicationConfig;
 import org.apache.hyracks.api.application.INCApplicationContext;
 import org.apache.hyracks.api.application.IStateDumpHandler;
 import org.apache.hyracks.api.context.IHyracksRootContext;
@@ -122,6 +123,11 @@ public class TestNCApplicationContext implements INCApplicationContext
{
     }
 
     @Override
+    public IApplicationConfig getAppConfig() {
+        return null;
+    }
+
+    @Override
     public ILifeCycleComponentManager getLifeCycleComponentManager() {
         return lccm;
     }


Mime
View raw message