asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject [2/2] asterixdb git commit: Add Maven Plugin for Grammar Extension
Date Sat, 23 Jul 2016 20:15:18 GMT
Add Maven Plugin for Grammar Extension

This change introduces a new asterix maven plugin for grammar
extension. The plugin takes a base grammar file and an extension
file and combine them to generate an extended grammar. A base
grammar can be extended by overriding production nodes, adding
extending existing nodes, or introducing new terminals and
non terminals.

In addition, a mvn verify goal was added to generate the parser
java files from the grammar generated by the test.

Change-Id: Iaa2d11782d43dd8f27d69e347ed0fc8797d79dad
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1011
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/806f7d26
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/806f7d26
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/806f7d26

Branch: refs/heads/master
Commit: 806f7d264fedbaa6d181b92328a922421b8f8ee5
Parents: 1958541
Author: Abdullah Alamoudi <bamousaa@gmail.com>
Authored: Sat Jul 23 18:02:55 2016 +0300
Committer: abdullah alamoudi <bamousaa@gmail.com>
Committed: Sat Jul 23 13:13:56 2016 -0700

----------------------------------------------------------------------
 .../translator/AbstractLangTranslator.java      |  12 +-
 .../asterix/translator/CompiledStatements.java  |  30 +-
 .../LangExpressionToPlanTranslator.java         |  10 +-
 .../apache/asterix/api/common/APIFramework.java |   6 +-
 .../asterix/api/http/servlet/AQLAPIServlet.java |   4 +-
 .../asterix/api/http/servlet/DDLAPIServlet.java |  15 +-
 .../api/http/servlet/QueryAPIServlet.java       |   7 +-
 .../api/http/servlet/UpdateAPIServlet.java      |  11 +-
 .../asterix/aql/translator/QueryTranslator.java |  74 +-
 .../asterix/test/sqlpp/ParserTestExecutor.java  |   6 +-
 .../apache/asterix/external/util/FeedUtils.java |   2 +-
 .../aql/statement/SubscribeFeedStatement.java   |   4 +-
 .../asterix/lang/aql/util/RangeMapBuilder.java  |   2 +-
 .../asterix-lang-aql/src/main/javacc/AQL.jj     |  11 +-
 .../asterix/lang/common/base/Statement.java     | 111 ++-
 .../lang/common/statement/CompactStatement.java |   4 +-
 .../common/statement/ConnectFeedStatement.java  |   4 +-
 .../statement/CreateDataverseStatement.java     |   4 +-
 .../statement/CreateFeedPolicyStatement.java    |   4 +-
 .../common/statement/CreateFeedStatement.java   |   2 +-
 .../statement/CreateFunctionStatement.java      |   4 +-
 .../common/statement/CreateIndexStatement.java  |   4 +-
 .../statement/CreatePrimaryFeedStatement.java   |   2 +-
 .../statement/CreateSecondaryFeedStatement.java |   2 +-
 .../lang/common/statement/DatasetDecl.java      |   4 +-
 .../lang/common/statement/DataverseDecl.java    |   4 +-
 .../statement/DataverseDropStatement.java       |   4 +-
 .../lang/common/statement/DeleteStatement.java  |   4 +-
 .../statement/DisconnectFeedStatement.java      |   4 +-
 .../lang/common/statement/DropStatement.java    |   4 +-
 .../common/statement/FeedDropStatement.java     |   4 +-
 .../statement/FeedPolicyDropStatement.java      |   4 +-
 .../lang/common/statement/FunctionDecl.java     |   4 +-
 .../common/statement/FunctionDropStatement.java |   4 +-
 .../lang/common/statement/IndexDecl.java        |   2 +-
 .../common/statement/IndexDropStatement.java    |   4 +-
 .../lang/common/statement/InsertStatement.java  |   4 +-
 .../lang/common/statement/LoadStatement.java    |   4 +-
 .../statement/NodeGroupDropStatement.java       |   4 +-
 .../lang/common/statement/NodegroupDecl.java    |   4 +-
 .../asterix/lang/common/statement/Query.java    |   4 +-
 .../RefreshExternalDatasetStatement.java        |   4 +-
 .../lang/common/statement/RunStatement.java     |   4 +-
 .../lang/common/statement/SetStatement.java     |   4 +-
 .../asterix/lang/common/statement/TypeDecl.java |   4 +-
 .../common/statement/TypeDropStatement.java     |   4 +-
 .../lang/common/statement/UpdateStatement.java  |   4 +-
 .../lang/common/statement/UpsertStatement.java  |   4 +-
 .../lang/common/statement/WriteStatement.java   |   4 +-
 .../pom.xml                                     | 102 +++
 .../extension/grammar/GrammarExtensionMojo.java | 841 +++++++++++++++++++
 .../grammar/GrammarExtensionMojoTest.java       |  40 +
 .../asterix/lang/extension/EchoStatement.java   |  47 ++
 .../src/test/resources/lang/extension.jj        |  45 +
 .../basic-test/basic-test-plugin-config.xml     |  80 ++
 asterixdb/asterix-maven-plugins/pom.xml         |   1 +
 .../tools/translator/ADGenDmlTranslator.java    |   4 +-
 57 files changed, 1388 insertions(+), 205 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
