geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject incubator-geode git commit: [GEODE-440] RangeIndexAPIJUnitTest.testQueryMethod_2 Added a flag to ignore the update in progress calculation for querying
Date Tue, 20 Oct 2015 20:35:19 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-409 17d00616f -> f8935b3b8


[GEODE-440] RangeIndexAPIJUnitTest.testQueryMethod_2
Added a flag to ignore the update in progress calculation for querying


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/f8935b3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/f8935b3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/f8935b3b

Branch: refs/heads/feature/GEODE-409
Commit: f8935b3b81e3abc9a5e0a0a9d91f89a449aca251
Parents: 17d0061
Author: Jason Huynh <jhuynh@pivotal.io>
Authored: Tue Oct 20 13:33:12 2015 -0700
Committer: Jason Huynh <jhuynh@pivotal.io>
Committed: Tue Oct 20 13:33:12 2015 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/cache/query/internal/index/IndexManager.java | 3 ++-
 .../cache/query/internal/index/RangeIndexAPIJUnitTest.java        | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f8935b3b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/IndexManager.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/IndexManager.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/IndexManager.java
index 0a9b166..2c597a8 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/IndexManager.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/IndexManager.java
@@ -134,6 +134,7 @@ public class IndexManager  {
   public static final int INDEX_ELEMARRAY_THRESHOLD = Integer.parseInt(System.getProperty(INDEX_ELEMARRAY_THRESHOLD_PROP,"100"));
   public static final int INDEX_ELEMARRAY_SIZE = Integer.parseInt(System.getProperty(INDEX_ELEMARRAY_SIZE_PROP,"5"));
   public final static AtomicLong SAFE_QUERY_TIME = new AtomicLong(0);
+  public static boolean ENABLE_UPDATE_IN_PROGRESS_INDEX_CALCULATION = true;
   /** The NULL constant */
   public static final Object NULL = new NullToken();
 
@@ -205,7 +206,7 @@ public class IndexManager  {
    * @param lastModifiedTime
    */
   public static boolean needsRecalculation(long queryStartTime, long lastModifiedTime) {
-    return queryStartTime <= SAFE_QUERY_TIME.get() - queryStartTime + lastModifiedTime;
+    return ENABLE_UPDATE_IN_PROGRESS_INDEX_CALCULATION && queryStartTime <= SAFE_QUERY_TIME.get()
- queryStartTime + lastModifiedTime;
   }
   
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f8935b3b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/RangeIndexAPIJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/RangeIndexAPIJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/RangeIndexAPIJUnitTest.java
index b9f6ff8..430728c 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/RangeIndexAPIJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/RangeIndexAPIJUnitTest.java
@@ -56,6 +56,7 @@ public class RangeIndexAPIJUnitTest {
   @Before
   public void setUp() throws java.lang.Exception {
     CacheUtils.startCache();
+    IndexManager.ENABLE_UPDATE_IN_PROGRESS_INDEX_CALCULATION = false;
     region = CacheUtils.createRegion("portfolios", Portfolio.class);
     for (int i = 0; i < 12; i++) {
       //CacheUtils.log(new Portfolio(i));
@@ -71,6 +72,7 @@ public class RangeIndexAPIJUnitTest {
 
   @After
   public void tearDown() throws java.lang.Exception {
+    IndexManager.ENABLE_UPDATE_IN_PROGRESS_INDEX_CALCULATION = true;
     CacheUtils.closeCache();
   }
 


Mime
View raw message