Michael Blow has submitted this change and it was merged.

Change subject: [NO ISSUE] Use enum for Statement.Kind
......................................................................


[NO ISSUE] Use enum for Statement.Kind

Change-Id: Iedb1a6fb799165c4375c56e85dd43854514a3aea
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2384
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhub...@apache.org>
---
R 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java
M 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
M 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/CompiledStatements.java
M 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/Statement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CompactStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/ConnectFeedStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateDataverseStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedPolicyStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFeedStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateFunctionStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/CreateIndexStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DatasetDecl.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDecl.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DataverseDropStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DeleteStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DisconnectFeedStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropDatasetStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedDropStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FeedPolicyDropStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDecl.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/FunctionDropStatement.java
D 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDecl.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDropStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/InsertStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/LoadStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodeGroupDropStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/NodegroupDecl.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/Query.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/RefreshExternalDatasetStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/SetStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StartFeedStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StopFeedStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDecl.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/TypeDropStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpdateStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpsertStatement.java
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/WriteStatement.java
M 
asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
40 files changed, 136 insertions(+), 178 deletions(-)

Approvals:
  Jenkins: Verified; No violations found; ; Verified
  Murtadha Hubail: Looks good to me, approved



diff --git 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/IExtensionStatement.java
 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java
similarity index 91%
rename from 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/IExtensionStatement.java
rename to 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java
index 48441a3..724b284 100644
--- 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/IExtensionStatement.java
+++ 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java
@@ -29,10 +29,10 @@
 /**
  * An interface that provides an extension mechanism to extend a language with 
additional statements
  */
-public interface IExtensionStatement extends Statement {
+public abstract class ExtensionStatement implements Statement {
 
     @Override
-    default byte getKind() {
+    public final Kind getKind() {
         return Kind.EXTENSION;
     }
 
@@ -48,7 +48,7 @@
      * @throws HyracksDataException
      * @throws AlgebricksException
      */
-    void handle(IHyracksClientConnection hcc, IStatementExecutor 
statementExecutor,
+    public abstract void handle(IHyracksClientConnection hcc, 
IStatementExecutor statementExecutor,
             IRequestParameters requestParameters, MetadataProvider 
metadataProvider, int resultSetId)
             throws HyracksDataException, AlgebricksException;
 }
\ No newline at end of file
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 acf2908..0eb8e0a 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 @@
         String message = null;
         String dataverse = defaultDataverse != null ? 
defaultDataverse.getDataverseName() : null;
         switch (stmt.getKind()) {
-            case Statement.Kind.INSERT:
+            case INSERT:
                 InsertStatement insertStmt = (InsertStatement) stmt;
                 if (insertStmt.getDataverseName() != null) {
                     dataverse = insertStmt.getDataverseName().getValue();
@@ -119,7 +119,7 @@
                 }
                 break;
 
-            case Statement.Kind.DELETE:
+            case DELETE:
                 DeleteStatement deleteStmt = (DeleteStatement) stmt;
                 if (deleteStmt.getDataverseName() != null) {
                     dataverse = deleteStmt.getDataverseName().getValue();
@@ -131,7 +131,7 @@
                 }
                 break;
 
-            case Statement.Kind.DATAVERSE_DROP:
+            case DATAVERSE_DROP:
                 DataverseDropStatement dvDropStmt = (DataverseDropStatement) 
stmt;
                 invalidOperation =
                         
MetadataConstants.METADATA_DATAVERSE_NAME.equals(dvDropStmt.getDataverseName().getValue());
@@ -140,7 +140,7 @@
                 }
                 break;
 
-            case Statement.Kind.DATASET_DROP:
+            case DATASET_DROP:
                 DropDatasetStatement dropStmt = (DropDatasetStatement) stmt;
                 if (dropStmt.getDataverseName() != null) {
                     dataverse = dropStmt.getDataverseName().getValue();
@@ -151,7 +151,7 @@
                             + MetadataConstants.METADATA_DATAVERSE_NAME;
                 }
                 break;
-            case Statement.Kind.DATASET_DECL:
+            case DATASET_DECL:
                 DatasetDecl datasetStmt = (DatasetDecl) stmt;
                 Map<String, String> hints = datasetStmt.getHints();
                 if (hints != null && !hints.isEmpty()) {
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 068aa29..3a4682e 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
@@ -35,9 +35,9 @@
  */
 public class CompiledStatements {
 
-    public static interface ICompiledStatement {
+    public interface ICompiledStatement {
 
-        public byte getKind();
+        Statement.Kind getKind();
     }
 
     public static class CompiledDatasetDropStatement implements 
ICompiledStatement {
@@ -58,7 +58,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.DATASET_DROP;
         }
     }
@@ -82,7 +82,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.CREATE_DATAVERSE;
         }
     }
@@ -99,7 +99,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.NODEGROUP_DROP;
         }
     }
@@ -128,7 +128,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.INDEX_DROP;
         }
     }
