asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [1/3] asterixdb git commit: Runtime ErrorCode fix in external data
Date Sun, 08 Jan 2017 04:13:44 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 90cdbac7f -> 024fafe2e


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/StreamRecordReaderProvider.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/StreamRecordReaderProvider.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/StreamRecordReaderProvider.java
index d11e97f..261a63c 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/StreamRecordReaderProvider.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/StreamRecordReaderProvider.java
@@ -21,6 +21,8 @@ package org.apache.asterix.external.provider;
 import java.util.Map;
 
 import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.asterix.common.exceptions.RuntimeDataException;
 import org.apache.asterix.external.api.AsterixInputStream;
 import org.apache.asterix.external.input.record.reader.stream.EmptyLineSeparatedRecordReader;
 import org.apache.asterix.external.input.record.reader.stream.LineRecordReader;
@@ -75,7 +77,7 @@ public class StreamRecordReaderProvider {
                         configuration.get(ExternalDataConstants.KEY_RECORD_START),
                         configuration.get(ExternalDataConstants.KEY_RECORD_END));
             default:
-                throw new HyracksDataException("Unknown format: " + format);
+                throw new RuntimeDataException(ErrorCode.PROVIDER_STREAM_RECORD_READER_UNKNOWN_FORMAT, format);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/DataflowUtils.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/DataflowUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/DataflowUtils.java
index ed811ad..31a223f 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/DataflowUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/DataflowUtils.java
@@ -20,6 +20,8 @@ package org.apache.asterix.external.util;
 
 import java.util.Map;
 
+import org.apache.asterix.common.exceptions.RuntimeDataException;
+import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.external.api.ITupleForwarder;
 import org.apache.asterix.external.api.ITupleForwarder.TupleForwardPolicy;
 import org.apache.asterix.external.dataflow.CounterTimerTupleForwarder;
@@ -38,7 +40,7 @@ public class DataflowUtils {
         if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
             appender.write(writer, true);
             if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
-                throw new HyracksDataException("Tuple is too large for a frame");
+                throw new RuntimeDataException(ErrorCode.UTIL_DATAFLOW_UTILS_TUPLE_TOO_LARGE);
             }
         }
     }
@@ -65,7 +67,7 @@ public class DataflowUtils {
             case RATE_CONTROLLED:
                 return RateControlledTupleForwarder.create(configuration);
             default:
-                throw new HyracksDataException("Unknown tuple forward policy");
+                throw new RuntimeDataException(ErrorCode.UTIL_DATAFLOW_UTILS_UNKNOWN_FORWARD_POLICY);
         }
     }
 