index 83e4375..9030da9 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
@@ -107,7 +107,7 @@ public abstract class AbstractLangTranslator {
         String message = null;
         String dataverse = defaultDataverse != null ? defaultDataverse.getDataverseName() : null;
         switch (stmt.getKind()) {
-            case Statement.INSERT:
+            case Statement.Kind.INSERT:
                 InsertStatement insertStmt = (InsertStatement) stmt;
                 if (insertStmt.getDataverseName() != null) {
                     dataverse = insertStmt.getDataverseName().getValue();
@@ -119,7 +119,7 @@ public abstract class AbstractLangTranslator {
                 }
                 break;
 
-            case Statement.DELETE:
+            case Statement.Kind.DELETE:
                 DeleteStatement deleteStmt = (DeleteStatement) stmt;
                 if (deleteStmt.getDataverseName() != null) {
                     dataverse = deleteStmt.getDataverseName().getValue();
@@ -131,7 +131,7 @@ public abstract class AbstractLangTranslator {
                 }
                 break;
 
-            case Statement.NODEGROUP_DROP:
+            case Statement.Kind.NODEGROUP_DROP:
                 String nodegroupName = ((NodeGroupDropStatement) stmt).getNodeGroupName().getValue();
                 invalidOperation = MetadataConstants.METADATA_DEFAULT_NODEGROUP_NAME.equals(nodegroupName);
                 if (invalidOperation) {
@@ -139,7 +139,7 @@ public abstract class AbstractLangTranslator {
                 }
                 break;
 
-            case Statement.DATAVERSE_DROP:
+            case Statement.Kind.DATAVERSE_DROP:
                 DataverseDropStatement dvDropStmt = (DataverseDropStatement) stmt;
                 invalidOperation =
                         MetadataConstants.METADATA_DATAVERSE_NAME.equals(dvDropStmt.getDataverseName().getValue());
@@ -148,7 +148,7 @@ public abstract class AbstractLangTranslator {
                 }
                 break;
 
-            case Statement.DATASET_DROP:
+            case Statement.Kind.DATASET_DROP:
                 DropStatement dropStmt = (DropStatement) stmt;
                 if (dropStmt.getDataverseName() != null) {
                     dataverse = dropStmt.getDataverseName().getValue();
@@ -159,7 +159,7 @@ public abstract class AbstractLangTranslator {
                             + MetadataConstants.METADATA_DATAVERSE_NAME;
                 }
                 break;
-            case Statement.DATASET_DECL:
+            case Statement.Kind.DATASET_DECL:
                 DatasetDecl datasetStmt = (DatasetDecl) stmt;
                 Map<String, String> hints = datasetStmt.getHints();
                 if (hints != null && !hints.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/CompiledStatements.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/CompiledStatements.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/CompiledStatements.java
index 7a3b2a4..b184774 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/CompiledStatements.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/CompiledStatements.java
@@ -60,7 +60,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.DATASET_DROP;
+            return Statement.Kind.DATASET_DROP;
         }
     }
 
@@ -84,7 +84,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.CREATE_DATAVERSE;
+            return Statement.Kind.CREATE_DATAVERSE;
         }
     }
 
@@ -101,7 +101,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.NODEGROUP_DROP;
+            return Statement.Kind.NODEGROUP_DROP;
         }
     }
 
@@ -130,7 +130,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.INDEX_DROP;
+            return Statement.Kind.INDEX_DROP;
         }
     }
 
@@ -153,7 +153,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.DATAVERSE_DROP;
+            return Statement.Kind.DATAVERSE_DROP;
         }
     }
 
@@ -170,7 +170,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.TYPE_DROP;
+            return Statement.Kind.TYPE_DROP;
         }
     }
 
@@ -242,7 +242,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.CREATE_INDEX;
+            return Statement.Kind.CREATE_INDEX;
         }
     }
 
@@ -286,7 +286,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.LOAD;
+            return Statement.Kind.LOAD;
         }
     }
 
@@ -323,7 +323,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.INSERT;
+            return Statement.Kind.INSERT;
         }
     }
 
@@ -335,7 +335,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.UPSERT;
+            return Statement.Kind.UPSERT;
         }
     }
 
@@ -381,7 +381,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.CONNECT_FEED;
+            return Statement.Kind.CONNECT_FEED;
         }
 
         public String getPolicyName() {
@@ -419,7 +419,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.SUBSCRIBE_FEED;
+            return Statement.Kind.SUBSCRIBE_FEED;
         }
     }
 
@@ -450,7 +450,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.DISCONNECT_FEED;
+            return Statement.Kind.DISCONNECT_FEED;
         }
 
     }
@@ -495,7 +495,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.DELETE;
+            return Statement.Kind.DELETE;
         }
 
     }