@@ -151,7 +151,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.DATAVERSE_DROP;
         }
     }
@@ -168,7 +168,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.TYPE_DROP;
         }
     }
@@ -208,7 +208,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.CREATE_INDEX;
         }
     }
@@ -252,7 +252,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.LOAD;
         }
     }
@@ -302,7 +302,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.INSERT;
         }
     }
@@ -315,7 +315,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.UPSERT;
         }
     }
@@ -349,7 +349,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.SUBSCRIBE_FEED;
         }
     }
@@ -393,7 +393,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.DELETE;
         }
 
@@ -417,7 +417,7 @@
         }
 
         @Override
-        public byte getKind() {
+        public Statement.Kind getKind() {
             return Statement.Kind.COMPACT;
         }
     }
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 a3d3ac9..8b072c7 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
@@ -392,16 +392,16 @@
             Mutable<ILogicalExpression> varRef = new MutableObject<>(new 
VariableReferenceExpression(resVar));
             ILogicalOperator leafOperator;
             switch (stmt.getKind()) {
-                case Statement.Kind.INSERT:
+                case INSERT:
                     leafOperator = translateInsert(targetDatasource, varRef, 
varRefsForLoading,
                             additionalFilteringExpressions, assign, stmt);
                     break;
-                case Statement.Kind.UPSERT:
+                case UPSERT:
                     leafOperator = translateUpsert(targetDatasource, varRef, 
varRefsForLoading,
                             additionalFilteringExpressions, assign, 
additionalFilteringField, unnestVar, topOp, exprs,
                             resVar, additionalFilteringAssign, stmt);
                     break;
-                case Statement.Kind.DELETE:
+                case DELETE:
                     leafOperator = translateDelete(targetDatasource, varRef, 
varRefsForLoading,
                             additionalFilteringExpressions, assign);
                     break;
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 51adb76..7bf65c7 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -42,7 +42,7 @@
 import org.apache.asterix.active.EntityId;
 import org.apache.asterix.active.IActiveEntityEventsListener;
 import org.apache.asterix.active.NoRetryPolicyFactory;
-import org.apache.asterix.algebra.extension.IExtensionStatement;
+import org.apache.asterix.algebra.extension.ExtensionStatement;
 import org.apache.asterix.api.common.APIFramework;
 import org.apache.asterix.api.http.server.AbstractQueryApiServlet;
 import org.apache.asterix.api.http.server.ApiServlet;
@@ -290,53 +290,53 @@
                 
metadataProvider.setResultSerializerFactoryProvider(resultSerializerFactoryProvider);
                 metadataProvider.setOutputFile(outputFile);
                 switch (stmt.getKind()) {
-                    case Statement.Kind.SET:
+                    case SET:
                         handleSetStatement(stmt, config);
                         break;
-                    case Statement.Kind.DATAVERSE_DECL:
+                    case DATAVERSE_DECL:
                         activeDataverse = 
handleUseDataverseStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.CREATE_DATAVERSE:
+                    case CREATE_DATAVERSE:
                         handleCreateDataverseStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.DATASET_DECL:
+                    case DATASET_DECL:
                         handleCreateDatasetStatement(metadataProvider, stmt, 
hcc, requestParameters);
                         break;
-                    case Statement.Kind.CREATE_INDEX:
+                    case CREATE_INDEX:
                         handleCreateIndexStatement(metadataProvider, stmt, 
hcc, requestParameters);
                         break;
-                    case Statement.Kind.TYPE_DECL:
+                    case TYPE_DECL:
                         handleCreateTypeStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.NODEGROUP_DECL:
+                    case NODEGROUP_DECL:
                         handleCreateNodeGroupStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.DATAVERSE_DROP:
+                    case DATAVERSE_DROP:
                         handleDataverseDropStatement(metadataProvider, stmt, 
hcc);
                         break;
-                    case Statement.Kind.DATASET_DROP:
+                    case DATASET_DROP:
                         handleDatasetDropStatement(metadataProvider, stmt, 
hcc, requestParameters);
                         break;
-                    case Statement.Kind.INDEX_DROP:
+                    case INDEX_DROP:
                         handleIndexDropStatement(metadataProvider, stmt, hcc, 
requestParameters);
                         break;
-                    case Statement.Kind.TYPE_DROP:
+                    case TYPE_DROP:
                         handleTypeDropStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.NODEGROUP_DROP:
+                    case NODEGROUP_DROP:
                         handleNodegroupDropStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.CREATE_FUNCTION:
+                    case CREATE_FUNCTION:
                         handleCreateFunctionStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.FUNCTION_DROP:
+                    case FUNCTION_DROP:
                         handleFunctionDropStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.LOAD:
+                    case LOAD:
                         handleLoadStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.Kind.INSERT:
-                    case Statement.Kind.UPSERT:
+                    case INSERT:
+                    case UPSERT:
                         if (((InsertStatement) stmt).getReturnExpression() != 
null) {
                             metadataProvider.setResultSetId(new 
ResultSetId(resultSetIdCounter++));
                             metadataProvider.setResultAsyncMode(resultDelivery 
== ResultDelivery.ASYNC
@@ -346,34 +346,34 @@
                         handleInsertUpsertStatement(metadataProvider, stmt, 
hcc, hdc, resultDelivery, outMetadata,
                                 stats, false, clientContextId);
                         break;
-                    case Statement.Kind.DELETE:
+                    case DELETE:
                         handleDeleteStatement(metadataProvider, stmt, hcc, 
false);
                         break;
-                    case Statement.Kind.CREATE_FEED:
+                    case CREATE_FEED:
                         handleCreateFeedStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.DROP_FEED:
+                    case DROP_FEED:
                         handleDropFeedStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.Kind.DROP_FEED_POLICY:
+                    case DROP_FEED_POLICY:
                         handleDropFeedPolicyStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.CONNECT_FEED:
+                    case CONNECT_FEED:
                         handleConnectFeedStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.DISCONNECT_FEED:
+                    case DISCONNECT_FEED:
                         handleDisconnectFeedStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.START_FEED:
+                    case START_FEED:
                         handleStartFeedStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.Kind.STOP_FEED:
+                    case STOP_FEED:
                         handleStopFeedStatement(metadataProvider, stmt);
                         break;
-                    case Statement.Kind.CREATE_FEED_POLICY:
+                    case CREATE_FEED_POLICY:
                         handleCreateFeedPolicyStatement(metadataProvider, 
stmt);
                         break;
-                    case Statement.Kind.QUERY:
+                    case QUERY:
                         metadataProvider.setResultSetId(new 
ResultSetId(resultSetIdCounter++));
                         metadataProvider.setResultAsyncMode(
                                 resultDelivery == ResultDelivery.ASYNC || 
resultDelivery == ResultDelivery.DEFERRED);
@@ -381,22 +381,22 @@
                         handleQuery(metadataProvider, (Query) stmt, hcc, hdc, 
resultDelivery, outMetadata, stats,
                                 clientContextId, ctx);
                         break;
-                    case Statement.Kind.COMPACT:
+                    case COMPACT:
                         handleCompactStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.Kind.EXTERNAL_DATASET_REFRESH:
+                    case EXTERNAL_DATASET_REFRESH:
                         
handleExternalDatasetRefreshStatement(metadataProvider, stmt, hcc);
                         break;
-                    case Statement.Kind.WRITE:
+                    case WRITE:
                         Pair<IAWriterFactory, FileSplit> result = 
handleWriteStatement(stmt);
                         writerFactory = (result.first != null) ? result.first 
: writerFactory;
                         outputFile = result.second;
                         break;
-                    case Statement.Kind.FUNCTION_DECL:
+                    case FUNCTION_DECL:
                         // No op
                         break;
-                    case Statement.Kind.EXTENSION:
-                        ((IExtensionStatement) stmt).handle(hcc, this, 
requestParameters, metadataProvider,
+                    case EXTENSION:
+                        ((ExtensionStatement) stmt).handle(hcc, this, 
requestParameters, metadataProvider,
                                 resultSetIdCounter);
                         break;
                     default:
@@ -1912,12 +1912,12 @@
         String datasetName = rewrittenInsertUpsert.getDatasetName().getValue();
         CompiledInsertStatement clfrqs;
         switch (insertUpsert.getKind()) {
-            case Statement.Kind.INSERT:
+            case INSERT:
                 clfrqs = new CompiledInsertStatement(dataverseName, 
datasetName, rewrittenInsertUpsert.getQuery(),
                         rewrittenInsertUpsert.getVarCounter(), 
rewrittenInsertUpsert.getVar(),
                         rewrittenInsertUpsert.getReturnExpression());
                 break;
-            case Statement.Kind.UPSERT:
+            case UPSERT:
                 clfrqs = new CompiledUpsertStatement(dataverseName, 
datasetName, rewrittenInsertUpsert.getQuery(),
                         rewrittenInsertUpsert.getVarCounter(), 
rewrittenInsertUpsert.getVar(),
                         rewrittenInsertUpsert.getReturnExpression());
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 5d8fb69..cb792d9 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
@@ -20,13 +20,11 @@
 
 public interface Statement extends ILangExpression {
     /**
-     * get a byte representing the statement kind.
-     * Note: bytes 0x00 - 0x7f are reserved for core asterix statements
-     * Use negative bytes for extension statements
+     * The statement kind.
      *
-     * @return kind byte
+     * @return kind
      */
-    byte getKind();
+    Kind getKind();
 
     /**
      *  get a byte representing the statement category.
@@ -50,46 +48,40 @@
         }
     }
 
-    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_FEED = 0x16;
-        public static final byte DROP_FEED = 0x17;
-        public static final byte START_FEED = 0x18;
-        public static final byte STOP_FEED = 0x19;
-        public static final byte CONNECT_FEED = 0x1a;
-        public static final byte DISCONNECT_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;
-        // 0x22 unused
-        public static final byte EXTENSION = 0x23;
-        public static final byte SUBSCRIBE_FEED = 0x24;
-
-        private Kind() {
-        }
+    enum Kind {
+        DATASET_DECL,
+        DATAVERSE_DECL,
+        DATAVERSE_DROP,
+        DATASET_DROP,
+        DELETE,
+        INSERT,
+        UPSERT,
+        UPDATE,
+        FUNCTION_DECL,
+        LOAD,
+        NODEGROUP_DECL,
+        NODEGROUP_DROP,
+        QUERY,
+        SET,
+        TYPE_DECL,
+        TYPE_DROP,
+        WRITE,
+        CREATE_INDEX,
+        CREATE_DATAVERSE,
+        INDEX_DROP,
+        CREATE_FEED,
+        DROP_FEED,
+        START_FEED,
+        STOP_FEED,
+        CONNECT_FEED,
+        DISCONNECT_FEED,
+        CREATE_FEED_POLICY,
+        DROP_FEED_POLICY,
+        CREATE_FUNCTION,
+        FUNCTION_DROP,
+        COMPACT,
+        EXTERNAL_DATASET_REFRESH,
+        SUBSCRIBE_FEED,
+        EXTENSION,
     }
 }
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 08f12c3..d2cc431 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
@@ -34,7 +34,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.COMPACT;
     }
 
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 3d8fc68..3b6a1c3 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
@@ -65,7 +65,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.CONNECT_FEED;
     }
 
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 b03955a..dcbf334 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
@@ -49,7 +49,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.CREATE_DATAVERSE;
     }
 
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 466920d..2deec27 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
@@ -58,7 +58,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.CREATE_FEED_POLICY;
     }
 
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 ba2cdc4..a4acfdf 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
@@ -61,7 +61,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Kind.CREATE_FEED;
     }
 
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 c817885..c5fa524 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
@@ -57,7 +57,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.CREATE_FUNCTION;
     }
 
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 0d6a7ed..1dc8673 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
@@ -119,7 +119,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.CREATE_INDEX;
     }
 
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 e63dae6..f8cf62c 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
@@ -214,7 +214,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DATASET_DECL;
     }
 
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 4da9c57..1b0c5cd 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
@@ -36,7 +36,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DATAVERSE_DECL;
     }
 
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 8346912..6349006 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
@@ -34,7 +34,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DATAVERSE_DROP;
     }
 
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 52be683..18045b5 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
@@ -46,7 +46,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DELETE;
     }
 
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 4352b18..33fa559 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
@@ -61,7 +61,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DISCONNECT_FEED;
     }
 
diff --git 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropDatasetStatement.java
 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropDatasetStatement.java
index 27eda01..45f5875 100644
--- 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropDatasetStatement.java
+++ 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/DropDatasetStatement.java
@@ -36,7 +36,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DATASET_DROP;
     }
 
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 a06ed80..47e51e3 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
@@ -36,7 +36,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DROP_FEED;
     }
 
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 b511b06..1b23237 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
@@ -36,7 +36,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.DROP_FEED_POLICY;
     }
 
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 78567b5..2ea6c40 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
@@ -73,7 +73,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.FUNCTION_DECL;
     }
 
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 41cec29..610a20d 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
@@ -34,7 +34,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.FUNCTION_DROP;
     }
 
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
deleted file mode 100644
index 74cf0af..0000000
--- 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/IndexDecl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.lang.common.statement;
-
-import org.apache.asterix.lang.common.base.Statement;
-
-public class IndexDecl extends CreateIndexStatement {
-    @Override
-    public byte getKind() {
-        return Statement.Kind.INDEX_DECL;
-    }
-}
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 d20e2eb..c262855 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
@@ -39,7 +39,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.INDEX_DROP;
     }
 
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 797f48a..de12dee 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
@@ -51,7 +51,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.INSERT;
     }
 
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 82527b1..92ea383 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
@@ -67,7 +67,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.LOAD;
     }
 
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 7fa5056..5ec0181 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
@@ -34,7 +34,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.NODEGROUP_DROP;
     }
 
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 c5e1d9c..1213f11 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
@@ -54,7 +54,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.NODEGROUP_DECL;
     }
 
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 db74938..6f2b6de 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
@@ -101,7 +101,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.QUERY;
     }
 
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 a6eb257..78d766c 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
@@ -50,7 +50,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.EXTERNAL_DATASET_REFRESH;
     }
 
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 52b839c..17727af 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
@@ -41,7 +41,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.SET;
     }
 
diff --git 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StartFeedStatement.java
 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StartFeedStatement.java
index b3452b5..bc37c42 100644
--- 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StartFeedStatement.java
+++ 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StartFeedStatement.java
@@ -37,7 +37,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Kind.START_FEED;
     }
 
diff --git 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StopFeedStatement.java
 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StopFeedStatement.java
index c45933e..1fec6b2 100644
--- 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StopFeedStatement.java
+++ 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/StopFeedStatement.java
@@ -35,7 +35,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Kind.STOP_FEED;
     }
 
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 3aecfb3..4f0ea52 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
@@ -63,7 +63,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.TYPE_DECL;
     }
 
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 9a5557d..059ac67 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
@@ -36,7 +36,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.TYPE_DROP;
     }
 
diff --git 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpdateStatement.java
 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpdateStatement.java
index 8f3dbfc..0bdbbd1 100644
--- 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpdateStatement.java
+++ 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpdateStatement.java
@@ -43,7 +43,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.UPDATE;
     }
 
diff --git 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpsertStatement.java
 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpsertStatement.java
index bedaf43..178a8f9 100644
--- 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpsertStatement.java
+++ 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/UpsertStatement.java
@@ -31,24 +31,18 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.UPSERT;
     }
 
     @Override
     public int hashCode() {
-        return super.hashCode() + Statement.Kind.UPSERT;
+        return 31 * super.hashCode() + Statement.Kind.UPSERT.hashCode();
     }
 
     @Override
     public boolean equals(Object object) {
-        if (this == object) {
-            return true;
-        }
-        if (!(object instanceof UpsertStatement)) {
-            return false;
-        }
-        return super.equals(object);
+        return this == object || object instanceof UpsertStatement && 
super.equals(object);
     }
 
 }
diff --git 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/WriteStatement.java
 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/WriteStatement.java
index ae67ad0..5dd9935 100644
--- 
a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/WriteStatement.java
+++ 
b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/statement/WriteStatement.java
@@ -48,7 +48,7 @@
     }
 
     @Override
-    public byte getKind() {
+    public Kind getKind() {
         return Statement.Kind.WRITE;
     }
 
diff --git 
a/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
 
b/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
index 1121287..8ed9d50 100644
--- 
a/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
+++ 
b/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
@@ -36,8 +36,8 @@
     }
 
     @Override
-    public byte getKind() {
-        return -1;
+    public Kind getKind() {
+        return Kind.EXTENSION;
     }
 
     public String getArg() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iedb1a6fb799165c4375c56e85dd43854514a3aea
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Murtadha Hubail <mhub...@apache.org>
Gerrit-Reviewer: abdullah alamoudi <bamou...@gmail.com>

Reply via email to