@@ -74,7 +76,7 @@ public class DataflowUtils {
         if (!appender.append(tuple)) {
             appender.write(writer, true);
             if (!appender.append(tuple)) {
-                throw new HyracksDataException("Tuple is too large for a frame");
+                throw new RuntimeDataException(ErrorCode.UTIL_DATAFLOW_UTILS_TUPLE_TOO_LARGE);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
index 8eb8815..d009960 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
@@ -22,6 +22,8 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.asterix.common.exceptions.RuntimeDataException;
 import org.apache.asterix.common.library.ILibraryManager;
 import org.apache.asterix.external.api.IDataParserFactory;
 import org.apache.asterix.external.api.IExternalDataSourceFactory.DataSourceType;
@@ -31,6 +33,7 @@ import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.AUnionType;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.data.parsers.DoubleParserFactory;
 import org.apache.hyracks.dataflow.common.data.parsers.FloatParserFactory;
 import org.apache.hyracks.dataflow.common.data.parsers.IValueParserFactory;
@@ -127,14 +130,14 @@ public class ExternalDataUtils {
     }
 
     public static IInputStreamFactory createExternalInputStreamFactory(ILibraryManager libraryManager, String dataverse,
-            String stream) throws AsterixException {
+            String stream) throws HyracksDataException {
         try {
             String libraryName = getLibraryName(stream);
             String className = getExternalClassName(stream);
             ClassLoader classLoader = getClassLoader(libraryManager, dataverse, libraryName);
             return ((IInputStreamFactory) (classLoader.loadClass(className).newInstance()));
         } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
-            throw new AsterixException("Failed to create stream factory", e);
+            throw new RuntimeDataException(ErrorCode.UTIL_EXTERNAL_DATA_UTILS_FAIL_CREATE_STREAM_FACTORY, e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FileSystemWatcher.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FileSystemWatcher.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FileSystemWatcher.java
index ea5cc8f..258f194 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FileSystemWatcher.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FileSystemWatcher.java
@@ -36,6 +36,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.locks.ReentrantLock;
 
+import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.asterix.common.exceptions.RuntimeDataException;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
@@ -95,7 +97,8 @@ public class FileSystemWatcher {
                     resume();
                 } else {
                     if (files.isEmpty()) {
-                        throw new HyracksDataException(path + ": no files found");
+                        throw new RuntimeDataException(ErrorCode.UTIL_FILE_SYSTEM_WATCHER_NO_FILES_FOUND,
+                                path.toString());
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/HDFSUtils.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/HDFSUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/HDFSUtils.java
index 826a396..42b582b 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/HDFSUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/HDFSUtils.java
@@ -25,6 +25,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.asterix.common.config.DatasetConfig.ExternalFilePendingOp;
+import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.asterix.common.exceptions.RuntimeDataException;
 import org.apache.asterix.external.indexing.ExternalFile;
 import org.apache.asterix.external.indexing.IndexingScheduler;
 import org.apache.asterix.external.indexing.RecordId.RecordIdType;
@@ -43,31 +45,32 @@ import org.apache.hadoop.mapred.SequenceFileInputFormat;
 import org.apache.hadoop.mapred.TextInputFormat;
 import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
 import org.apache.hyracks.api.context.ICCContext;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.exceptions.HyracksException;
 import org.apache.hyracks.hdfs.scheduler.Scheduler;
 
 public class HDFSUtils {
 
-    public static Scheduler initializeHDFSScheduler() {
+    public static Scheduler initializeHDFSScheduler() throws  HyracksDataException {
         ICCContext ccContext = AppContextInfo.INSTANCE.getCCApplicationContext().getCCContext();
         Scheduler scheduler = null;
         try {
             scheduler = new Scheduler(ccContext.getClusterControllerInfo().getClientNetAddress(),
                     ccContext.getClusterControllerInfo().getClientNetPort());
         } catch (HyracksException e) {
-            throw new IllegalStateException("Cannot obtain hdfs scheduler");
+            throw new RuntimeDataException(ErrorCode.UTIL_HDFS_UTILS_CANNOT_OBTAIN_HDFS_SCHEDULER);
         }
         return scheduler;
     }
 
-    public static IndexingScheduler initializeIndexingHDFSScheduler() {
+    public static IndexingScheduler initializeIndexingHDFSScheduler() throws HyracksDataException {
         ICCContext ccContext = AppContextInfo.INSTANCE.getCCApplicationContext().getCCContext();
         IndexingScheduler scheduler = null;
         try {
             scheduler = new IndexingScheduler(ccContext.getClusterControllerInfo().getClientNetAddress(),
                     ccContext.getClusterControllerInfo().getClientNetPort());
         } catch (HyracksException e) {
-            throw new IllegalStateException("Cannot obtain hdfs scheduler");
+            throw new RuntimeDataException(ErrorCode.UTIL_HDFS_UTILS_CANNOT_OBTAIN_HDFS_SCHEDULER);
         }
         return scheduler;
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/LocalFileSystemUtils.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/LocalFileSystemUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/LocalFileSystemUtils.java
index 16dd1e9..f6046ef 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/LocalFileSystemUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/LocalFileSystemUtils.java
@@ -29,7 +29,8 @@ import java.nio.file.attribute.BasicFileAttributes;
 import java.util.LinkedList;
 import java.util.regex.Pattern;
 
-import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.asterix.common.exceptions.RuntimeDataException;
 
 public class LocalFileSystemUtils {
 
@@ -37,7 +38,8 @@ public class LocalFileSystemUtils {
             final LinkedList<Path> dirs) throws IOException {
         final Path path = root.toPath();
         if (!Files.exists(path)) {
-            throw new HyracksDataException(path + ": path not found");
+            throw new RuntimeDataException(ErrorCode.UTIL_LOCAL_FILE_SYSTEM_UTILS_PATH_NOT_FOUND,
+                    path.toString());
         }
         if (!Files.isDirectory(path)) {
             validateAndAdd(path, expression, files);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/NodeResolver.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/NodeResolver.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/NodeResolver.java
index 52c2850..222d49d 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/NodeResolver.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/NodeResolver.java
@@ -28,6 +28,7 @@ import java.util.Random;
 import java.util.Set;
 
 import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.external.api.INodeResolver;
 import org.apache.asterix.runtime.util.RuntimeUtils;
 
@@ -61,21 +62,20 @@ public class NodeResolver implements INodeResolver {
                     if (ncs.contains(value)) {
                         return value;
                     } else {
-                        throw new AsterixException("address passed: '" + value
-                                + "' couldn't be resolved to an ip address and is not an NC id. Existing NCs are "
-                                + ncs.toString(), uhe);
+                        throw new AsterixException(ErrorCode.NODE_RESOLVER_COULDNT_RESOLVE_ADDRESS, uhe, value,
+                                ncs.toString());
                     }
                 }
 
             }
             Set<String> nodeControllers = ncMap.get(ipAddress);
             if (nodeControllers == null || nodeControllers.isEmpty()) {
-                throw new AsterixException(" No node controllers found at the address: " + value);
+                throw new AsterixException(ErrorCode.NODE_RESOLVER_NO_NODE_CONTROLLERS, value);
             }
             String chosenNCId = nodeControllers.toArray(new String[] {})[random.nextInt(nodeControllers.size())];
             return chosenNCId;
         } catch (UnknownHostException e) {
-            throw new AsterixException("Unable to resolve hostname '" + value + "' to an IP address");
+            throw new AsterixException(ErrorCode.NODE_RESOLVER_UNABLE_RESOLVE_HOST, value);
         } catch (AsterixException ae) {
             throw ae;
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsFunction.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsFunction.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsFunction.java
index db717e6..96a40fb 100644
--- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsFunction.java
+++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsFunction.java
@@ -34,7 +34,7 @@ public class AddHashTagsFunction implements IExternalScalarFunction {
     private JPoint location = null;
 
     @Override
-    public void initialize(IFunctionHelper functionHelper) {
+    public void initialize(IFunctionHelper functionHelper) throws Exception {
         list = new JUnorderedList(functionHelper.getObject(JTypeTag.STRING));
         location = new JPoint(0, 0);
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsInPlaceFunction.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsInPlaceFunction.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsInPlaceFunction.java
index b8f9165..57c8f1d 100644
--- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsInPlaceFunction.java
+++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AddHashTagsInPlaceFunction.java
@@ -31,7 +31,7 @@ public class AddHashTagsInPlaceFunction implements IExternalScalarFunction {
     private JUnorderedList list = null;
 
     @Override
-    public void initialize(IFunctionHelper functionHelper) {
+    public void initialize(IFunctionHelper functionHelper) throws Exception {
         list = new JUnorderedList(functionHelper.getObject(JTypeTag.STRING));
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AllTypesFunction.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AllTypesFunction.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AllTypesFunction.java
index 8f65bee..aad83dd 100644
--- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AllTypesFunction.java
+++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/AllTypesFunction.java
@@ -44,7 +44,7 @@ public class AllTypesFunction implements IExternalScalarFunction {
     private JOrderedList newFieldList;
 
     @Override
-    public void initialize(IFunctionHelper functionHelper) {
+    public void initialize(IFunctionHelper functionHelper) throws Exception {
         newFieldList = new JOrderedList(functionHelper.getObject(JTypeTag.INT));
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ClassAdParser.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ClassAdParser.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ClassAdParser.java
index adffe1e..40523ab 100644
--- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ClassAdParser.java
+++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ClassAdParser.java
@@ -1744,7 +1744,7 @@ public class ClassAdParser extends AbstractDataParser implements IRecordDataPars
     }
 
     @Override
-    public void parse(IRawRecord<? extends char[]> record, DataOutput out) throws IOException {
+    public void parse(IRawRecord<? extends char[]> record, DataOutput out) throws HyracksDataException {
         try {
             resetPools();
             if (oldFormat) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ParseTweetFunction.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ParseTweetFunction.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ParseTweetFunction.java
index b9c736a..7167ac9 100644
--- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ParseTweetFunction.java
+++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/library/ParseTweetFunction.java
@@ -24,13 +24,14 @@ import org.apache.asterix.external.library.java.JObjects.JUnorderedList;
 import org.apache.asterix.external.api.IExternalScalarFunction;
 import org.apache.asterix.external.api.IFunctionHelper;
 import org.apache.asterix.external.library.java.JTypeTag;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public class ParseTweetFunction implements IExternalScalarFunction {
 
     private JUnorderedList list = null;
 
     @Override
-    public void initialize(IFunctionHelper functionHelper) {
+    public void initialize(IFunctionHelper functionHelper) throws Exception {
         list = new JUnorderedList(functionHelper.getObject(JTypeTag.STRING));
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
index fd617bd..21a1430 100644
--- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
+++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/TestRecordWithPKParser.java
@@ -25,6 +25,7 @@ import org.apache.asterix.external.api.IRawRecord;
 import org.apache.asterix.external.api.IRecordDataParser;
 import org.apache.asterix.external.api.IRecordWithPKDataParser;
 import org.apache.asterix.external.input.record.RecordWithPK;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 
 public class TestRecordWithPKParser<T> implements IRecordWithPKDataParser<RecordWithPK<T>> {
@@ -36,13 +37,14 @@ public class TestRecordWithPKParser<T> implements IRecordWithPKDataParser<Record
     }
 
     @Override
-    public void parse(final IRawRecord<? extends RecordWithPK<T>> record, final DataOutput out) throws IOException {
+    public void parse(final IRawRecord<? extends RecordWithPK<T>> record, final DataOutput out) throws
+            HyracksDataException {
         recordParser.parse(record.get().getRecord(), out);
     }
 
     @Override
     public void appendKeys(final ArrayTupleBuilder tb, final IRawRecord<? extends RecordWithPK<T>> record)
-            throws IOException {
+            throws HyracksDataException {
         record.get().appendPrimaryKeyToTuple(tb);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java
index b3cf694..cf57dfe 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java
@@ -83,7 +83,7 @@ public class LangRecordParseUtil {
                 parseList((ListConstructor) expr, serialized);
                 break;
             default:
-                throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.ERROR_PARSE_ERROR,
+                throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR,
                         NOT_ALLOWED_EXPRESSIONS_ERROR_MESSAGE, new Serializable[] { Expression.Kind.LITERAL_EXPRESSION
                                 .toString(), Expression.Kind.RECORD_CONSTRUCTOR_EXPRESSION.toString(),
                                 Expression.Kind.LIST_CONSTRUCTOR_EXPRESSION.toString() });
@@ -129,13 +129,13 @@ public class LangRecordParseUtil {
 
     public static Literal exprToStringLiteral(Expression expr) throws HyracksDataException {
         if (expr.getKind() != Expression.Kind.LITERAL_EXPRESSION) {
-            throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.ERROR_PARSE_ERROR,
+            throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR,
                     "Expected expression can only be of type %1$s", Expression.Kind.LITERAL_EXPRESSION);
         }
         LiteralExpr keyLiteralExpr = (LiteralExpr) expr;
         Literal keyLiteral = keyLiteralExpr.getValue();
         if (keyLiteral.getLiteralType() != Literal.Type.STRING) {
-            throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.ERROR_PARSE_ERROR,
+            throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR,
                     "Expected Literal can only be of type %1$s", Literal.Type.STRING);
         }
         return keyLiteral;
@@ -144,7 +144,7 @@ public class LangRecordParseUtil {
     private static void parseList(ListConstructor valueExpr, ArrayBackedValueStorage serialized)
             throws HyracksDataException {
         if (valueExpr.getType() != ListConstructor.Type.ORDERED_LIST_CONSTRUCTOR) {
-            throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.ERROR_PARSE_ERROR,
+            throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR,
                     "JSON List can't be of type %1$s", valueExpr.getType());
         }
         ArrayBackedValueStorage serializedValue = new ArrayBackedValueStorage();
@@ -187,7 +187,7 @@ public class LangRecordParseUtil {
                 stringSerde.serialize(new AString((String) value.getValue()), serialized.getDataOutput());
                 break;
             default:
-                throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.ERROR_PARSE_ERROR,
+                throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR,
                         "Unknown Literal Type %1$s", value.getLiteralType());
         }
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/IncompatibleTypeException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/IncompatibleTypeException.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/IncompatibleTypeException.java
index 728cd0c..531d752 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/IncompatibleTypeException.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/IncompatibleTypeException.java
@@ -30,11 +30,11 @@ public class IncompatibleTypeException extends CompilationException {
 
     // Incompatible input parameters, e.g., "1.0" > 1.0
     public IncompatibleTypeException(FunctionIdentifier fid, ATypeTag typeTagLeft, ATypeTag typeTagRight) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_INCOMPATIBLE, fid.getName(), typeTagLeft, typeTagRight);
+        super(ErrorCode.COMPILATION_TYPE_INCOMPATIBLE, fid.getName(), typeTagLeft, typeTagRight);
     }
 
     // Incompatible input parameters, e.g., "1.0" > 1.0
     public IncompatibleTypeException(String functionName, ATypeTag typeTagLeft, ATypeTag typeTagRight) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_INCOMPATIBLE, functionName, typeTagLeft, typeTagRight);
+        super(ErrorCode.COMPILATION_TYPE_INCOMPATIBLE, functionName, typeTagLeft, typeTagRight);
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/InvalidExpressionException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/InvalidExpressionException.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/InvalidExpressionException.java
index c381b7b..1745bca 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/InvalidExpressionException.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/InvalidExpressionException.java
@@ -34,14 +34,14 @@ public class InvalidExpressionException extends CompilationException {
 
     public InvalidExpressionException(FunctionIdentifier fid, int index, ILogicalExpression actualExpr,
             LogicalExpressionTag... exprKinds) {
-        super(ErrorCode.ERROR_COMPILATION_INVALID_EXPRESSION, fid.getName(), indexToPosition(index),
+        super(ErrorCode.COMPILATION_INVALID_EXPRESSION, fid.getName(), indexToPosition(index),
                 actualExpr.toString(),
                 toExpectedTypeString(exprKinds));
     }
 
     public InvalidExpressionException(String functionName, int index, ILogicalExpression actualExpr,
             LogicalExpressionTag... exprKinds) {
-        super(ErrorCode.ERROR_COMPILATION_INVALID_EXPRESSION, functionName, indexToPosition(index),
+        super(ErrorCode.COMPILATION_INVALID_EXPRESSION, functionName, indexToPosition(index),
                 actualExpr.toString(),
                 toExpectedTypeString(exprKinds));
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/TypeMismatchException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/TypeMismatchException.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/TypeMismatchException.java
index c0ab958..b9dd568 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/TypeMismatchException.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/TypeMismatchException.java
@@ -34,13 +34,13 @@ public class TypeMismatchException extends CompilationException {
     // Parameter type mistmatch.
     public TypeMismatchException(FunctionIdentifier fid, Integer i, ATypeTag actualTypeTag,
             ATypeTag... expectedTypeTags) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_MISMATCH, fid.getName(), indexToPosition(i),
+        super(ErrorCode.COMPILATION_TYPE_MISMATCH, fid.getName(), indexToPosition(i),
                 toExpectedTypeString(expectedTypeTags), actualTypeTag);
     }
 
     // Parameter type mistmatch.
     public TypeMismatchException(String functionName, Integer i, ATypeTag actualTypeTag, ATypeTag... expectedTypeTags) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_MISMATCH, functionName, indexToPosition(i),
+        super(ErrorCode.COMPILATION_TYPE_MISMATCH, functionName, indexToPosition(i),
                 toExpectedTypeString(expectedTypeTags), actualTypeTag);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedItemTypeException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedItemTypeException.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedItemTypeException.java
index d1288aa..740703c 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedItemTypeException.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedItemTypeException.java
@@ -30,11 +30,11 @@ public class UnsupportedItemTypeException extends CompilationException {
 
     // Unsupported item type.
     public UnsupportedItemTypeException(FunctionIdentifier fid, ATypeTag itemTypeTag) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_ITEM, fid.getName(), itemTypeTag);
+        super(ErrorCode.COMPILATION_TYPE_ITEM, fid.getName(), itemTypeTag);
     }
 
     // Unsupported item type.
     public UnsupportedItemTypeException(String functionName, ATypeTag itemTypeTag) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_ITEM, functionName, itemTypeTag);
+        super(ErrorCode.COMPILATION_TYPE_ITEM, functionName, itemTypeTag);
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedTypeException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedTypeException.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedTypeException.java
index 42e234f..64f1c2f 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedTypeException.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/exceptions/UnsupportedTypeException.java
@@ -30,11 +30,11 @@ public class UnsupportedTypeException extends CompilationException {
 
     // Unsupported input type.
     public UnsupportedTypeException(FunctionIdentifier fid, ATypeTag actualTypeTag) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_UNSUPPORTED, fid.getName(), actualTypeTag);
+        super(ErrorCode.COMPILATION_TYPE_UNSUPPORTED, fid.getName(), actualTypeTag);
     }
 
     // Unsupported input type.
     public UnsupportedTypeException(String funcName, ATypeTag actualTypeTag) {
-        super(ErrorCode.ERROR_COMPILATION_TYPE_UNSUPPORTED, funcName, actualTypeTag);
+        super(ErrorCode.COMPILATION_TYPE_UNSUPPORTED, funcName, actualTypeTag);
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
index d18b4d1..e0deb5a 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
@@ -234,7 +234,7 @@ class ARecordCaster {
                         fieldPermutation[reqFnPos] = fnPos;
                         openFields[fnPos] = false;
                     } else {
-                        throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.ERROR_CASTING_FIELD,
+                        throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.CASTING_FIELD,
                                 "Field type %1$s can't be promoted to type %2$s", inputTypeTag, requiredTypeTag);
                     }
                 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java
index 2b4cbe8..c91a4e3 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java
@@ -90,7 +90,7 @@ public class RecordMergeTypeComputer implements IResultTypeComputer {
             if (pos >= 0) {
                 IAType resultFieldType = resultFieldTypes.get(pos);
                 if (resultFieldType.getTypeTag() != fieldTypes[i].getTypeTag()) {
-                    throw new CompilationException(ErrorCode.ERROR_COMPILATION_DUPLICATE_FIELD_NAME, fieldNames[i]);
+                    throw new CompilationException(ErrorCode.COMPILATION_DUPLICATE_FIELD_NAME, fieldNames[i]);
                 }
                 // Assuming fieldTypes[i].getTypeTag() = resultFieldType.getTypeTag()
                 if (fieldTypes[i].getTypeTag() == ATypeTag.RECORD) {
@@ -118,7 +118,7 @@ public class RecordMergeTypeComputer implements IResultTypeComputer {
 
     private IAType mergedNestedType(String fieldName, IAType fieldType1, IAType fieldType0) throws AlgebricksException {
         if (fieldType1.getTypeTag() != ATypeTag.RECORD || fieldType0.getTypeTag() != ATypeTag.RECORD) {
-            throw new CompilationException(ErrorCode.ERROR_COMPILATION_DUPLICATE_FIELD_NAME, fieldName);
+            throw new CompilationException(ErrorCode.COMPILATION_DUPLICATE_FIELD_NAME, fieldName);
         }
 
         ARecordType resultType = (ARecordType) fieldType0;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/SwitchCaseComputer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/SwitchCaseComputer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/SwitchCaseComputer.java
index c112bf2..fa2bf5b 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/SwitchCaseComputer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/SwitchCaseComputer.java
@@ -47,7 +47,7 @@ public class SwitchCaseComputer implements IResultTypeComputer {
 
         int argNumber = fce.getArguments().size();
         if (argNumber < 3) {
-            throw new CompilationException(ErrorCode.ERROR_COMPILATION_INVALID_PARAMETER_NUMBER, funcName, argNumber);
+            throw new CompilationException(ErrorCode.COMPILATION_INVALID_PARAMETER_NUMBER, funcName, argNumber);
         }
         int argSize = fce.getArguments().size();
         List<IAType> types = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
index 515ea67..9212949 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
@@ -660,7 +660,7 @@ public class ATypeHierarchy {
         ATypeTag sourceTypeTag = ATypeTag.VALUE_TYPE_MAPPING[bytes[typeTagPosition]];
 
         if (sourceTypeTag == null) {
-            throw new RuntimeDataException(ErrorCode.ERROR_INVALID_FORMAT, name, argIndex);
+            throw new RuntimeDataException(ErrorCode.INVALID_FORMAT, name, argIndex);
         }
         switch (sourceTypeTag) {
             case INT64:
@@ -682,7 +682,7 @@ public class ATypeHierarchy {
                 value = (int) DoublePointable.getDouble(bytes, offset);
                 break;
             default:
-                throw new RuntimeDataException(ErrorCode.ERROR_TYPE_MISMATCH, name, argIndex, sourceTypeTag,
+                throw new RuntimeDataException(ErrorCode.TYPE_MISMATCH, name, argIndex, sourceTypeTag,
                         ATypeTag.INT8, ATypeTag.INT16, ATypeTag.INT32, ATypeTag.INT64, ATypeTag.FLOAT, ATypeTag.DOUBLE);
 
         }
@@ -701,7 +701,7 @@ public class ATypeHierarchy {
         long value;
         ATypeTag sourceTypeTag = ATypeTag.VALUE_TYPE_MAPPING[bytes[typeTagPosition]];
         if (sourceTypeTag == null) {
-            throw new RuntimeDataException(ErrorCode.ERROR_INVALID_FORMAT, name, argIndex);
+            throw new RuntimeDataException(ErrorCode.INVALID_FORMAT, name, argIndex);
         }
         switch (sourceTypeTag) {
             case INT64:
@@ -723,7 +723,7 @@ public class ATypeHierarchy {
                 value = (long) DoublePointable.getDouble(bytes, offset);
                 break;
             default:
-                throw new RuntimeDataException(ErrorCode.ERROR_TYPE_MISMATCH, name, argIndex, sourceTypeTag,
+                throw new RuntimeDataException(ErrorCode.TYPE_MISMATCH, name, argIndex, sourceTypeTag,
                         ATypeTag.INT8, ATypeTag.INT16, ATypeTag.INT32, ATypeTag.INT64, ATypeTag.FLOAT, ATypeTag.DOUBLE);
         }
 
@@ -743,7 +743,7 @@ public class ATypeHierarchy {
         double value;
         ATypeTag sourceTypeTag = ATypeTag.VALUE_TYPE_MAPPING[bytes[typeTagPosition]];
         if (sourceTypeTag == null) {
-            throw new RuntimeDataException(ErrorCode.ERROR_INVALID_FORMAT, name, argIndex);
+            throw new RuntimeDataException(ErrorCode.INVALID_FORMAT, name, argIndex);
         }
         switch (sourceTypeTag) {
             case INT64:
@@ -765,7 +765,7 @@ public class ATypeHierarchy {
                 value = DoublePointable.getDouble(bytes, offset);
                 break;
             default:
-                throw new RuntimeDataException(ErrorCode.ERROR_TYPE_MISMATCH, name, argIndex, sourceTypeTag,
+                throw new RuntimeDataException(ErrorCode.TYPE_MISMATCH, name, argIndex, sourceTypeTag,
                         ATypeTag.INT8, ATypeTag.INT16, ATypeTag.INT32, ATypeTag.INT64, ATypeTag.FLOAT, ATypeTag.DOUBLE);
         }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
index 5a26b5e..164f369 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
@@ -75,7 +75,7 @@ public class InjectFailureDescriptor extends AbstractScalarFunctionDynamicDescri
                             boolean argResult = ABooleanSerializerDeserializer.getBoolean(argPtr.getByteArray(),
                                     argPtr.getStartOffset() + 1);
                             if (argResult) {
-                                throw new RuntimeDataException(ErrorCode.ERROR_INJECTED_FAILURE, getIdentifier());
+                                throw new RuntimeDataException(ErrorCode.INJECTED_FAILURE, getIdentifier());
                             }
                         }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRepeatDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRepeatDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRepeatDescriptor.java
index bb9a263..fe864f4 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRepeatDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRepeatDescriptor.java
@@ -87,7 +87,7 @@ public class StringRepeatDescriptor extends AbstractScalarFunctionDynamicDescrip
                                 offset);
                         // Checks repeatingTimes. It should be a non-negative value.
                         if (repeatingTimes < 0) {
-                            throw new RuntimeDataException(ErrorCode.ERROR_NEGATIVE_VALUE, getIdentifier(), 1,
+                            throw new RuntimeDataException(ErrorCode.NEGATIVE_VALUE, getIdentifier(), 1,
                                     repeatingTimes);
                         }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java
index ec8e409..5a36942 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java
@@ -91,7 +91,7 @@ public class Substring2Descriptor extends AbstractScalarFunctionDynamicDescripto
                         try {
                             UTF8StringPointable.substr(string, start, Integer.MAX_VALUE, builder, array);
                         } catch (StringIndexOutOfBoundsException e) {
-                            throw new RuntimeDataException(ErrorCode.ERROR_OUT_OF_BOUND, getIdentifier(), 1, start);
+                            throw new RuntimeDataException(ErrorCode.OUT_OF_BOUND, getIdentifier(), 1, start);
                         } catch (IOException e) {
                             throw new HyracksDataException(e);
                         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java
index 184773b..caaa11a 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java
@@ -103,7 +103,7 @@ public class SubstringDescriptor extends AbstractScalarFunctionDynamicDescriptor
                         try {
                             UTF8StringPointable.substr(string, start, len, builder, array);
                         } catch (StringIndexOutOfBoundsException e) {
-                            throw new RuntimeDataException(ErrorCode.ERROR_OUT_OF_BOUND, getIdentifier(), 1,
+                            throw new RuntimeDataException(ErrorCode.OUT_OF_BOUND, getIdentifier(), 1,
                                     start + len - 1);
                         } catch (IOException e) {
                             throw new HyracksDataException(e);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java
index 6b11353..5f2a730 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java
@@ -240,7 +240,7 @@ public class RecordAddFieldsDescriptor extends AbstractScalarFunctionDynamicDesc
                                     tempValReference.set(entry.getBuf(), entry.getOffset(), entry.getLength());
                                     // If value is not equal throw conflicting duplicate field, otherwise ignore
                                     if (!PointableHelper.byteArrayEqual(valuePointable, tempValReference)) {
-                                        throw new RuntimeDataException(ErrorCode.ERROR_DUPLICATE_FIELD_NAME,
+                                        throw new RuntimeDataException(ErrorCode.DUPLICATE_FIELD_NAME,
                                                 getIdentifier());
                                     }
                                 } else {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
index 2f33a4e..7a1e69f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
@@ -160,7 +160,7 @@ public class RecordMergeDescriptor extends AbstractScalarFunctionDynamicDescript
                                                 openFromParent, nestedLevel);
                                         foundMatch = true;
                                     } else {
-                                        throw new RuntimeDataException(ErrorCode.ERROR_DUPLICATE_FIELD_NAME,
+                                        throw new RuntimeDataException(ErrorCode.DUPLICATE_FIELD_NAME,
                                                 getIdentifier());
                                     }
                                 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/IncompatibleTypeException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/IncompatibleTypeException.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/IncompatibleTypeException.java
index 0dad96c..3e5b311 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/IncompatibleTypeException.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/IncompatibleTypeException.java
@@ -28,14 +28,14 @@ public class IncompatibleTypeException extends RuntimeDataException {
 
     // Incompatible input parameters, e.g., "1.0" > 1.0
     public IncompatibleTypeException(FunctionIdentifier fid, byte typeTagLeft, byte typeTagRight) {
-        super(ErrorCode.ERROR_TYPE_INCOMPATIBLE, fid.getName(),
+        super(ErrorCode.TYPE_INCOMPATIBLE, fid.getName(),
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typeTagLeft),
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typeTagRight));
     }
 
     // Incompatible input parameters, e.g., "1.0" > 1.0
     public IncompatibleTypeException(String functionName, byte typeTagLeft, byte typeTagRight) {
-        super(ErrorCode.ERROR_TYPE_INCOMPATIBLE, functionName,
+        super(ErrorCode.TYPE_INCOMPATIBLE, functionName,
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typeTagLeft),
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typeTagRight));
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/InvalidDataFormatException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/InvalidDataFormatException.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/InvalidDataFormatException.java
index 0fdb1f0..acb0495 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/InvalidDataFormatException.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/InvalidDataFormatException.java
@@ -27,16 +27,16 @@ import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 public class InvalidDataFormatException extends RuntimeDataException {
 
     public InvalidDataFormatException(FunctionIdentifier fid, byte expectedTypeTag) {
-        super(ErrorCode.ERROR_INVALID_FORMAT, fid.getName(),
+        super(ErrorCode.INVALID_FORMAT, fid.getName(),
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(expectedTypeTag));
     }
 
     public InvalidDataFormatException(FunctionIdentifier fid, String expectedType) {
-        super(ErrorCode.ERROR_INVALID_FORMAT, fid.getName(), expectedType);
+        super(ErrorCode.INVALID_FORMAT, fid.getName(), expectedType);
     }
 
     public InvalidDataFormatException(FunctionIdentifier fid, Throwable cause, byte expectedTypeTag) {
-        super(ErrorCode.ERROR_INVALID_FORMAT, fid.getName(), cause, expectedTypeTag);
+        super(ErrorCode.INVALID_FORMAT, fid.getName(), cause, expectedTypeTag);
         addSuppressed(cause);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/OverflowException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/OverflowException.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/OverflowException.java
index 968a54f..3690236 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/OverflowException.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/OverflowException.java
@@ -27,12 +27,12 @@ public class OverflowException extends RuntimeDataException {
 
     // Overflow.
     public OverflowException(FunctionIdentifier fid) {
-        super(ErrorCode.ERROR_OVERFLOW, fid.getName());
+        super(ErrorCode.OVERFLOW, fid.getName());
     }
 
     // Overflow.
     public OverflowException(String functionName) {
-        super(ErrorCode.ERROR_OVERFLOW, functionName);
+        super(ErrorCode.OVERFLOW, functionName);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/TypeMismatchException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/TypeMismatchException.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/TypeMismatchException.java
index 2a838a2..c061197 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/TypeMismatchException.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/TypeMismatchException.java
@@ -31,13 +31,13 @@ public class TypeMismatchException extends RuntimeDataException {
 
     // Parameter type mistmatch.
     public TypeMismatchException(FunctionIdentifier fid, Integer i, byte actualTypeTag, byte... expectedTypeTags) {
-        super(ErrorCode.ERROR_TYPE_MISMATCH, fid.getName(), indexToPosition(i), toExpectedTypeString(expectedTypeTags),
+        super(ErrorCode.TYPE_MISMATCH, fid.getName(), indexToPosition(i), toExpectedTypeString(expectedTypeTags),
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(actualTypeTag));
     }
 
     // Parameter type mistmatch.
     public TypeMismatchException(String functionName, Integer i, byte actualTypeTag, byte... expectedTypeTags) {
-        super(ErrorCode.ERROR_TYPE_MISMATCH, functionName, indexToPosition(i), toExpectedTypeString(expectedTypeTags),
+        super(ErrorCode.TYPE_MISMATCH, functionName, indexToPosition(i), toExpectedTypeString(expectedTypeTags),
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(actualTypeTag));
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnderflowException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnderflowException.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnderflowException.java
index cb39ab2..6471cbd 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnderflowException.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnderflowException.java
@@ -27,12 +27,12 @@ public class UnderflowException extends RuntimeDataException {
 
     // Underflow.
     public UnderflowException(FunctionIdentifier fid) {
-        super(ErrorCode.ERROR_UNDERFLOW, fid.getName());
+        super(ErrorCode.UNDERFLOW, fid.getName());
     }
 
     // Underflow.
     public UnderflowException(String functionName) {
-        super(ErrorCode.ERROR_UNDERFLOW, functionName);
+        super(ErrorCode.UNDERFLOW, functionName);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedItemTypeException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedItemTypeException.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedItemTypeException.java
index 79d9266..f634649 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedItemTypeException.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedItemTypeException.java
@@ -28,11 +28,11 @@ public class UnsupportedItemTypeException extends RuntimeDataException {
 
     // Unsupported item type.
     public UnsupportedItemTypeException(FunctionIdentifier fid, byte itemTypeTag) {
-        super(ErrorCode.ERROR_TYPE_ITEM, fid.getName(), EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag));
+        super(ErrorCode.TYPE_ITEM, fid.getName(), EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag));
     }
 
     // Unsupported item type.
     public UnsupportedItemTypeException(String functionName, byte itemTypeTag) {
-        super(ErrorCode.ERROR_TYPE_ITEM, functionName, EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag));
+        super(ErrorCode.TYPE_ITEM, functionName, EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag));
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedTypeException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedTypeException.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedTypeException.java
index 6279fbc..af86bd8 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedTypeException.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/exceptions/UnsupportedTypeException.java
@@ -28,13 +28,13 @@ public class UnsupportedTypeException extends RuntimeDataException {
 
     // Unsupported input type.
     public UnsupportedTypeException(FunctionIdentifier fid, byte actualTypeTag) {
-        super(ErrorCode.ERROR_TYPE_UNSUPPORTED, fid.getName(),
+        super(ErrorCode.TYPE_UNSUPPORTED, fid.getName(),
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(actualTypeTag));
     }
 
     // Unsupported input type.
     public UnsupportedTypeException(String funcName, byte actualTypeTag) {
-        super(ErrorCode.ERROR_TYPE_UNSUPPORTED, funcName,
+        super(ErrorCode.TYPE_UNSUPPORTED, funcName,
                 EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(actualTypeTag));
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/024fafe2/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
index 3f8a9a8..1d4dd89 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
@@ -101,7 +101,7 @@ public class SubsetCollectionDescriptor extends AbstractUnnestingFunctionDynamic
 
                             if (typeTag != ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG
                                     && typeTag != ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG) {
-                                throw new RuntimeDataException(ErrorCode.ERROR_COERCION, getIdentifier());
+                                throw new RuntimeDataException(ErrorCode.COERCION, getIdentifier());
                             }
                             if (typeTag == ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG) {
                                 numItemsMax = AOrderedListSerializerDeserializer.getNumberOfItems(serList, offset);


Mime
View raw message