asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: avoid some exception wrapping
Date Mon, 19 Sep 2016 01:27:23 GMT
Till Westmann has submitted this change and it was merged.

Change subject: avoid some exception wrapping
......................................................................


avoid some exception wrapping

Change-Id: Ia8fff04c314eb146ce0a73beb0b8ec412cb2d280
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1179
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
---
M asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
M asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
M asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment7Builder.java
M asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment8Builder.java
M asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment9Builder.java
M asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8ABuilder.java
M asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8BBuilder.java
M asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8CBuilder.java
M asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8DBuilder.java
M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/FilesIndexDescription.java
M asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/hash/ListItemBinaryHashFunctionFactory.java
M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksJobletContext.java
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/deployment/DeploymentUtils.java
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Joblet.java
14 files changed, 82 insertions(+), 119 deletions(-)

Approvals:
  Michael Blow: Looks good to me, approved
  Jenkins: Verified; No violations found; Verified



diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
index 76d0245..9c0f66c 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
@@ -317,7 +317,8 @@
         builder.setMissingWriterFactory(format.getMissingWriterFactory());
         builder.setPredicateEvaluatorFactoryProvider(format.getPredicateEvaluatorFactoryProvider());
 
-        switch (conf.fmt()) {
+        final SessionConfig.OutputFormat outputFormat = conf.fmt();
+        switch (outputFormat) {
             case LOSSLESS_JSON:
                 builder.setPrinterProvider(format.getLosslessJSONPrinterFactoryProvider());
                 break;
@@ -331,7 +332,7 @@
                 builder.setPrinterProvider(format.getCleanJSONPrinterFactoryProvider());
                 break;
             default:
-                throw new RuntimeException("Unexpected OutputFormat!");
+                throw new AlgebricksException("Unexpected OutputFormat: " + outputFormat);
         }
 
         builder.setSerializerDeserializerProvider(format.getSerdeProvider());
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
index 28abc5c..af33f2e 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/management/AsterixEventServiceClient.java
@@ -159,7 +159,7 @@
                     break;
                 }
             } else {
-                throw new RuntimeException(report.getException().getMessage());
+                throw report.getException();
             }
         }
     }
diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment7Builder.java
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment7Builder.java
index d955167..4f35ff0 100644
--- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment7Builder.java
+++ b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment7Builder.java
@@ -19,6 +19,7 @@
 
 package org.apache.asterix.experiment.builder;
 
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
@@ -26,8 +27,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
-
-import org.apache.commons.lang3.StringUtils;
 
 import org.apache.asterix.experiment.action.base.AbstractAction;
 import org.apache.asterix.experiment.action.base.IAction;
@@ -43,6 +42,7 @@
 import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
 import org.apache.asterix.experiment.client.OrchestratorServer7;
 import org.apache.asterix.experiment.client.OrchestratorServer7.IProtocolActionBuilder;
+import org.apache.commons.lang3.StringUtils;
 
 public abstract class AbstractExperiment7Builder extends AbstractLSMBaseExperimentBuilder
{
 
@@ -129,31 +129,25 @@
 
         private final String rangeQueryTemplate;
 
-        public ProtocolActionBuilder() {
+        public ProtocolActionBuilder() throws IOException {
             this.rangeQueryTemplate = getRangeQueryTemplate();
         }
 
-        private String getRangeQueryTemplate() {
-            try {
-                Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve(
-                        "8_q2.aql");
-                return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath)))
-                        .toString();
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
+        private String getRangeQueryTemplate() throws IOException {
+            Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_q2.aql");
+            return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath))).toString();
         }
 
         @Override