@@ -519,7 +519,7 @@ public class CompiledStatements {
 
         @Override
         public byte getKind() {
-            return Statement.COMPACT;
+            return Statement.Kind.COMPACT;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
index 3689357..1894cc3 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
@@ -372,23 +372,23 @@ class LangExpressionToPlanTranslator
             Mutable<ILogicalExpression> varRef = new MutableObject<>(new VariableReferenceExpression(resVar));
             ILogicalOperator leafOperator;
             switch (stmt.getKind()) {
-                case Statement.INSERT:
+                case Statement.Kind.INSERT:
                     leafOperator = translateInsert(targetDatasource, varRef, varRefsForLoading,
                             additionalFilteringExpressions, assign);
                     break;
-                case Statement.UPSERT:
+                case Statement.Kind.UPSERT:
                     leafOperator = translateUpsert(targetDatasource, varRef, varRefsForLoading,
                             additionalFilteringExpressions, assign, additionalFilteringField);
                     break;
-                case Statement.DELETE:
+                case Statement.Kind.DELETE:
                     leafOperator = translateDelete(targetDatasource, varRef, varRefsForLoading,
                             additionalFilteringExpressions, assign);
                     break;
-                case Statement.CONNECT_FEED:
+                case Statement.Kind.CONNECT_FEED:
                     leafOperator = translateConnectFeed(targetDatasource, varRef, varRefsForLoading,
                             additionalFilteringExpressions, assign);
                     break;
-                case Statement.SUBSCRIBE_FEED:
+                case Statement.Kind.SUBSCRIBE_FEED:
                     leafOperator = translateSubscribeFeed((CompiledSubscribeFeedStatement) stmt, targetDatasource,
                             unnestVar, project, exprs, resVar, varRefsForLoading, varRef, assign,
                             additionalFilteringField, additionalFilteringAssign, additionalFilteringExpressions);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/common/APIFramework.java
----------------------------------------------------------------------
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 bef8a3a..af17c05 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
@@ -209,7 +209,7 @@ public class APIFramework {
 
         ILogicalPlan plan;
         // statement = null when it's a query
-        if (statement == null || statement.getKind() != Statement.LOAD) {
+        if (statement == null || statement.getKind() != Statement.Kind.LOAD) {
             plan = t.translate(rwQ, outputDatasetName, statement);
         } else {
             plan = t.translateLoad(statement);
@@ -219,7 +219,7 @@ public class APIFramework {
             conf.out().println();
 
             printPlanPrefix(conf, "Logical plan");
-            if (rwQ != null || (statement != null && statement.getKind() == Statement.LOAD)) {
+            if (rwQ != null || (statement != null && statement.getKind() == Statement.Kind.LOAD)) {
                 LogicalOperatorPrettyPrintVisitor pvisitor = new LogicalOperatorPrettyPrintVisitor(conf.out());
                 PlanPrettyPrinter.printPlan(plan, pvisitor, 0);
             }
@@ -271,7 +271,7 @@ public class APIFramework {
                     PlanPrettyPrinter.printPhysicalOps(plan, buffer, 0);
                 } else {
                     printPlanPrefix(conf, "Optimized logical plan");
-                    if (rwQ != null || (statement != null && statement.getKind() == Statement.LOAD)) {
+                    if (rwQ != null || (statement != null && statement.getKind() == Statement.Kind.LOAD)) {
                         LogicalOperatorPrettyPrintVisitor pvisitor = new LogicalOperatorPrettyPrintVisitor(conf.out());
                         PlanPrettyPrinter.printPlan(plan, pvisitor, 0);
                     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/AQLAPIServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/AQLAPIServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/AQLAPIServlet.java
index e799dd0..de19715 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/AQLAPIServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/AQLAPIServlet.java
@@ -29,7 +29,7 @@ public class AQLAPIServlet extends RESTAPIServlet {
 
     private static final long serialVersionUID = 1L;
     private static final String AQL_STMT_PARAM_NAME = "aql";
-    private static final List<Byte> allowedStatements = Statement.VALUES;
+    private static final List<Byte> ALLOWED_STATEMENTS = Statement.KINDS;
 
     public AQLAPIServlet(ILangCompilationProvider compilationProvider) {
         super(compilationProvider);
@@ -42,7 +42,7 @@ public class AQLAPIServlet extends RESTAPIServlet {
 
     @Override
     protected List<Byte> getAllowedStatements() {
-        return allowedStatements;
+        return ALLOWED_STATEMENTS;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/DDLAPIServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/DDLAPIServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/DDLAPIServlet.java
index ec47276..0f9c537 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/DDLAPIServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/DDLAPIServlet.java
@@ -28,6 +28,13 @@ import org.apache.asterix.lang.common.base.Statement;
 
 public class DDLAPIServlet extends RESTAPIServlet {
     private static final long serialVersionUID = 1L;
+    private static final List<Byte> STATEMENTS = Arrays.asList(new Byte[] { Statement.Kind.DATAVERSE_DECL,
+            Statement.Kind.DATAVERSE_DROP, Statement.Kind.DATASET_DECL, Statement.Kind.NODEGROUP_DECL,
+            Statement.Kind.NODEGROUP_DROP, Statement.Kind.TYPE_DECL, Statement.Kind.TYPE_DROP,
+            Statement.Kind.CREATE_INDEX, Statement.Kind.INDEX_DECL, Statement.Kind.CREATE_DATAVERSE,
+            Statement.Kind.DATASET_DROP, Statement.Kind.INDEX_DROP, Statement.Kind.CREATE_FUNCTION,
+            Statement.Kind.FUNCTION_DROP, Statement.Kind.CREATE_PRIMARY_FEED, Statement.Kind.CREATE_SECONDARY_FEED,
+            Statement.Kind.DROP_FEED, Statement.Kind.CREATE_FEED_POLICY, Statement.Kind.DROP_FEED_POLICY });
 
     public DDLAPIServlet(ILangCompilationProvider compilationProvider) {
         super(compilationProvider);
@@ -40,13 +47,7 @@ public class DDLAPIServlet extends RESTAPIServlet {
 
     @Override
     protected List<Byte> getAllowedStatements() {
-        Byte[] statementsArray = { Statement.DATAVERSE_DECL, Statement.DATAVERSE_DROP, Statement.DATASET_DECL,
-                Statement.NODEGROUP_DECL, Statement.NODEGROUP_DROP, Statement.TYPE_DECL, Statement.TYPE_DROP,
-                Statement.CREATE_INDEX, Statement.INDEX_DECL, Statement.CREATE_DATAVERSE, Statement.DATASET_DROP,
-                Statement.INDEX_DROP, Statement.CREATE_FUNCTION, Statement.FUNCTION_DROP, Statement.CREATE_PRIMARY_FEED,
-                Statement.CREATE_SECONDARY_FEED, Statement.DROP_FEED, Statement.CREATE_FEED_POLICY,
-                Statement.DROP_FEED_POLICY };
-        return Arrays.asList(statementsArray);
+        return STATEMENTS;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryAPIServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryAPIServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryAPIServlet.java
index 040ac1a..7262b59 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryAPIServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryAPIServlet.java
@@ -28,6 +28,9 @@ import org.apache.asterix.lang.common.base.Statement;
 
 public class QueryAPIServlet extends RESTAPIServlet {
     private static final long serialVersionUID = 1L;
+    private static final List<Byte> STATEMENTS =
+            Arrays.asList(new Byte[] { Statement.Kind.DATAVERSE_DECL, Statement.Kind.FUNCTION_DECL,
+                    Statement.Kind.QUERY, Statement.Kind.SET, Statement.Kind.WRITE, Statement.Kind.RUN });
 
     public QueryAPIServlet(ILangCompilationProvider compilationProvider) {
         super(compilationProvider);
@@ -40,9 +43,7 @@ public class QueryAPIServlet extends RESTAPIServlet {
 
     @Override
     protected List<Byte> getAllowedStatements() {
-        Byte[] statementsArray = { Statement.DATAVERSE_DECL, Statement.FUNCTION_DECL, Statement.QUERY, Statement.SET,
-                Statement.WRITE, Statement.RUN };
-        return Arrays.asList(statementsArray);
+        return STATEMENTS;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/UpdateAPIServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/UpdateAPIServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/UpdateAPIServlet.java
index 9f762f8..22cd963 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/UpdateAPIServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/UpdateAPIServlet.java
@@ -28,6 +28,11 @@ import org.apache.asterix.lang.common.base.Statement;
 
 public class UpdateAPIServlet extends RESTAPIServlet {
     private static final long serialVersionUID = 1L;
+    private static final List<Byte> STATEMENTS =
+            Arrays.asList(new Byte[] { Statement.Kind.DATAVERSE_DECL, Statement.Kind.DELETE, Statement.Kind.INSERT,
+                    Statement.Kind.UPSERT, Statement.Kind.UPDATE, Statement.Kind.DML_CMD_LIST, Statement.Kind.LOAD,
+                    Statement.Kind.CONNECT_FEED, Statement.Kind.DISCONNECT_FEED, Statement.Kind.SET,
+                    Statement.Kind.COMPACT, Statement.Kind.EXTERNAL_DATASET_REFRESH, Statement.Kind.RUN });
 
     public UpdateAPIServlet(ILangCompilationProvider compilationProvider) {
         super(compilationProvider);
@@ -40,11 +45,7 @@ public class UpdateAPIServlet extends RESTAPIServlet {
 
     @Override
     protected List<Byte> getAllowedStatements() {
-        Byte[] statementsArray =
-                { Statement.DATAVERSE_DECL, Statement.DELETE, Statement.INSERT, Statement.UPSERT, Statement.UPDATE,
-                        Statement.DML_CMD_LIST, Statement.LOAD, Statement.CONNECT_FEED, Statement.DISCONNECT_FEED,
-                        Statement.SET, Statement.COMPACT, Statement.EXTERNAL_DATASET_REFRESH, Statement.RUN };
-        return Arrays.asList(statementsArray);
+        return STATEMENTS;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
index 4df4468..05d9b3d 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
@@ -234,7 +234,7 @@ public class QueryTranslator extends AbstractLangTranslator {
     private List<FunctionDecl> getDeclaredFunctions(List<Statement> statements) {
         List<FunctionDecl> functionDecls = new ArrayList<>();
         for (Statement st : statements) {
-            if (st.getKind() == Statement.FUNCTION_DECL) {
+            if (st.getKind() == Statement.Kind.FUNCTION_DECL) {
                 functionDecls.add((FunctionDecl) st);
             }
         }
@@ -284,98 +284,98 @@ public class QueryTranslator extends AbstractLangTranslator {
                 metadataProvider.setOutputFile(outputFile);
                 metadataProvider.setConfig(config);
                 switch (stmt.getKind()) {
-                    case Statement.SET:
+                    case Statement.Kind.SET:
                         handleSetStatement(stmt, config);
                         break;
-                    case Statement.DATAVERSE_DECL:
+                    case Statement.Kind.DATAVERSE_DECL:
                         activeDefaultDataverse = handleUseDataverseStatement(metadataProvider, stmt);
                         break;
-                    case Statement.CREATE_DATAVERSE:
+                    case Statement.Kind.CREATE_DATAVERSE:
                         handleCreateDataverseStatement(metadataProvider, stmt);
                         break;
-                    case Statement.DATASET_DECL:
+                    case Statement.Kind.DATASET_DECL:
                         handleCreateDatasetStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.CREATE_INDEX:
+                    case Statement.Kind.CREATE_INDEX:
                         handleCreateIndexStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.TYPE_DECL:
+                    case Statement.Kind.TYPE_DECL:
                         handleCreateTypeStatement(metadataProvider, stmt);
                         break;
-                    case Statement.NODEGROUP_DECL:
+                    case Statement.Kind.NODEGROUP_DECL:
                         handleCreateNodeGroupStatement(metadataProvider, stmt);
                         break;
-                    case Statement.DATAVERSE_DROP:
+                    case Statement.Kind.DATAVERSE_DROP:
                         handleDataverseDropStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.DATASET_DROP:
+                    case Statement.Kind.DATASET_DROP:
                         handleDatasetDropStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.INDEX_DROP:
+                    case Statement.Kind.INDEX_DROP:
                         handleIndexDropStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.TYPE_DROP:
+                    case Statement.Kind.TYPE_DROP:
                         handleTypeDropStatement(metadataProvider, stmt);
                         break;
-                    case Statement.NODEGROUP_DROP:
+                    case Statement.Kind.NODEGROUP_DROP:
                         handleNodegroupDropStatement(metadataProvider, stmt);
                         break;
-                    case Statement.CREATE_FUNCTION:
+                    case Statement.Kind.CREATE_FUNCTION:
                         handleCreateFunctionStatement(metadataProvider, stmt);
                         break;
-                    case Statement.FUNCTION_DROP:
+                    case Statement.Kind.FUNCTION_DROP:
                         handleFunctionDropStatement(metadataProvider, stmt);
                         break;
-                    case Statement.LOAD:
+                    case Statement.Kind.LOAD:
                         handleLoadStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.INSERT:
-                    case Statement.UPSERT:
+                    case Statement.Kind.INSERT:
+                    case Statement.Kind.UPSERT:
                         handleInsertUpsertStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.DELETE:
+                    case Statement.Kind.DELETE:
                         handleDeleteStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.CREATE_PRIMARY_FEED:
-                    case Statement.CREATE_SECONDARY_FEED:
+                    case Statement.Kind.CREATE_PRIMARY_FEED:
+                    case Statement.Kind.CREATE_SECONDARY_FEED:
                         handleCreateFeedStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.DROP_FEED:
+                    case Statement.Kind.DROP_FEED:
                         handleDropFeedStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.DROP_FEED_POLICY:
+                    case Statement.Kind.DROP_FEED_POLICY:
                         handleDropFeedPolicyStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.CONNECT_FEED:
+                    case Statement.Kind.CONNECT_FEED:
                         handleConnectFeedStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.DISCONNECT_FEED:
+                    case Statement.Kind.DISCONNECT_FEED:
                         handleDisconnectFeedStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.SUBSCRIBE_FEED:
+                    case Statement.Kind.SUBSCRIBE_FEED:
                         handleSubscribeFeedStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.CREATE_FEED_POLICY:
+                    case Statement.Kind.CREATE_FEED_POLICY:
                         handleCreateFeedPolicyStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.QUERY:
+                    case Statement.Kind.QUERY:
                         metadataProvider.setResultSetId(new ResultSetId(resultSetIdCounter++));
                         metadataProvider.setResultAsyncMode(resultDelivery == ResultDelivery.ASYNC
                                 || resultDelivery == ResultDelivery.ASYNC_DEFERRED);
                         handleQuery(metadataProvider, (Query) stmt, hcc, hdc, resultDelivery, stats);
                         break;
-                    case Statement.COMPACT:
+                    case Statement.Kind.COMPACT:
                         handleCompactStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.EXTERNAL_DATASET_REFRESH:
+                    case Statement.Kind.EXTERNAL_DATASET_REFRESH:
                         handleExternalDatasetRefreshStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.WRITE:
+                    case Statement.Kind.WRITE:
                         Pair<IAWriterFactory, FileSplit> result = handleWriteStatement(stmt);
                         writerFactory = (result.first != null) ? result.first : writerFactory;
                         outputFile = result.second;
                         break;
-                    case Statement.RUN:
+                    case Statement.Kind.RUN:
                         handleRunStatement(metadataProvider, stmt, hcc);
                         break;
                     default:
@@ -1856,11 +1856,11 @@ public class QueryTranslator extends AbstractLangTranslator {
             metadataProvider.setWriteTransaction(true);
             CompiledInsertStatement clfrqs = null;
             switch (stmtInsertUpsert.getKind()) {
-                case Statement.INSERT:
+                case Statement.Kind.INSERT:
                     clfrqs = new CompiledInsertStatement(dataverseName, stmtInsertUpsert.getDatasetName().getValue(),
                             query, stmtInsertUpsert.getVarCounter());
                     break;
-                case Statement.UPSERT:
+                case Statement.Kind.UPSERT:
                     clfrqs = new CompiledUpsertStatement(dataverseName, stmtInsertUpsert.getDatasetName().getValue(),
                             query, stmtInsertUpsert.getVarCounter());
                     break;
@@ -1963,13 +1963,13 @@ public class QueryTranslator extends AbstractLangTranslator {
             }
 
             switch (stmt.getKind()) {
-                case Statement.CREATE_PRIMARY_FEED:
+                case Statement.Kind.CREATE_PRIMARY_FEED:
                     CreatePrimaryFeedStatement cpfs = (CreatePrimaryFeedStatement) stmt;
                     String adaptorName = cpfs.getAdaptorName();
                     feed = new Feed(dataverseName, feedName, cfs.getAppliedFunction(), FeedType.PRIMARY, feedName,
                             adaptorName, cpfs.getAdaptorConfiguration());
                     break;
-                case Statement.CREATE_SECONDARY_FEED:
+                case Statement.Kind.CREATE_SECONDARY_FEED:
                     CreateSecondaryFeedStatement csfs = (CreateSecondaryFeedStatement) stmt;
                     feed = new Feed(dataverseName, feedName, csfs.getAppliedFunction(), FeedType.SECONDARY,
                             csfs.getSourceFeedName(), null, null);
@@ -3102,4 +3102,4 @@ public class QueryTranslator extends AbstractLangTranslator {
         rewriter.rewrite(stmt);
     }
 
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
index 6bddfa5..05a7dce 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
@@ -128,7 +128,7 @@ public class ParserTestExecutor extends TestExecutor {
             when(aqlMetadataProvider.findDataset(anyString(), anyString())).thenReturn(mock(Dataset.class));
 
             for (Statement st : statements) {
-                if (st.getKind() == Statement.QUERY) {
+                if (st.getKind() == Statement.Kind.QUERY) {
                     Query query = (Query) st;
                     IQueryRewriter rewriter = sqlppRewriterFactory.createQueryRewriter();
                     rewrite(rewriter, functions, query, aqlMetadataProvider,
@@ -156,7 +156,7 @@ public class ParserTestExecutor extends TestExecutor {
     private List<FunctionDecl> getDeclaredFunctions(List<Statement> statements) {
         List<FunctionDecl> functionDecls = new ArrayList<FunctionDecl>();
         for (Statement st : statements) {
-            if (st.getKind() == Statement.FUNCTION_DECL) {
+            if (st.getKind() == Statement.Kind.FUNCTION_DECL) {
                 functionDecls.add((FunctionDecl) st);
             }
         }
@@ -166,7 +166,7 @@ public class ParserTestExecutor extends TestExecutor {
     // Gets the default dataverse for the input statements.
     private String getDefaultDataverse(List<Statement> statements) {
         for (Statement st : statements) {
-            if (st.getKind() == Statement.DATAVERSE_DECL) {
+            if (st.getKind() == Statement.Kind.DATAVERSE_DECL) {
                 DataverseDecl dv = (DataverseDecl) st;
                 return dv.getDataverseName().getValue();
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FeedUtils.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FeedUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FeedUtils.java
index 6e1b9e8..9c378a0 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FeedUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/FeedUtils.java
@@ -64,7 +64,7 @@ public class FeedUtils {
         SPILL,              // Memory budget has been consumed. Now we're writing to disk
         DISCARD             // Memory and Disk space budgets have been consumed. Now we're discarding
     }
-    
+
     private FeedUtils() {
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
index 14f229a..9e6f857 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
@@ -52,7 +52,7 @@ import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
  * Represents the AQL statement for subscribing to a feed.
  * This AQL statement is private and may not be used by the end-user.
  */
-public class SubscribeFeedStatement extends Statement {
+public class SubscribeFeedStatement implements Statement {
 
     private static final Logger LOGGER = Logger.getLogger(SubscribeFeedStatement.class.getName());
     private final FeedConnectionRequest connectionRequest;
@@ -158,7 +158,7 @@ public class SubscribeFeedStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.SUBSCRIBE_FEED;
+        return Statement.Kind.SUBSCRIBE_FEED;
     }
 
     public String getPolicy() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
index f30d4a6..2ee70bc 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
@@ -70,7 +70,7 @@ public abstract class RangeMapBuilder {
         }
 
         // Translate the query into a Range Map
-        if (hintStatements.get(0).getKind() != Statement.QUERY) {
+        if (hintStatements.get(0).getKind() != Statement.Kind.QUERY) {
             throw new AsterixException("Not a proper query for the range hint.");
         }
         Query q = (Query) hintStatements.get(0);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
index 586464c..7701278 100644
--- a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
+++ b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
@@ -504,12 +504,14 @@ RefreshExternalDatasetStatement RefreshExternalDatasetStatement() throws ParseEx
   String datasetName = null;
 }
 {
+  (
     <REFRESH> <EXTERNAL> <DATASET> nameComponents = QualifiedName()
     {
     redss.setDataverseName(nameComponents.first);
     redss.setDatasetName(nameComponents.second);
     return redss;
     }
+  )
 }
 
 RunStatement RunStatement() throws ParseException:
@@ -1537,7 +1539,6 @@ Query Query() throws ParseException:
       setDatasets(null);
       return query;
     }
-
 }
 
 
@@ -2201,7 +2202,7 @@ Expression IfThenElse() throws ParseException:
     }
 }
 
-Expression  FLWOGR() throws ParseException:
+Expression FLWOGR() throws ParseException:
 {
     FLWOGRExpression flworg = new FLWOGRExpression();
     List<Clause> clauseList = new ArrayList<Clause>();
@@ -2353,9 +2354,9 @@ Clause OrderbyClause()throws ParseException :
 }
 Clause GroupClause()throws ParseException :
 {
-      GroupbyClause gbc = new GroupbyClause();
-      // GbyVariableExpressionPair pair = new GbyVariableExpressionPair();
-     List<GbyVariableExpressionPair> vePairList = new ArrayList<GbyVariableExpressionPair>();
+    GroupbyClause gbc = new GroupbyClause();
+    // GbyVariableExpressionPair pair = new GbyVariableExpressionPair();
+    List<GbyVariableExpressionPair> vePairList = new ArrayList<GbyVariableExpressionPair>();
     List<GbyVariableExpressionPair> decorPairList = new ArrayList<GbyVariableExpressionPair>();
     List<VariableExpr> withVarList= new ArrayList<VariableExpr>();
     VariableExpr var = null;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/Statement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/Statement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/Statement.java
index 6f0f1f1..fcc1080 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/Statement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/Statement.java
@@ -18,52 +18,75 @@
  */
 package org.apache.asterix.lang.common.base;
 
-import java.util.Arrays;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-public abstract class Statement implements ILangExpression {
-    public static final byte DATASET_DECL = 0x00;
-    public static final byte DATAVERSE_DECL = 0x01;
-    public static final byte DATAVERSE_DROP = 0x02;
-    public static final byte DATASET_DROP = 0x03;
-    public static final byte DELETE = 0x04;
-    public static final byte INSERT = 0x05;
-    public static final byte UPSERT = 0x06;
-    public static final byte UPDATE = 0x07;
-    public static final byte DML_CMD_LIST = 0x08;
-    public static final byte FUNCTION_DECL = 0x09;
-    public static final byte LOAD = 0x0a;
-    public static final byte NODEGROUP_DECL = 0x0b;
-    public static final byte NODEGROUP_DROP = 0x0c;
-    public static final byte QUERY = 0x0d;
-    public static final byte SET = 0x0e;
-    public static final byte TYPE_DECL = 0x0f;
-    public static final byte TYPE_DROP = 0x10;
-    public static final byte WRITE = 0x11;
-    public static final byte CREATE_INDEX = 0x12;
-    public static final byte INDEX_DECL = 0x13;
-    public static final byte CREATE_DATAVERSE = 0x14;
-    public static final byte INDEX_DROP = 0x15;
-    public static final byte CREATE_PRIMARY_FEED = 0x16;
-    public static final byte CREATE_SECONDARY_FEED = 0x17;
-    public static final byte DROP_FEED = 0x18;
-    public static final byte CONNECT_FEED = 0x19;
-    public static final byte DISCONNECT_FEED = 0x1a;
-    public static final byte SUBSCRIBE_FEED = 0x1b;
-    public static final byte CREATE_FEED_POLICY = 0x1c;
-    public static final byte DROP_FEED_POLICY = 0x1d;
-    public static final byte CREATE_FUNCTION = 0x1e;
-    public static final byte FUNCTION_DROP = 0x1f;
-    public static final byte COMPACT = 0x20;
-    public static final byte EXTERNAL_DATASET_REFRESH = 0x21;
-    public static final byte RUN = 0x22;
-    public static final List<Byte> VALUES = Collections.unmodifiableList(
-            Arrays.asList(DATASET_DECL, DATAVERSE_DECL, DATAVERSE_DROP, DATASET_DROP, DELETE, INSERT, UPSERT, UPDATE,
-                    DML_CMD_LIST, FUNCTION_DECL, LOAD, NODEGROUP_DECL, NODEGROUP_DROP, QUERY, SET, TYPE_DECL, TYPE_DROP,
-                    WRITE, CREATE_INDEX, INDEX_DECL, CREATE_DATAVERSE, INDEX_DROP, CREATE_PRIMARY_FEED,
-                    CREATE_SECONDARY_FEED, DROP_FEED, CONNECT_FEED, DISCONNECT_FEED, SUBSCRIBE_FEED, CREATE_FEED_POLICY,
-                    DROP_FEED_POLICY, CREATE_FUNCTION, FUNCTION_DROP, COMPACT, EXTERNAL_DATASET_REFRESH, RUN));
+public interface Statement extends ILangExpression {
+    public static final List<Byte> KINDS = Collections.unmodifiableList(Kind.range(Kind.DATASET_DECL, Kind.RUN));
 
-    public abstract byte getKind();
+    /**
+     * get a byte representing the statement kind
+     * Note: bytes 0x00 - 0x7f are reserved for core asterix statements
+     * Use negative bytes for extension statements
+     *
+     * @return kind byte
+     */
+    public byte getKind();
+
+    public class Kind {
+        public static final byte DATASET_DECL = 0x00;
+        public static final byte DATAVERSE_DECL = 0x01;
+        public static final byte DATAVERSE_DROP = 0x02;
+        public static final byte DATASET_DROP = 0x03;
+        public static final byte DELETE = 0x04;
+        public static final byte INSERT = 0x05;
+        public static final byte UPSERT = 0x06;
+        public static final byte UPDATE = 0x07;
+        public static final byte DML_CMD_LIST = 0x08;
+        public static final byte FUNCTION_DECL = 0x09;
+        public static final byte LOAD = 0x0a;
+        public static final byte NODEGROUP_DECL = 0x0b;
+        public static final byte NODEGROUP_DROP = 0x0c;
+        public static final byte QUERY = 0x0d;
+        public static final byte SET = 0x0e;
+        public static final byte TYPE_DECL = 0x0f;
+        public static final byte TYPE_DROP = 0x10;
+        public static final byte WRITE = 0x11;
+        public static final byte CREATE_INDEX = 0x12;
+        public static final byte INDEX_DECL = 0x13;
+        public static final byte CREATE_DATAVERSE = 0x14;
+        public static final byte INDEX_DROP = 0x15;
+        public static final byte CREATE_PRIMARY_FEED = 0x16;
+        public static final byte CREATE_SECONDARY_FEED = 0x17;
+        public static final byte DROP_FEED = 0x18;
+        public static final byte CONNECT_FEED = 0x19;
+        public static final byte DISCONNECT_FEED = 0x1a;
+        public static final byte SUBSCRIBE_FEED = 0x1b;
+        public static final byte CREATE_FEED_POLICY = 0x1c;
+        public static final byte DROP_FEED_POLICY = 0x1d;
+        public static final byte CREATE_FUNCTION = 0x1e;
+        public static final byte FUNCTION_DROP = 0x1f;
+        public static final byte COMPACT = 0x20;
+        public static final byte EXTERNAL_DATASET_REFRESH = 0x21;
+        public static final byte RUN = 0x22;
+
+        private Kind() {
+        }
+
+        /**
+         * Generate a list of Bytes from start to end
+         *
+         * @param start
+         * @param end
+         * @return
+         */
+        private static List<Byte> range(byte start, byte end) {
+            ArrayList<Byte> bytes = new ArrayList<>();
+            for (byte b = start; b <= end; b++) {
+                bytes.add(b);
+            }
+            return bytes;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CompactStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CompactStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CompactStatement.java
index 531957f..912ac6f 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CompactStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CompactStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class CompactStatement extends Statement {
+public class CompactStatement implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier datasetName;
@@ -35,7 +35,7 @@ public class CompactStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.COMPACT;
+        return Statement.Kind.COMPACT;
     }
 
     public Identifier getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/ConnectFeedStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/ConnectFeedStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/ConnectFeedStatement.java
index 33e3340..48bc59e 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/ConnectFeedStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/ConnectFeedStatement.java
@@ -25,7 +25,7 @@ import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.asterix.metadata.feeds.BuiltinFeedPolicies;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
-public class ConnectFeedStatement extends Statement {
+public class ConnectFeedStatement implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier datasetName;
@@ -78,7 +78,7 @@ public class ConnectFeedStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.CONNECT_FEED;
+        return Statement.Kind.CONNECT_FEED;
     }
 
     public String getPolicy() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateDataverseStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateDataverseStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateDataverseStatement.java
index 7a5b722..c6dff3f 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateDataverseStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateDataverseStatement.java
@@ -24,7 +24,7 @@ import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.asterix.runtime.formats.NonTaggedDataFormat;
 
-public class CreateDataverseStatement extends Statement {
+public class CreateDataverseStatement implements Statement {
 
     private Identifier dataverseName;
     private String format;
@@ -50,7 +50,7 @@ public class CreateDataverseStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.CREATE_DATAVERSE;
+        return Statement.Kind.CREATE_DATAVERSE;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedPolicyStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedPolicyStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedPolicyStatement.java
index e972cad..dfc6c7e 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedPolicyStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedPolicyStatement.java
@@ -24,7 +24,7 @@ import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class CreateFeedPolicyStatement extends Statement {
+public class CreateFeedPolicyStatement implements Statement {
 
     private final String policyName;
     private final String sourcePolicyName;
@@ -59,7 +59,7 @@ public class CreateFeedPolicyStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.CREATE_FEED_POLICY;
+        return Statement.Kind.CREATE_FEED_POLICY;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedStatement.java
index 9635836..c4f9efb 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedStatement.java
@@ -25,7 +25,7 @@ import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
-public abstract class CreateFeedStatement extends Statement {
+public abstract class CreateFeedStatement implements Statement {
 
     private final Pair<Identifier, Identifier> qName;
     private final FunctionSignature appliedFunction;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFunctionStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFunctionStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFunctionStatement.java
index f7d0363..02a2b0c 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFunctionStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFunctionStatement.java
@@ -27,7 +27,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.VarIdentifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class CreateFunctionStatement extends Statement {
+public class CreateFunctionStatement implements Statement {
 
     private final FunctionSignature signature;
     private final String functionBody;
@@ -59,7 +59,7 @@ public class CreateFunctionStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.CREATE_FUNCTION;
+        return Statement.Kind.CREATE_FUNCTION;
     }
 
     public List<String> getParamList() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateIndexStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateIndexStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateIndexStatement.java
index a2337e1..fd787ab 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateIndexStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateIndexStatement.java
@@ -29,7 +29,7 @@ import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
-public class CreateIndexStatement extends Statement {
+public class CreateIndexStatement implements Statement {
 
     private Identifier indexName;
     private Identifier dataverseName;
@@ -120,7 +120,7 @@ public class CreateIndexStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.CREATE_INDEX;
+        return Statement.Kind.CREATE_INDEX;
     }
 
     public boolean hasMetaField() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreatePrimaryFeedStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreatePrimaryFeedStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreatePrimaryFeedStatement.java
index 9dac0c4..6c4d84e 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreatePrimaryFeedStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreatePrimaryFeedStatement.java
@@ -49,7 +49,7 @@ public class CreatePrimaryFeedStatement extends CreateFeedStatement {
 
     @Override
     public byte getKind() {
-        return Statement.CREATE_PRIMARY_FEED;
+        return Statement.Kind.CREATE_PRIMARY_FEED;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateSecondaryFeedStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateSecondaryFeedStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateSecondaryFeedStatement.java
index 7ef0a56..6787426 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateSecondaryFeedStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateSecondaryFeedStatement.java
@@ -51,7 +51,7 @@ public class CreateSecondaryFeedStatement extends CreateFeedStatement {
 
     @Override
     public byte getKind() {
-        return Statement.CREATE_SECONDARY_FEED;
+        return Statement.Kind.CREATE_SECONDARY_FEED;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DatasetDecl.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DatasetDecl.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DatasetDecl.java
index fa88a9a..b2f3fe1 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DatasetDecl.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DatasetDecl.java
@@ -27,7 +27,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class DatasetDecl extends Statement {
+public class DatasetDecl implements Statement {
     protected final Identifier name;
     protected final Identifier dataverse;
     protected final Identifier itemTypeDataverse;
@@ -142,7 +142,7 @@ public class DatasetDecl extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DATASET_DECL;
+        return Statement.Kind.DATASET_DECL;
     }
 
     public IDatasetDetailsDecl getDatasetDetailsDecl() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDecl.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDecl.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDecl.java
index ae183e3..89933e5 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDecl.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDecl.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class DataverseDecl extends Statement {
+public class DataverseDecl implements Statement {
 
     private Identifier dataverseName;
 
@@ -37,7 +37,7 @@ public class DataverseDecl extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DATAVERSE_DECL;
+        return Statement.Kind.DATAVERSE_DECL;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDropStatement.java
index fe828fa..0054140 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class DataverseDropStatement extends Statement {
+public class DataverseDropStatement implements Statement {
 
     private Identifier dataverseName;
     private boolean ifExists;
@@ -35,7 +35,7 @@ public class DataverseDropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DATAVERSE_DROP;
+        return Statement.Kind.DATAVERSE_DROP;
     }
 
     public Identifier getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DeleteStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DeleteStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DeleteStatement.java
index c660d68..ffe2c0d 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DeleteStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DeleteStatement.java
@@ -28,7 +28,7 @@ import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.commons.lang3.ObjectUtils;
 
-public class DeleteStatement extends Statement {
+public class DeleteStatement implements Statement {
 
     private VariableExpr vars;
     private Identifier dataverseName;
@@ -52,7 +52,7 @@ public class DeleteStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DELETE;
+        return Statement.Kind.DELETE;
     }
 
     public VariableExpr getVariableExpr() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DisconnectFeedStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DisconnectFeedStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DisconnectFeedStatement.java
index 61ccc7a..9d8cb9d 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DisconnectFeedStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DisconnectFeedStatement.java
@@ -24,7 +24,7 @@ import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
-public class DisconnectFeedStatement extends Statement {
+public class DisconnectFeedStatement implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier feedName;
@@ -62,7 +62,7 @@ public class DisconnectFeedStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DISCONNECT_FEED;
+        return Statement.Kind.DISCONNECT_FEED;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropStatement.java
index f8becae..f4189dd 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class DropStatement extends Statement {
+public class DropStatement implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier datasetName;
@@ -37,7 +37,7 @@ public class DropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DATASET_DROP;
+        return Statement.Kind.DATASET_DROP;
     }
 
     public Identifier getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedDropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedDropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedDropStatement.java
index 88f96ec..878fc49 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedDropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedDropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class FeedDropStatement extends Statement {
+public class FeedDropStatement implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier feedName;
@@ -37,7 +37,7 @@ public class FeedDropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DROP_FEED;
+        return Statement.Kind.DROP_FEED;
     }
 
     public Identifier getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedPolicyDropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedPolicyDropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedPolicyDropStatement.java
index 73535fa..c217690 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedPolicyDropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedPolicyDropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class FeedPolicyDropStatement extends Statement {
+public class FeedPolicyDropStatement implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier policyName;
@@ -37,7 +37,7 @@ public class FeedPolicyDropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.DROP_FEED_POLICY;
+        return Statement.Kind.DROP_FEED_POLICY;
     }
 
     public Identifier getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDecl.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDecl.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDecl.java
index 57a68f5..c71f7f2 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDecl.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDecl.java
@@ -27,7 +27,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.VarIdentifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class FunctionDecl extends Statement {
+public class FunctionDecl implements Statement {
     private FunctionSignature signature;
     private List<VarIdentifier> paramList;
     private Expression funcBody;
@@ -74,7 +74,7 @@ public class FunctionDecl extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.FUNCTION_DECL;
+        return Statement.Kind.FUNCTION_DECL;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDropStatement.java
index 9560180..ae1a29b 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.common.functions.FunctionSignature;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class FunctionDropStatement extends Statement {
+public class FunctionDropStatement implements Statement {
 
     private final FunctionSignature signature;
     private boolean ifExists;
@@ -35,7 +35,7 @@ public class FunctionDropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.FUNCTION_DROP;
+        return Statement.Kind.FUNCTION_DROP;
     }
 
     public FunctionSignature getFunctionSignature() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDecl.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDecl.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDecl.java
index 06def0f..74cf0af 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDecl.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDecl.java
@@ -23,6 +23,6 @@ import org.apache.asterix.lang.common.base.Statement;
 public class IndexDecl extends CreateIndexStatement {
     @Override
     public byte getKind() {
-        return Statement.INDEX_DECL;
+        return Statement.Kind.INDEX_DECL;
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDropStatement.java
index e96a9d5..1e3f6b0 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class IndexDropStatement extends Statement {
+public class IndexDropStatement implements Statement {
 
     private Identifier dataverseName;
     private Identifier datasetName;
@@ -40,7 +40,7 @@ public class IndexDropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.INDEX_DROP;
+        return Statement.Kind.INDEX_DROP;
     }
 
     public Identifier getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/InsertStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/InsertStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/InsertStatement.java
index 6d2c4f7..1e69a68 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/InsertStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/InsertStatement.java
@@ -24,7 +24,7 @@ import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.commons.lang3.ObjectUtils;
 
-public class InsertStatement extends Statement {
+public class InsertStatement implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier datasetName;
@@ -40,7 +40,7 @@ public class InsertStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.INSERT;
+        return Statement.Kind.INSERT;
     }
 
     public Identifier getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/LoadStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/LoadStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/LoadStatement.java
index efea76c..849b0bd 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/LoadStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/LoadStatement.java
@@ -25,7 +25,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class LoadStatement extends Statement {
+public class LoadStatement implements Statement {
 
     private Identifier datasetName;
     private Identifier dataverseName;
@@ -68,7 +68,7 @@ public class LoadStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.LOAD;
+        return Statement.Kind.LOAD;
     }
 
     public Identifier getDatasetName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodeGroupDropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodeGroupDropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodeGroupDropStatement.java
index 5f6a0a2..710bedd 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodeGroupDropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodeGroupDropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class NodeGroupDropStatement extends Statement {
+public class NodeGroupDropStatement implements Statement {
 
     private Identifier nodeGroupName;
     private boolean ifExists;
@@ -35,7 +35,7 @@ public class NodeGroupDropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.NODEGROUP_DROP;
+        return Statement.Kind.NODEGROUP_DROP;
     }
 
     public Identifier getNodeGroupName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodegroupDecl.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodegroupDecl.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodegroupDecl.java
index 25244ad..4232584 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodegroupDecl.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodegroupDecl.java
@@ -25,7 +25,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class NodegroupDecl extends Statement {
+public class NodegroupDecl implements Statement {
 
     private Identifier nodegroupName;
     private List<Identifier> nodeControllerNames;
@@ -55,7 +55,7 @@ public class NodegroupDecl extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.NODEGROUP_DECL;
+        return Statement.Kind.NODEGROUP_DECL;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/Query.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/Query.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/Query.java
index 8a40ae9..80853c8 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/Query.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/Query.java
@@ -27,7 +27,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.commons.lang3.ObjectUtils;
 
-public class Query extends Statement {
+public class Query implements Statement {
     private boolean topLevel = true;
     private Expression body;
     private int varCounter;
@@ -72,7 +72,7 @@ public class Query extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.QUERY;
+        return Statement.Kind.QUERY;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RefreshExternalDatasetStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RefreshExternalDatasetStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RefreshExternalDatasetStatement.java
index 47c4ca0..277b4bf 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RefreshExternalDatasetStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RefreshExternalDatasetStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class RefreshExternalDatasetStatement extends Statement {
+public class RefreshExternalDatasetStatement implements Statement {
 
     private Identifier dataverseName;
     private Identifier datasetName;
@@ -51,7 +51,7 @@ public class RefreshExternalDatasetStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.EXTERNAL_DATASET_REFRESH;
+        return Statement.Kind.EXTERNAL_DATASET_REFRESH;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RunStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RunStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RunStatement.java
index bfdc4a0..6b33078 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RunStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RunStatement.java
@@ -25,7 +25,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class RunStatement extends Statement {
+public class RunStatement implements Statement {
 
     private String system;
     private List<String> parameters;
@@ -75,7 +75,7 @@ public class RunStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.RUN;
+        return Statement.Kind.RUN;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/SetStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/SetStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/SetStatement.java
index 044e42a..54ba599 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/SetStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/SetStatement.java
@@ -22,7 +22,7 @@ import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class SetStatement extends Statement {
+public class SetStatement implements Statement {
 
     private String propName;
     private String propValue;
@@ -42,7 +42,7 @@ public class SetStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.SET;
+        return Statement.Kind.SET;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDecl.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDecl.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDecl.java
index 6d41640..e25688e 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDecl.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDecl.java
@@ -25,7 +25,7 @@ import org.apache.asterix.lang.common.expression.TypeExpression;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class TypeDecl extends Statement {
+public class TypeDecl implements Statement {
 
     private final Identifier dataverseName;
     private final Identifier ident;
@@ -64,7 +64,7 @@ public class TypeDecl extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.TYPE_DECL;
+        return Statement.Kind.TYPE_DECL;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/806f7d26/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDropStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDropStatement.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDropStatement.java
index a4bbe96..d675054 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDropStatement.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDropStatement.java
@@ -23,7 +23,7 @@ import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
-public class TypeDropStatement extends Statement {
+public class TypeDropStatement implements Statement {
 
     private final Identifier dataverseName;
     private Identifier typeName;
@@ -37,7 +37,7 @@ public class TypeDropStatement extends Statement {
 
     @Override
     public byte getKind() {
-        return Statement.TYPE_DROP;
+        return Statement.Kind.TYPE_DROP;
     }
 
     public Identifier getDataverseName() {


Mime
View raw message