You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2017/10/11 17:06:47 UTC

[geode] branch develop updated: GEODE-3539: consolidate IndexType for better option verification (#910)

This is an automated email from the ASF dual-hosted git repository.

jinmeiliao pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new b2c7605  GEODE-3539: consolidate IndexType for better option verification (#910)
b2c7605 is described below

commit b2c7605e756bccdd24a94384f851352ff6bb7b90
Author: jinmeiliao <ji...@pivotal.io>
AuthorDate: Wed Oct 11 10:06:45 2017 -0700

    GEODE-3539: consolidate IndexType for better option verification (#910)
    
    * consolidate IndexType
    * simplify IndexType class and fix analyzeSerializable test
    * add unit test to make sure old behavior is preserved
---
 .../org/apache/geode/cache/query/IndexType.java    | 24 +++-------
 .../internal/cli/commands/CreateIndexCommand.java  |  9 ++--
 .../internal/cli/commands/DefineIndexCommand.java  |  9 ++--
 .../internal/cli/commands/ListIndexCommand.java    |  6 ++-
 .../internal/cli/domain/IndexDetails.java          | 56 +++-------------------
 .../management/internal/cli/domain/IndexInfo.java  | 16 +++----
 .../functions/CreateDefinedIndexesFunction.java    |  5 +-
 .../cli/functions/CreateIndexFunction.java         |  6 +--
 .../apache/geode/cache/query/IndexTypeTest.java    | 41 ++++++++++++++++
 .../cli/commands/IndexCommandsDUnitTest.java       |  2 +-
 .../cli/domain/IndexDetailsIntegrationTest.java    | 12 +++--
 .../cli/functions/ListIndexFunctionJUnitTest.java  | 18 ++-----
 .../geode/codeAnalysis/sanctionedSerializables.txt |  8 ++--
 13 files changed, 100 insertions(+), 112 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/IndexType.java b/geode-core/src/main/java/org/apache/geode/cache/query/IndexType.java
index 3c4862a..246b110 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/IndexType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/IndexType.java
@@ -22,8 +22,7 @@ package org.apache.geode.cache.query;
  *
  * @since GemFire 4.0
  */
-public class IndexType {
-
+public enum IndexType {
   /**
    * The index type of a functional index. A functional index is used for the comparison of some
    * function of a region value with a constant, using a relational operator. The indexedExpression
@@ -37,7 +36,7 @@ public class IndexType {
    *
    * @see QueryService#createIndex(String, IndexType, String, String)
    */
-  public static final IndexType FUNCTIONAL = new IndexType("FUNCTIONAL");
+  FUNCTIONAL("RANGE"),
 
   /**
    * The index type of a hash index. A hash index is used for the comparison of some function of a
@@ -52,7 +51,7 @@ public class IndexType {
    *
    * @see QueryService#createIndex(String, IndexType, String, String)
    */
-  public static final IndexType HASH = new IndexType("HASH");
+  HASH("HASH"),
 
 
   /**
@@ -69,25 +68,16 @@ public class IndexType {
    *
    * @see QueryService#createIndex(String, IndexType, String, String)
    */
-  public static final IndexType PRIMARY_KEY = new IndexType("PRIMARY_KEY");
-
-  // public static final IndexType MAP_INDEX = new IndexType("MAP_INDEX");
+  PRIMARY_KEY("KEY");
 
   private String name;
 
-  /** Creates a new instance of IndexType */
-  private IndexType(String name) {
+  IndexType(String name) {
     this.name = name;
   }
 
-  /**
-   * Return the index type as a String
-   * 
-   * @return the String representation of this IndexType
-   */
-  @Override
-  public String toString() {
-    return this.name;
+  public String getName() {
+    return name;
   }
 
 }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java
index 6f379d7..6124151 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java
@@ -27,6 +27,7 @@ import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.execute.ResultCollector;
+import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.lang.StringUtils;
 import org.apache.geode.management.cli.CliMetaData;
@@ -78,15 +79,15 @@ public class CreateIndexCommand implements GfshCommand {
     AtomicReference<XmlEntity> xmlEntity = new AtomicReference<>();
 
     try {
-      int idxType;
+      IndexType idxType;
 
       // Index type check
       if ("range".equalsIgnoreCase(indexType)) {
-        idxType = IndexInfo.RANGE_INDEX;
+        idxType = IndexType.FUNCTIONAL;
       } else if ("hash".equalsIgnoreCase(indexType)) {
-        idxType = IndexInfo.HASH_INDEX;
+        idxType = IndexType.HASH;
       } else if ("key".equalsIgnoreCase(indexType)) {
-        idxType = IndexInfo.KEY_INDEX;
+        idxType = IndexType.PRIMARY_KEY;
       } else {
         return ResultBuilder
             .createUserErrorResult(CliStrings.CREATE_INDEX__INVALID__INDEX__TYPE__MESSAGE);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DefineIndexCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DefineIndexCommand.java
index 1102cd8..00a12de 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DefineIndexCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DefineIndexCommand.java
@@ -19,6 +19,7 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.cache.Region;
+import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.internal.lang.StringUtils;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
@@ -49,15 +50,15 @@ public class DefineIndexCommand implements GfshCommand {
           help = CliStrings.DEFINE_INDEX__TYPE__HELP) final String indexType) {
 
     Result result;
-    int idxType;
+    IndexType idxType;
 
     // Index type check
     if ("range".equalsIgnoreCase(indexType)) {
-      idxType = IndexInfo.RANGE_INDEX;
+      idxType = IndexType.FUNCTIONAL;
     } else if ("hash".equalsIgnoreCase(indexType)) {
-      idxType = IndexInfo.HASH_INDEX;
+      idxType = IndexType.HASH;
     } else if ("key".equalsIgnoreCase(indexType)) {
-      idxType = IndexInfo.KEY_INDEX;
+      idxType = IndexType.PRIMARY_KEY;
     } else {
       return ResultBuilder
           .createUserErrorResult(CliStrings.DEFINE_INDEX__INVALID__INDEX__TYPE__MESSAGE);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListIndexCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListIndexCommand.java
index c892c3c..48eee68 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListIndexCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListIndexCommand.java
@@ -75,7 +75,11 @@ public class ListIndexCommand implements GfshCommand {
         indexData.accumulate("Member ID", indexDetails.getMemberId());
         indexData.accumulate("Region Path", indexDetails.getRegionPath());
         indexData.accumulate("Name", indexDetails.getIndexName());
-        indexData.accumulate("Type", StringUtils.defaultString(indexDetails.getIndexType()));
+        if (indexDetails.getIndexType() == null) {
+          indexData.accumulate("Type", "");
+        } else {
+          indexData.accumulate("Type", indexDetails.getIndexType().getName());
+        }
         indexData.accumulate("Indexed Expression", indexDetails.getIndexedExpression());
         indexData.accumulate("From Clause", indexDetails.getFromClause());
         indexData.accumulate("Valid Index", indexDetails.getIsValid());
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexDetails.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexDetails.java
index f79c859..d588cd8 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexDetails.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexDetails.java
@@ -15,15 +15,17 @@
 
 package org.apache.geode.management.internal.cli.domain;
 
+import java.io.Serializable;
+
 import org.apache.commons.lang.StringUtils;
+
 import org.apache.geode.cache.query.Index;
 import org.apache.geode.cache.query.IndexStatistics;
+import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.cache.query.internal.index.AbstractIndex;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.lang.ObjectUtils;
 
-import java.io.Serializable;
-
 /**
  * The IndexDetails class encapsulates information for an Index on a Region in the GemFire Cache.
  * </p>
@@ -146,14 +148,11 @@ public class IndexDetails implements Comparable<IndexDetails>, Serializable {
     return indexType;
   }
 
+
   public void setIndexType(final IndexType indexType) {
     this.indexType = indexType;
   }
 
-  public void setIndexType(final org.apache.geode.cache.query.IndexType indexType) {
-    setIndexType(IndexType.valueOf(indexType));
-  }
-
   public String getMemberId() {
     return memberId;
   }
@@ -233,7 +232,7 @@ public class IndexDetails implements Comparable<IndexDetails>, Serializable {
     buffer.append(" {fromClause = ").append(getFromClause());
     buffer.append(", indexExpression = ").append(getIndexedExpression());
     buffer.append(", indexName = ").append(getIndexName());
-    buffer.append(", indexType = ").append(getIndexType());
+    buffer.append(", indexType = ").append(getIndexType().getName());
     buffer.append(", memberId = ").append(getMemberId());
     buffer.append(", memberName = ").append(getMemberName());
     buffer.append(", regionName = ").append(getRegionName());
@@ -307,47 +306,4 @@ public class IndexDetails implements Comparable<IndexDetails>, Serializable {
       return buffer.toString();
     }
   }
-
-  public static enum IndexType {
-    FUNCTIONAL("RANGE"), HASH("HASH"), PRIMARY_KEY("KEY");
-
-    private final String description;
-
-    public static IndexType valueOf(final org.apache.geode.cache.query.IndexType indexType) {
-      for (final IndexType type : values()) {
-        if (type.name().equalsIgnoreCase(ObjectUtils.toString(indexType))) {
-          return type;
-        }
-      }
-      return null;
-    }
-
-    IndexType(final String description) {
-      assertValidArgument(StringUtils.isNotBlank(description),
-          "The description for the IndexType must be specified!");
-      this.description = description;
-    }
-
-    public String getDescription() {
-      return this.description;
-    }
-
-    public org.apache.geode.cache.query.IndexType getType() {
-      switch (this) {
-        case HASH:
-          return null;
-        case PRIMARY_KEY:
-          return org.apache.geode.cache.query.IndexType.PRIMARY_KEY;
-        case FUNCTIONAL:
-        default:
-          return org.apache.geode.cache.query.IndexType.FUNCTIONAL;
-      }
-    }
-
-    @Override
-    public String toString() {
-      return getDescription();
-    }
-  }
-
 }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexInfo.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexInfo.java
index ca95fc0..26c9b4e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexInfo.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/domain/IndexInfo.java
@@ -16,6 +16,8 @@ package org.apache.geode.management.internal.cli.domain;
 
 import java.io.Serializable;
 
+import org.apache.geode.cache.query.IndexType;
+
 /***
  * Data class used to pass index related information to functions that create or destroy indexes
  *
@@ -23,14 +25,11 @@ import java.io.Serializable;
 public class IndexInfo implements Serializable {
 
   private static final long serialVersionUID = 1L;
-  public final static int RANGE_INDEX = 1;
-  public final static int KEY_INDEX = 2;
-  public final static int HASH_INDEX = 3;
 
   private String indexName;
   private String indexedExpression = null;
   private String regionPath = null;
-  private int indexType = RANGE_INDEX;
+  private IndexType indexType = IndexType.FUNCTIONAL;
 
   public IndexInfo(String indexName) {
     this.indexName = indexName;
@@ -53,7 +52,8 @@ public class IndexInfo implements Serializable {
     this.regionPath = regionPath;
   }
 
-  public IndexInfo(String indexName, String indexedExpression, String regionPath, int indexType) {
+  public IndexInfo(String indexName, String indexedExpression, String regionPath,
+      IndexType indexType) {
     this.indexName = indexName;
     this.indexedExpression = indexedExpression;
     this.regionPath = regionPath;
@@ -84,11 +84,11 @@ public class IndexInfo implements Serializable {
     this.regionPath = regionPath;
   }
 
-  public int getIndexType() {
+  public IndexType getIndexType() {
     return indexType;
   }
 
-  public void setIndexType(int indexType) {
+  public void setIndexType(IndexType indexType) {
     this.indexType = indexType;
   }
 
@@ -101,7 +101,7 @@ public class IndexInfo implements Serializable {
     sb.append("\nRegion Path : ");
     sb.append(this.regionPath);
     sb.append("\nIndex Type : ");
-    sb.append(this.indexType);
+    sb.append(this.indexType.getName());
     return sb.toString();
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDefinedIndexesFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDefinedIndexesFunction.java
index c54ee21..1f30db6 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDefinedIndexesFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDefinedIndexesFunction.java
@@ -22,6 +22,7 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.cache.query.MultiIndexCreationException;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.internal.InternalEntity;
@@ -46,9 +47,9 @@ public class CreateDefinedIndexesFunction extends FunctionAdapter implements Int
         String indexName = indexDefinition.getIndexName();
         String indexedExpression = indexDefinition.getIndexedExpression();
         String regionPath = indexDefinition.getRegionPath();
-        if (indexDefinition.getIndexType() == IndexInfo.KEY_INDEX) {
+        if (indexDefinition.getIndexType() == IndexType.PRIMARY_KEY) {
           queryService.defineKeyIndex(indexName, indexedExpression, regionPath);
-        } else if (indexDefinition.getIndexType() == IndexInfo.HASH_INDEX) {
+        } else if (indexDefinition.getIndexType() == IndexType.HASH) {
           queryService.defineHashIndex(indexName, indexedExpression, regionPath);
         } else {
           queryService.defineIndex(indexName, indexedExpression, regionPath);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateIndexFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateIndexFunction.java
index 0e2695b..f30ecb8 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateIndexFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateIndexFunction.java
@@ -54,13 +54,13 @@ public class CreateIndexFunction extends FunctionAdapter implements InternalEnti
       String regionPath = regionPathTokens[0];
 
       switch (indexInfo.getIndexType()) {
-        case IndexInfo.RANGE_INDEX:
+        case FUNCTIONAL:
           queryService.createIndex(indexName, indexedExpression, fromClause);
           break;
-        case IndexInfo.KEY_INDEX:
+        case PRIMARY_KEY:
           queryService.createKeyIndex(indexName, indexedExpression, fromClause);
           break;
-        case IndexInfo.HASH_INDEX:
+        case HASH:
           queryService.createHashIndex(indexName, indexedExpression, fromClause);
           break;
         default:
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/IndexTypeTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/IndexTypeTest.java
new file mode 100644
index 0000000..d77c460
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/IndexTypeTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.geode.cache.query;
+
+import static org.assertj.core.api.Assertions.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.test.junit.categories.UnitTest;
+
+@Category(UnitTest.class)
+public class IndexTypeTest {
+
+  @Test
+  public void toStringMaintainsOldBehavior() throws Exception {
+    assertThat(IndexType.FUNCTIONAL.toString()).isEqualTo("FUNCTIONAL");
+    assertThat(IndexType.HASH.toString()).isEqualTo("HASH");
+    assertThat(IndexType.PRIMARY_KEY.toString()).isEqualTo("PRIMARY_KEY");
+  }
+
+  @Test
+  public void getNameReturnsExpectedValue() throws Exception {
+    assertThat(IndexType.FUNCTIONAL.getName()).isEqualTo("RANGE");
+    assertThat(IndexType.HASH.getName()).isEqualTo("HASH");
+    assertThat(IndexType.PRIMARY_KEY.getName()).isEqualTo("KEY");
+  }
+}
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsDUnitTest.java
index 722a48d..be0f338 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsDUnitTest.java
@@ -37,10 +37,10 @@ import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
 import org.apache.geode.test.dunit.rules.CleanupDUnitVMsRule;
-import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
 import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
 
 @Category(DistributedTest.class)
 public class IndexCommandsDUnitTest {
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/domain/IndexDetailsIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/domain/IndexDetailsIntegrationTest.java
index d43b13f..f804d53 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/domain/IndexDetailsIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/domain/IndexDetailsIntegrationTest.java
@@ -17,17 +17,19 @@ package org.apache.geode.management.internal.cli.domain;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache.query.Index;
+import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.test.junit.rules.ServerStarterRule;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 @Category(IntegrationTest.class)
 public class IndexDetailsIntegrationTest {
@@ -67,7 +69,7 @@ public class IndexDetailsIntegrationTest {
     assertThat(details.getMemberName()).isEqualTo(member.getName());
     assertThat(details.getFromClause()).isEqualTo(INDEX_REGION_NAME);
     assertThat(details.getIndexedExpression()).isEqualTo("key");
-    assertThat(details.getIndexType()).isEqualTo(IndexDetails.IndexType.FUNCTIONAL);
+    assertThat(details.getIndexType()).isEqualTo(IndexType.FUNCTIONAL);
     assertThat(details.getProjectionAttributes()).isEqualTo("*");
     assertThat(details.getIsValid()).isEqualTo(true);
 
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java
index 583aa56..01b934e 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/ListIndexFunctionJUnitTest.java
@@ -14,7 +14,10 @@
  */
 package org.apache.geode.management.internal.cli.functions;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Arrays;
 import java.util.Collections;
@@ -179,7 +182,7 @@ public class ListIndexFunctionJUnitTest {
         exactly(2).of(mockIndex).getRegion();
         will(returnValue(mockRegion));
         oneOf(mockIndex).getType();
-        will(returnValue(getIndexType(indexDetails.getIndexType())));
+        will(returnValue(indexDetails.getIndexType()));
         oneOf(mockRegion).getName();
         will(returnValue(indexDetails.getRegionName()));
         oneOf(mockRegion).getFullPath();
@@ -220,17 +223,6 @@ public class ListIndexFunctionJUnitTest {
     return mockIndex;
   }
 
-  private IndexType getIndexType(final IndexDetails.IndexType type) {
-    switch (type) {
-      case FUNCTIONAL:
-        return IndexType.FUNCTIONAL;
-      case PRIMARY_KEY:
-        return IndexType.PRIMARY_KEY;
-      default:
-        return null;
-    }
-  }
-
   @Test
   @SuppressWarnings("unchecked")
   public void testExecute() throws Throwable {
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
index ca9b846..7898aeb 100755
--- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
+++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
@@ -141,6 +141,7 @@ org/apache/geode/cache/query/IndexExistsException,true,-168312863985932144
 org/apache/geode/cache/query/IndexInvalidException,true,3285601274732772770
 org/apache/geode/cache/query/IndexMaintenanceException,true,3326023943226474039
 org/apache/geode/cache/query/IndexNameConflictException,true,7047969935188485334
+org/apache/geode/cache/query/IndexType,false,name:java/lang/String
 org/apache/geode/cache/query/MultiIndexCreationException,true,6312081720315894780,exceptionsMap:java/util/Map
 org/apache/geode/cache/query/NameNotFoundException,true,4827972941932684358
 org/apache/geode/cache/query/NameResolutionException,true,-7409771357534316562
@@ -511,10 +512,9 @@ org/apache/geode/management/internal/cli/domain/DiskStoreDetails$RegionDetails,f
 org/apache/geode/management/internal/cli/domain/DurableCqNamesResult,true,1,cqNames:java/util/List
 org/apache/geode/management/internal/cli/domain/EvictionAttributesInfo,true,1,evictionAction:java/lang/String,evictionAlgorithm:java/lang/String,evictionMaxValue:int,nonDefaultAttributes:java/util/Map
 org/apache/geode/management/internal/cli/domain/FixedPartitionAttributesInfo,true,1,isPrimary:boolean,numBuckets:int,partitionName:java/lang/String
-org/apache/geode/management/internal/cli/domain/IndexDetails,true,-2198907141534201288,fromClause:java/lang/String,indexName:java/lang/String,indexStatisticsDetails:org/apache/geode/management/internal/cli/domain/IndexDetails$IndexStatisticsDetails,indexType:org/apache/geode/management/internal/cli/domain/IndexDetails$IndexType,indexedExpression:java/lang/String,isValid:boolean,memberId:java/lang/String,memberName:java/lang/String,projectionAttributes:java/lang/String,regionName:java/lan [...]
+org/apache/geode/management/internal/cli/domain/IndexDetails,true,-2198907141534201288,fromClause:java/lang/String,indexName:java/lang/String,indexStatisticsDetails:org/apache/geode/management/internal/cli/domain/IndexDetails$IndexStatisticsDetails,indexType:org/apache/geode/cache/query/IndexType,indexedExpression:java/lang/String,isValid:boolean,memberId:java/lang/String,memberName:java/lang/String,projectionAttributes:java/lang/String,regionName:java/lang/String,regionPath:java/lang/String
 org/apache/geode/management/internal/cli/domain/IndexDetails$IndexStatisticsDetails,false,numberOfKeys:java/lang/Long,numberOfUpdates:java/lang/Long,numberOfValues:java/lang/Long,totalUpdateTime:java/lang/Long,totalUses:java/lang/Long
-org/apache/geode/management/internal/cli/domain/IndexDetails$IndexType,false,description:java/lang/String
-org/apache/geode/management/internal/cli/domain/IndexInfo,true,1,indexName:java/lang/String,indexType:int,indexedExpression:java/lang/String,regionPath:java/lang/String
+org/apache/geode/management/internal/cli/domain/IndexInfo,true,1,indexName:java/lang/String,indexType:org/apache/geode/cache/query/IndexType,indexedExpression:java/lang/String,regionPath:java/lang/String
 org/apache/geode/management/internal/cli/domain/MemberConfigurationInfo,false,cacheAttributes:java/util/Map,cacheServerAttributes:java/util/List,gfePropsRuntime:java/util/Map,gfePropsSetFromFile:java/util/Map,gfePropsSetUsingApi:java/util/Map,gfePropsSetWithDefaults:java/util/Map,jvmInputArguments:java/util/List,pdxAttributes:java/util/Map,systemProperties:java/util/Properties
 org/apache/geode/management/internal/cli/domain/MemberInformation,true,1,cacheServerList:java/util/List,cacheXmlFilePath:java/lang/String,clientCount:int,cpuUsage:double,groups:java/lang/String,heapUsage:java/lang/String,host:java/lang/String,hostedRegions:java/util/Set,id:java/lang/String,initHeapSize:java/lang/String,isServer:boolean,locatorBindAddress:java/lang/String,locatorPort:int,locators:java/lang/String,logFilePath:java/lang/String,maxHeapSize:java/lang/String,name:java/lang/Str [...]
 org/apache/geode/management/internal/cli/domain/MemberResult,true,1,errorMessage:java/lang/String,exceptionMessage:java/lang/String,isSuccessful:boolean,memberNameOrId:java/lang/String,opPossible:boolean,successMessage:java/lang/String
@@ -817,4 +817,4 @@ org/apache/geode/redis/internal/executor/list/ListExecutor$ListDirection,false
 org/apache/geode/security/AuthenticationFailedException,true,-8202866472279088879
 org/apache/geode/security/AuthenticationRequiredException,true,4675976651103154919
 org/apache/geode/security/GemFireSecurityException,true,3814254578203076926,cause:java/lang/Throwable
-org/apache/geode/security/NotAuthorizedException,true,419215768216387745,principal:java/security/Principal
+org/apache/geode/security/NotAuthorizedException,true,419215768216387745,principal:java/security/Principal
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].