diff --git a/.gitignore b/.gitignore index fdde96af6..65263b39e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .project .settings .classpath +.idea target /ClusterControllerService/ diff --git a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java index 53b352f16..deed1dac0 100644 --- a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java +++ b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java @@ -81,8 +81,7 @@ public class VXQuery { /** * Constructor to use command line options passed. * - * @param opts - * Command line options object + * @param opts Command line options object */ public VXQuery(CmdLineOptions opts) { this.opts = opts; @@ -240,23 +239,24 @@ private void runQueries() throws IOException, SystemException, Exception { * @throws Exception */ private String[] getNodeList() throws Exception { - Map nodeControllerInfos = hcc.getNodeControllerInfos(); - String[] nodeList = new String[nodeControllerInfos.size()]; - int index = 0; - for (String node : nodeControllerInfos.keySet()) { - nodeList[index++] = node; + if (hcc != null) { + Map nodeControllerInfos = hcc.getNodeControllerInfos(); + String[] nodeList = new String[nodeControllerInfos.size()]; + int index = 0; + for (String node : nodeControllerInfos.keySet()) { + nodeList[index++] = node; + } + return nodeList; } - return nodeList; + return null; } /** * Creates a Hyracks dataset, if not already existing with the job frame size, and 1 reader. Allocates a new buffer of size specified in the frame of Hyracks * node. Creates new dataset reader with the current job ID and result set ID. Outputs the string in buffer for each frame. * - * @param spec - * JobSpecification object, containing frame size. Current specified job. - * @param writer - * Writer for output of job. + * @param spec JobSpecification object, containing frame size. Current specified job. + * @param writer Writer for output of job. * @throws Exception */ private void runJob(JobSpecification spec, PrintWriter writer) throws Exception { @@ -339,8 +339,7 @@ public void stopLocalHyracks() throws Exception { /** * Reads the contents of file given in query into a String. The file is always closed. For XML files UTF-8 encoding is used. * - * @param query - * The query with filename to be processed + * @param query The query with filename to be processed * @return UTF-8 formatted query string * @throws IOException */ @@ -362,7 +361,8 @@ private static void timingMessage(String message) { * Helper class with fields and methods to handle all command line options */ private static class CmdLineOptions { - @Option(name = "-available-processors", usage = "Number of available processors. (default: java's available processors)") + @Option(name = "-available-processors", + usage = "Number of available processors. (default: java's available processors)") private int availableProcessors = -1; @Option(name = "-client-net-ip-address", usage = "IP Address of the ClusterController.") diff --git a/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java b/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java index 238f6d3e6..4d7fbc419 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java @@ -111,9 +111,11 @@ public static AlgebricksPartitionConstraint getClusterLocations(String[] nodeLis public static AlgebricksPartitionConstraint getClusterLocations(String[] nodeList, int partitions) { ArrayList locs = new ArrayList(); - for (String node : nodeList) { - for (int j = 0; j < partitions; j++) { - locs.add(node); + if (nodeList != null) { + for (String node : nodeList) { + for (int j = 0; j < partitions; j++) { + locs.add(node); + } } } String[] cluster = new String[locs.size()];