-        public IAction buildQueryAction(long cardinality, boolean finalRound) throws Exception
{
+        public IAction buildQueryAction(long cardinality, boolean finalRound) throws IOException
{
             SequentialActionList protoAction = new SequentialActionList();
-            IAction rangeQueryAction = new TimedAction(new RunAQLStringAction(httpClient,
restHost, restPort,
-                    getRangeAQL(cardinality, finalRound)));
+            IAction rangeQueryAction = new TimedAction(
+                    new RunAQLStringAction(httpClient, restHost, restPort, getRangeAQL(cardinality,
finalRound)));
             protoAction.add(rangeQueryAction);
             return protoAction;
         }
 
-        private String getRangeAQL(long cardinaliry, boolean finalRound) throws Exception
{
+        private String getRangeAQL(long cardinaliry, boolean finalRound) throws IOException
{
             long round = QUERY_BEGIN_ROUND;
             if (finalRound) {
                 ++round;
@@ -171,7 +165,7 @@
         }
 
         @Override
-        public IAction buildIOWaitAction() throws Exception {
+        public IAction buildIOWaitAction() throws IOException {
             SequentialActionList ioAction = new SequentialActionList();
             ioAction.add(new SleepAction(10000));
             ioAction.add(new RunRESTIOWaitAction(httpClient, restHost, restPort));
@@ -180,9 +174,9 @@
         }
 
         @Override
-        public IAction buildCompactAction() throws Exception {
-            return (new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
-                    LSMExperimentConstants.AQL_DIR).resolve("8_compact.aql")));
+        public IAction buildCompactAction() throws IOException {
+            return new RunAQLFileAction(httpClient, restHost, restPort,
+                    localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_compact.aql"));
         }
     }
 
diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment8Builder.java
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment8Builder.java
index eaafae2..8d4c5ed 100644
--- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment8Builder.java
+++ b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment8Builder.java
@@ -19,6 +19,7 @@
 
 package org.apache.asterix.experiment.builder;
 
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
@@ -26,8 +27,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
-
-import org.apache.commons.lang3.StringUtils;
 
 import org.apache.asterix.experiment.action.base.AbstractAction;
 import org.apache.asterix.experiment.action.base.ParallelActionSet;
@@ -40,6 +39,7 @@
 import org.apache.asterix.experiment.client.LSMExperimentConstants;
 import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
 import org.apache.asterix.experiment.client.OrchestratorServer;
+import org.apache.commons.lang3.StringUtils;
 
 public abstract class AbstractExperiment8Builder extends AbstractLSMBaseExperimentBuilder
{
 
@@ -65,7 +65,7 @@
     private final String rangeQueryTemplate;
 
     public AbstractExperiment8Builder(String name, LSMExperimentSetRunnerConfig config, String
clusterConfigFileName,
-            String ingestFileName, String dgenFileName) {
+            String ingestFileName, String dgenFileName) throws IOException {
         super(name, config, clusterConfigFileName, ingestFileName, dgenFileName, null);
         nIntervals = config.getNIntervals();
         orchHost = config.getOrchestratorHost();
@@ -145,25 +145,17 @@
         });
     }
 
-    private String getRangeQueryTemplate() {
-        try {
-            Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_q2.aql");
-            return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath))).toString();
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+    private String getRangeQueryTemplate() throws IOException {
+        Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_q2.aql");
+        return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath))).toString();
     }
 
-    private String getPointQueryTemplate() {
-        try {
-            Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_q1.aql");
-            return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath))).toString();
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+    private String getPointQueryTemplate() throws IOException {
+        Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_q1.aql");
+        return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath))).toString();
     }
 
