[ 
https://issues.apache.org/jira/browse/GEODE-4079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16293287#comment-16293287
 ] 

ASF GitHub Bot commented on GEODE-4079:
---------------------------------------

nabarunnag closed pull request #1163: GEODE-4079: Deprecated Hash Index
URL: https://github.com/apache/geode/pull/1163
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 79bb0a38cb..702eca7026 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
@@ -50,7 +50,11 @@
    * <code>long int short byte char float double</code>
    *
    * @see QueryService#createIndex(String, IndexType, String, String)
+   * @deprecated Due to the overhead caused by rehashing while expanding the 
backing array, hash
+   *             index has been deprecated since Apache Geode 1.4.0. Use
+   *             {@link IndexType#FUNCTIONAL} instead.
    */
+  @Deprecated
   HASH("HASH"),
 
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/QueryService.java 
b/geode-core/src/main/java/org/apache/geode/cache/query/QueryService.java
index f244b226d9..7e49eb4715 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/QueryService.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/QueryService.java
@@ -14,9 +14,11 @@
  */
 package org.apache.geode.cache.query;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.List;
 
-import org.apache.geode.cache.*;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
 import org.apache.geode.cache.query.internal.Undefined;
 
 /**
@@ -76,7 +78,11 @@
    * @throws UnsupportedOperationException If Index is being created on a 
region which does not
    *         support indexes.
    *
+   * @deprecated Due to the overhead caused by rehashing while expanding the 
backing array, hash
+   *             index has been deprecated since Apache Geode 1.4.0. Use method
+   *             {@link QueryService#createIndex(String, String, String)} 
instead.
    */
+  @Deprecated
   public Index createHashIndex(String indexName, String indexedExpression, 
String regionPath)
       throws IndexInvalidException, IndexNameConflictException, 
IndexExistsException,
       RegionNotFoundException, UnsupportedOperationException;
@@ -120,7 +126,11 @@ public void defineKeyIndex(String indexName, String 
indexedExpression, String re
    *
    * @throws RegionNotFoundException if the region referred to in the 
fromClause doesn't exist
    *
+   * @deprecated Due to the overhead caused by rehashing while expanding the 
backing array, hash
+   *             index has been deprecated since Apache Geode 1.4.0. Use method
+   *             {@link QueryService#defineIndex(String, String, String)} 
instead.
    */
+  @Deprecated
   public void defineHashIndex(String indexName, String indexedExpression, 
String regionPath)
       throws RegionNotFoundException;
 
@@ -146,7 +156,12 @@ public void defineHashIndex(String indexName, String 
indexedExpression, String r
    *        mktValue field: indexExpression: "p.mktValue" regionPath: 
"/portfolio p"
    *
    * @throws RegionNotFoundException if the region referred to in the 
fromClause doesn't exist
+   *
+   * @deprecated Due to the overhead caused by rehashing while expanding the 
backing array, hash
+   *             index has been deprecated since Apache Geode 1.4.0. Use method
+   *             {@link QueryService#defineIndex(String, String, String, 
String)} instead.
    */
+  @Deprecated
   public void defineHashIndex(String indexName, String indexedExpression, 
String regionPath,
       String imports) throws RegionNotFoundException;
 
@@ -232,7 +247,12 @@ public void defineIndex(String indexName, String 
indexedExpression, String regio
    * @throws RegionNotFoundException if the region referred to in the 
fromClause doesn't exist
    * @throws UnsupportedOperationException If Index is being created on a 
region which overflows to
    *         disk
+   *
+   * @deprecated Due to the overhead caused by rehashing while expanding the 
backing array, hash
+   *             index has been deprecated since Apache Geode 1.4.0. Use method
+   *             {@link QueryService#createIndex(String, String, String, 
String)} instead
    */
+  @Deprecated
   public Index createHashIndex(String indexName, String indexedExpression, 
String regionPath,
       String imports) throws IndexInvalidException, IndexNameConflictException,
       IndexExistsException, RegionNotFoundException, 
UnsupportedOperationException;
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
index d38abeefd0..c0fc0aa4ea 100755
--- 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
@@ -86,7 +86,12 @@
  * This index does not support the storage of projection attributes.
  * <p>
  * Currently this implementation only supports an index on a region path.
+ *
+ * @deprecated Due to the overhead caused by rehashing while expanding the 
backing array, Hash Index
+ *             has been deprecated since Apache Geode 1.4.0. Instead the use of
+ *             {@link CompactRangeIndex} is recommended
  */
+@Deprecated
 public class HashIndex extends AbstractIndex {
   private static final Logger logger = LogService.getLogger();
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXml.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXml.java
index c0c05d4313..96017cdc6f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXml.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXml.java
@@ -543,6 +543,11 @@
   /** The name of the index type attribute */
   protected static final String INDEX_TYPE = "type";
   /** The name of the <code>hash-index</code> index type attribute */
+  /**
+   * @deprecated Due to the overhead caused by rehashing while expanding the 
backing array, Hash
+   *             Index has been deprecated since Apache Geode 1.4.0. Use 
{@link CacheXml#FUNCTIONAL}
+   */
+  @Deprecated
   protected static final String HASH_INDEX_TYPE = "hash";
   /** The name of the <code>range-index</code> index type attribute */
   protected static final String RANGE_INDEX_TYPE = "range";
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
index bbc823ceb6..6427d23073 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
@@ -734,11 +734,11 @@
       "Name/Id of the member in which the index will be created.";
   public static final String CREATE_INDEX__TYPE = "type";
   public static final String CREATE_INDEX__TYPE__HELP =
-      "Type of the index. Valid values are: range, key and hash.";
+      "Type of the index. Valid values are: range and key. Deprecated : hash 
has been deprecated since Apache Geode 1.4.0";
   public static final String CREATE_INDEX__GROUP__HELP =
       "Group of members in which the index will be created.";
   public static final String CREATE_INDEX__INVALID__INDEX__TYPE__MESSAGE =
-      "Invalid index type,value must be one of the following: range, key or 
hash.";
+      "Invalid index type,value must be one of the following: range, key and 
hash. Deprecated : hash has been deprecated since Apache Geode 1.4.0";
   public static final String CREATE_INDEX__SUCCESS__MSG =
       "Index successfully created with following details";
   public static final String CREATE_INDEX__FAILURE__MSG =


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Deprecate Hash Index and Hash Index APIs
> ----------------------------------------
>
>                 Key: GEODE-4079
>                 URL: https://issues.apache.org/jira/browse/GEODE-4079
>             Project: Geode
>          Issue Type: Bug
>          Components: docs, querying
>            Reporter: Jason Huynh
>             Fix For: 1.4.0
>
>
> As discussed on the user and dev list, we should deprecate the Hash Index and 
> the corresponding Hash Index APIs.
> The proposal:
> Currently the Hash Index name causes confusion. It is not a traditional hash 
> look up index, but more of memory savings index.  The index does not store 
> index keys in memory and must hash the keys every time.  The index 
> synchronizes on a backing array and when the backing array needs to be 
> expanded, it currently needs to rehash all elements in the array.  This can 
> be very problematic for larger data sets.
> There were improvements made to one of the functional indexes (compact range 
> index) prior to open sourcing.  These improvements helped reduce the memory 
> consumption of that index and makes it very similar sized to a hash index, 
> but the keys still are stored in memory.  Probably close enough to be a 
> replacement for the hash index in most cases.  The read/write performance on 
> it is also faster than the hash index.
> This works includes:
> Deprecating the Hash Index Class
> Deprecating the createHashIndex API's in query Service
> Deprecating the Hash Index type in IndexTypes (if possible)
> Deprecating the gfsh commands to create hash index and hash index types



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to