-    protected String getPointLookUpAQL(int round) throws Exception {
+    protected String getPointLookUpAQL(int round) {
         ByteBuffer bb = ByteBuffer.allocate(8);
         bb.put((byte) 0);
         bb.put((byte) randGen.nextInt(N_PARTITIONS));
@@ -174,7 +166,7 @@
         return pointQueryTemplate.replaceAll("\\$KEY\\$", Long.toString(key));
     }
 
-    protected String getRangeAQL(int round) throws Exception {
+    protected String getRangeAQL(int round) {
         long numKeys = (((1 + round) * dataInterval) / 1000) * N_PARTITIONS;
         long rangeSize = (long) ((EXPECTED_RANGE_CARDINALITY / (double) numKeys) * DOMAIN_SIZE);
         int lowKey = randGen.nextInt();
diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment9Builder.java
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment9Builder.java
index 6d36f1d..bd3067d 100644
--- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment9Builder.java
+++ b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/AbstractExperiment9Builder.java
@@ -19,6 +19,7 @@
 
 package org.apache.asterix.experiment.builder;
 
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
@@ -26,8 +27,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
-
-import org.apache.commons.lang3.StringUtils;
 
 import org.apache.asterix.experiment.action.base.AbstractAction;
 import org.apache.asterix.experiment.action.base.IAction;
@@ -40,6 +39,7 @@
 import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
 import org.apache.asterix.experiment.client.OrchestratorServer9;
 import org.apache.asterix.experiment.client.OrchestratorServer9.IProtocolActionBuilder;
+import org.apache.commons.lang3.StringUtils;
 
 public abstract class AbstractExperiment9Builder extends AbstractLSMBaseExperimentBuilder
{
 
@@ -73,7 +73,7 @@
     }
 
     @Override
-    protected void doBuildDataGen(SequentialActionList seq, Map<String, List<String>>
dgenPairs) throws Exception {
+    protected void doBuildDataGen(SequentialActionList seq, Map<String, List<String>>
dgenPairs) throws IOException {
         int nDgens = 0;
         for (List<String> v : dgenPairs.values()) {
             nDgens += v.size();
@@ -128,40 +128,28 @@
 
         private final String rangeQueryTemplate;
 
-        public ProtocolActionBuilder() {
+        public ProtocolActionBuilder() throws IOException {
             this.pointQueryTemplate = getPointQueryTemplate();
             this.rangeQueryTemplate = getRangeQueryTemplate();
         }
 
-        private String getRangeQueryTemplate() {
-            try {
-                Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve(
-                        "8_q2.aql");
-                return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath)))
-                        .toString();
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
+        private String getRangeQueryTemplate() throws IOException {
+            Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_q2.aql");
+            return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath))).toString();
         }
 
-        private String getPointQueryTemplate() {
-            try {
-                Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve(
-                        "8_q1.aql");
-                return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath)))
-                        .toString();
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
+        private String getPointQueryTemplate() throws IOException {
+            Path aqlTemplateFilePath = localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_q1.aql");
+            return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(aqlTemplateFilePath))).toString();
         }
 
         @Override
         public IAction buildAction(int round) throws Exception {
             SequentialActionList protoAction = new SequentialActionList();
-            IAction pointQueryAction = new TimedAction(new RunAQLStringAction(httpClient,
restHost, restPort,
-                    getPointLookUpAQL(round)));
-            IAction rangeQueryAction = new TimedAction(new RunAQLStringAction(httpClient,
restHost, restPort,
-                    getRangeAQL(round)));
+            IAction pointQueryAction = new TimedAction(
+                    new RunAQLStringAction(httpClient, restHost, restPort, getPointLookUpAQL(round)));
+            IAction rangeQueryAction = new TimedAction(
+                    new RunAQLStringAction(httpClient, restHost, restPort, getRangeAQL(round)));
             protoAction.add(pointQueryAction);
             protoAction.add(rangeQueryAction);
             return protoAction;
diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8ABuilder.java
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8ABuilder.java
index e7cb68f..78ac504 100644
--- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8ABuilder.java
+++ b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8ABuilder.java
@@ -24,9 +24,11 @@
 import org.apache.asterix.experiment.client.LSMExperimentConstants;
 import org.apache.asterix.experiment.client.LSMExperimentSetRunner.LSMExperimentSetRunnerConfig;
 
+import java.io.IOException;
+
 public class Experiment8ABuilder extends AbstractExperiment8Builder {
 
-    public Experiment8ABuilder(LSMExperimentSetRunnerConfig config) {
+    public Experiment8ABuilder(LSMExperimentSetRunnerConfig config) throws IOException {
         super("8A", config, "8node.xml", "base_8_ingest.aql", "8.dgen");
     }
 
diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8BBuilder.java
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8BBuilder.java
index f97d431..71c8e48 100644
--- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8BBuilder.java
+++ b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8BBuilder.java
@@ -19,6 +19,8 @@
 
 package org.apache.asterix.experiment.builder;
 
+import java.io.IOException;
+
 import org.apache.asterix.experiment.action.base.SequentialActionList;
 import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
 import org.apache.asterix.experiment.client.LSMExperimentConstants;
@@ -26,13 +28,13 @@
 
 public class Experiment8BBuilder extends AbstractExperiment8Builder {
 
-    public Experiment8BBuilder(LSMExperimentSetRunnerConfig config) {
+    public Experiment8BBuilder(LSMExperimentSetRunnerConfig config) throws IOException {
         super("8B", config, "8node.xml", "base_8_ingest.aql", "8.dgen");
     }
 
     @Override
     protected void doBuildDDL(SequentialActionList seq) {
-        seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
-                LSMExperimentConstants.AQL_DIR).resolve("8_b.aql")));
+        seq.add(new RunAQLFileAction(httpClient, restHost, restPort,
+                localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_b.aql")));
     }
 }
diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8CBuilder.java
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8CBuilder.java
index d578fbb..a05a91e 100644
--- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8CBuilder.java
+++ b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8CBuilder.java
@@ -19,6 +19,8 @@
 
 package org.apache.asterix.experiment.builder;
 
+import java.io.IOException;
+
 import org.apache.asterix.experiment.action.base.SequentialActionList;
 import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
 import org.apache.asterix.experiment.client.LSMExperimentConstants;
@@ -26,13 +28,13 @@
 
 public class Experiment8CBuilder extends AbstractExperiment8Builder {
 
-    public Experiment8CBuilder(LSMExperimentSetRunnerConfig config) {
+    public Experiment8CBuilder(LSMExperimentSetRunnerConfig config) throws IOException {
         super("8C", config, "8node.xml", "base_8_ingest.aql", "8.dgen");
     }
 
     @Override
     protected void doBuildDDL(SequentialActionList seq) {
-        seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
-                LSMExperimentConstants.AQL_DIR).resolve("8_c.aql")));
+        seq.add(new RunAQLFileAction(httpClient, restHost, restPort,
+                localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_c.aql")));
     }
 }
diff --git a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8DBuilder.java
b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8DBuilder.java
index 94f9351..c7a6247 100644
--- a/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8DBuilder.java
+++ b/asterixdb/asterix-experiments/src/main/java/org/apache/asterix/experiment/builder/Experiment8DBuilder.java
@@ -19,6 +19,8 @@
 
 package org.apache.asterix.experiment.builder;
 
+import java.io.IOException;
+
 import org.apache.asterix.experiment.action.base.SequentialActionList;
 import org.apache.asterix.experiment.action.derived.RunAQLFileAction;
 import org.apache.asterix.experiment.client.LSMExperimentConstants;
@@ -26,13 +28,13 @@
 
 public class Experiment8DBuilder extends AbstractExperiment8Builder {
 
-    public Experiment8DBuilder(LSMExperimentSetRunnerConfig config) {
+    public Experiment8DBuilder(LSMExperimentSetRunnerConfig config) throws IOException {
         super("8D", config, "8node.xml", "base_8_ingest.aql", "8.dgen");
     }
 
     @Override
     protected void doBuildDDL(SequentialActionList seq) {
-        seq.add(new RunAQLFileAction(httpClient, restHost, restPort, localExperimentRoot.resolve(
-                LSMExperimentConstants.AQL_DIR).resolve("8_d.aql")));
+        seq.add(new RunAQLFileAction(httpClient, restHost, restPort,
+                localExperimentRoot.resolve(LSMExperimentConstants.AQL_DIR).resolve("8_d.aql")));
     }
 }
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/FilesIndexDescription.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/FilesIndexDescription.java
index fa81583..3872302 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/FilesIndexDescription.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/FilesIndexDescription.java
@@ -62,13 +62,7 @@
             AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(BuiltinType.AINT32,
true) };
 
     public FilesIndexDescription() {
-        ARecordType type;
-        try {
-            type = new ARecordType("ExternalFileRecordType", payloadFieldNames, payloadFieldTypes,
true);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
+        ARecordType type = new ARecordType("ExternalFileRecordType", payloadFieldNames, payloadFieldTypes,
true);
         EXTERNAL_FILE_RECORD_TYPE = type;
         EXTERNAL_FILE_INDEX_TYPE_TRAITS[FILE_KEY_INDEX] = AqlTypeTraitProvider.INSTANCE
                 .getTypeTrait(IndexingConstants.FILE_NUMBER_FIELD_TYPE);
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/hash/ListItemBinaryHashFunctionFactory.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/hash/ListItemBinaryHashFunctionFactory.java
index 493833b..d7cf9ae 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/hash/ListItemBinaryHashFunctionFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/hash/ListItemBinaryHashFunctionFactory.java
@@ -80,7 +80,7 @@
                                 resetTaggedBytes(bytes, offset, length);
                                 return genericBinaryHash.hash(taggedBytes.getByteArray(),
0, length + 1);
                             } catch (IOException e) {
-                                throw new RuntimeException(e);
+                                throw new HyracksDataException(e);
                             }
                         } else {
                             return genericBinaryHash.hash(bytes, offset, length);
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksJobletContext.java
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksJobletContext.java
index bf25d13..2ea657a 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksJobletContext.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksJobletContext.java
@@ -19,6 +19,7 @@
 package org.apache.hyracks.api.context;
 
 import org.apache.hyracks.api.application.INCApplicationContext;
+import org.apache.hyracks.api.exceptions.HyracksException;
 import org.apache.hyracks.api.io.IWorkspaceFileFactory;
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.api.job.profiling.counters.ICounterContext;
@@ -33,7 +34,7 @@
 
     public Object getGlobalJobData();
 
-    public Class<?> loadClass(String className);
+    public Class<?> loadClass(String className) throws HyracksException;
 
-    public ClassLoader getClassLoader();
+    public ClassLoader getClassLoader() throws HyracksException;
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/deployment/DeploymentUtils.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/deployment/DeploymentUtils.java
index aaf2e20..e033ff9 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/deployment/DeploymentUtils.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/deployment/DeploymentUtils.java
@@ -21,6 +21,7 @@
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URL;
@@ -33,7 +34,6 @@
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.HttpClientBuilder;
-
 import org.apache.hyracks.api.application.IApplicationContext;
 import org.apache.hyracks.api.deployment.DeploymentId;
 import org.apache.hyracks.api.exceptions.HyracksException;
@@ -119,8 +119,8 @@
             throws HyracksException {
         try {
             IJobSerializerDeserializerContainer jobSerDeContainer = appCtx.getJobSerializerDeserializerContainer();
-            IJobSerializerDeserializer jobSerDe = deploymentId == null ? null : jobSerDeContainer
-                    .getJobSerializerDeserializer(deploymentId);
+            IJobSerializerDeserializer jobSerDe = deploymentId == null ? null
+                    : jobSerDeContainer.getJobSerializerDeserializer(deploymentId);
             Object obj = jobSerDe == null ? JavaSerializationUtils.deserialize(bytes) : jobSerDe.deserialize(bytes);
             return obj;
         } catch (Exception e) {
@@ -141,12 +141,10 @@
             throws HyracksException {
         try {
             IJobSerializerDeserializerContainer jobSerDeContainer = appCtx.getJobSerializerDeserializerContainer();
-            IJobSerializerDeserializer jobSerDe = deploymentId == null ? null : jobSerDeContainer
-                    .getJobSerializerDeserializer(deploymentId);
-            Class<?> cl = jobSerDe == null ? JavaSerializationUtils.loadClass(className)
: jobSerDe
-                    .loadClass(className);
-            return cl;
-        } catch (Exception e) {
+            IJobSerializerDeserializer jobSerDe = deploymentId == null ? null
+                    : jobSerDeContainer.getJobSerializerDeserializer(deploymentId);
+            return jobSerDe == null ? JavaSerializationUtils.loadClass(className) : jobSerDe.loadClass(className);
+        } catch (ClassNotFoundException | IOException e) {
             throw new HyracksException(e);
         }
     }
@@ -161,15 +159,10 @@
      */
     public static ClassLoader getClassLoader(DeploymentId deploymentId, IApplicationContext
appCtx)
             throws HyracksException {
-        try {
-            IJobSerializerDeserializerContainer jobSerDeContainer = appCtx.getJobSerializerDeserializerContainer();
-            IJobSerializerDeserializer jobSerDe = deploymentId == null ? null : jobSerDeContainer
-                    .getJobSerializerDeserializer(deploymentId);
-            ClassLoader cl = jobSerDe == null ? DeploymentUtils.class.getClassLoader() :
jobSerDe.getClassLoader();
-            return cl;
-        } catch (Exception e) {
-            throw new HyracksException(e);
-        }
+        IJobSerializerDeserializerContainer jobSerDeContainer = appCtx.getJobSerializerDeserializerContainer();
+        IJobSerializerDeserializer jobSerDe = deploymentId == null ? null
+                : jobSerDeContainer.getJobSerializerDeserializer(deploymentId);
+        return jobSerDe == null ? DeploymentUtils.class.getClassLoader() : jobSerDe.getClassLoader();
     }
 
     /**
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Joblet.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Joblet.java
index 7412e36..0d9ff5d 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Joblet.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Joblet.java
@@ -234,7 +234,7 @@
         if (appCtx.getMemoryManager().allocate(bytes)) {
             memoryAllocation.addAndGet(bytes);
             return frameManager.allocateFrame(bytes);
-       }
+        }
         throw new HyracksDataException("Unable to allocate frame: Not enough memory");
     }
 
@@ -326,20 +326,12 @@
     }
 
     @Override
-    public Class<?> loadClass(String className) {
-        try {
-            return DeploymentUtils.loadClass(className, deploymentId, appCtx);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+    public Class<?> loadClass(String className) throws HyracksException {
+        return DeploymentUtils.loadClass(className, deploymentId, appCtx);
     }
 
     @Override
-    public ClassLoader getClassLoader() {
-        try {
-            return DeploymentUtils.getClassLoader(deploymentId, appCtx);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+    public ClassLoader getClassLoader() throws HyracksException {
+        return DeploymentUtils.getClassLoader(deploymentId, appCtx);
     }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8fff04c314eb146ce0a73beb0b8ec412cb2d280
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mblow@apache.org>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>

Mime
View raw message