incubator-geode git commit: GEODE-188:wrong name for the gateway substitution filter in 'create async-event-queue' command -replaced string gateway-event-substitution-listener with gateway-event-su

2015-08-06 Thread kishorbachhav
Repository: incubator-geode
Updated Branches:
  refs/heads/develop c575983f1 - 82de565d2


GEODE-188:wrong name for the gateway substitution filter in 'create 
async-event-queue' command
  -replaced string gateway-event-substitution-listener with 
gateway-event-substitution-filter
 and GatewayEventSubstitutionListener with GatewayEventSubstitutionFilter

 Ran:
  QueueCommandsDUnitTest


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

Branch: refs/heads/develop
Commit: 82de565d2b3ad923d422843c13d137eb1999af61
Parents: c575983
Author: kbachhav kbachhav.pivotal.io
Authored: Thu Aug 6 14:12:30 2015 +0530
Committer: kbachhav kbachhav.pivotal.io
Committed: Thu Aug 6 15:16:23 2015 +0530

--
 .../management/internal/cli/commands/QueueCommands.java  | 4 ++--
 .../cli/functions/CreateAsyncEventQueueFunction.java | 8 
 .../gemfire/management/internal/cli/i18n/CliStrings.java | 4 ++--
 .../internal/web/controllers/QueueCommandsController.java| 6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/82de565d/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommands.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommands.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommands.java
index 7b298d6..b59f38a 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommands.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommands.java
@@ -110,8 +110,8 @@ public class QueueCommands implements CommandMarker {
  help = 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__GATEWAYEVENTFILTER__HELP)
   @CliMetaData (valueSeparator = ,) 
   String[] gatewayEventFilters,
-  @CliOption(key = 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__SUBSTITUTION_LISTENER, 
- help = 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__SUBSTITUTION_LISTENER__HELP)
+  @CliOption(key = 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__SUBSTITUTION_FILTER, 
+ help = 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__SUBSTITUTION_FILTER__HELP)
   String gatewaySubstitutionListener,
   @CliOption(key = CliStrings.CREATE_ASYNC_EVENT_QUEUE__LISTENER,
  mandatory = true,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/82de565d/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
index 547b199..4ee9e5d 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
@@ -67,7 +67,7 @@ public class CreateAsyncEventQueueFunction extends 
FunctionAdapter implements In
   final int dispatcherThreads =(Integer) args[9]; 
   final String orderPolicy= (String) args[10];
   final String[] gatewayEventFilters =(String[]) args[11];
-  final String gatewaySubstitutionListener = (String) args[12];
+  final String gatewaySubstitutionFilter = (String) args[12];
   final String listenerClassName = (String) args[13];
   final Properties listenerProperties = (Properties) args[14];
 
@@ -98,9 +98,9 @@ public class CreateAsyncEventQueueFunction extends 
FunctionAdapter implements In
   asyncEventQueueFactory.addGatewayEventFilter((GatewayEventFilter) 
newInstance(gatewayEventFilterKlass, 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__GATEWAYEVENTFILTER));
 }
   }
-  if (gatewaySubstitutionListener != null) {
-Class? gatewayEventSubstitutionListenerKlass = 
forName(gatewaySubstitutionListener, 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__SUBSTITUTION_LISTENER);
-
asyncEventQueueFactory.setGatewayEventSubstitutionListener((GatewayEventSubstitutionFilter?,?)
 newInstance(gatewayEventSubstitutionListenerKlass, 
CliStrings.CREATE_ASYNC_EVENT_QUEUE__SUBSTITUTION_LISTENER));
+  if (gatewaySubstitutionFilter != null) {
+Class? 

incubator-geode git commit: fix race in testEntryTtlDestroyEvent

2015-08-06 Thread dschneider
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-179 [created] b12fdba83


fix race in testEntryTtlDestroyEvent

A race existed that caused no-ack regions to fail because they
did not see the entry expire.
This race was fixed by suspending expiration until the create
is seen on the remote side and then after permitting expiration
using a wait for the expire to happen.


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

Branch: refs/heads/feature/GEODE-179
Commit: b12fdba830f50c0e23ce5123921f69107687cd94
Parents: ea9f03e
Author: Darrel Schneider dschnei...@pivotal.io
Authored: Wed Aug 5 16:46:45 2015 -0700
Committer: Darrel Schneider dschnei...@pivotal.io
Committed: Wed Aug 5 16:46:45 2015 -0700

--
 .../gemfire/cache30/MultiVMRegionTestCase.java  | 94 +---
 1 file changed, 63 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b12fdba8/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
index 5e605dd..ecec932 100644
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
@@ -45,6 +45,7 @@ import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.AttributesMutator;
 import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheEvent;
 import com.gemstone.gemfire.cache.CacheException;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.CacheListener;
@@ -84,6 +85,7 @@ import com.gemstone.gemfire.internal.InternalDataSerializer;
 import com.gemstone.gemfire.internal.InternalInstantiator;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.cache.EntryExpiryTask;
+import com.gemstone.gemfire.internal.cache.ExpiryTask;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
@@ -3822,7 +3824,7 @@ public abstract class MultiVMRegionTestCase extends 
RegionTestCase {
 return;
   
   final String name = this.getUniqueName();
-  final int timeout = 40; // ms
+  final int timeout = 22; // ms
   final Object key = KEY;
   final Object value = VALUE;
 
@@ -3857,81 +3859,111 @@ public abstract class MultiVMRegionTestCase extends 
RegionTestCase {
   }
 
 
-  SerializableRunnable create = new CacheSerializableRunnable(Populate) {
+  SerializableRunnable createRegion = new 
CacheSerializableRunnable(Create with Listener) {
 public void run2() throws CacheException {
   AttributesFactory fac = new AttributesFactory(getRegionAttributes());
   fac.addCacheListener(destroyListener = new DestroyListener());
-  Region region = null;
-  System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, true);
-  try {
-region = createRegion(name, fac.create());
-  } 
-  finally {
-System.getProperties().remove(LocalRegion.EXPIRY_MS_PROPERTY);
-  }
+  createRegion(name, fac.create());
 }
   };
 
-  vm1.invoke(create);
+  vm1.invoke(createRegion);
 
   vm0.invoke(new CacheSerializableRunnable(Create with TTL) {
   public void run2() throws CacheException {
 AttributesFactory factory = new 
AttributesFactory(getRegionAttributes());
-final boolean partitioned = 
getRegionAttributes().getPartitionAttributes() != null ||
-getRegionAttributes().getDataPolicy().withPartitioning();
 factory.setStatisticsEnabled(true);
 ExpirationAttributes expire =
   new ExpirationAttributes(timeout,
ExpirationAction.DESTROY);
 factory.setEntryTimeToLive(expire);
-if (!getRegionAttributes().getDataPolicy().withReplication() ! 
partitioned) {
+if (!getRegionAttributes().getDataPolicy().withReplication()) {
   factory.setDataPolicy(DataPolicy.NORMAL);
   factory.setSubscriptionAttributes(new 
SubscriptionAttributes(InterestPolicy.ALL));
 }
 

[15/19] incubator-geode git commit: Fix GEODE-154: HDFS region with HeapLRU reports LowMemoryExceptions even when region size is less then the eviction threshold

2015-08-06 Thread qihong
Fix GEODE-154: HDFS region with HeapLRU reports LowMemoryExceptions
even when region size is less then the eviction threshold

- calling setUsageThreshold() on MemoryPoolMXBean resulted in
it reporting incorrect memory usage causing temporary spikes.
Since we already set CollectionThreshold at 1 byte and also have a
stat and heap poller thread, we now skip setting the usage threshold.


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

Branch: refs/heads/feature/GEODE-137
Commit: 88ed3ed59b96f8ce84327ed2bad132d4dc6e3a51
Parents: 389e2a8
Author: Namrata Thanvi ntha...@pivotal.io
Authored: Thu Aug 6 14:22:53 2015 +0530
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:48 2015 -0700

--
 .../internal/cache/control/HeapMemoryMonitor.java  | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/88ed3ed5/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
index 8346245..fda337b 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
@@ -554,18 +554,7 @@ public void stopMonitoring() {
*  Number of bytes of heap memory currently used.
*/
   private void setUsageThresholdOnMXBean(final long bytesUsed) {
-if (testDisableMemoryUpdates) {
-  return;
-}
-
-final MemoryPoolMXBean memoryPoolMXBean = getTenuredMemoryPoolMXBean();
-final MemoryThresholds saveThresholds = this.thresholds;
-
-if (bytesUsed  saveThresholds.getEvictionThresholdBytes()) {
-  
memoryPoolMXBean.setUsageThreshold(saveThresholds.getEvictionThresholdBytes());
-} else {
-  
memoryPoolMXBean.setUsageThreshold(saveThresholds.getCriticalThresholdBytes());
-}
+  this method has been made a no-op to fix bug 49064 
   }
   
   /**



[11/19] incubator-geode git commit: GEODE-172: Fixing an intermittent failure as reported by closing cache after each individual test.

2015-08-06 Thread qihong
GEODE-172: Fixing an intermittent failure as reported by closing cache after 
each individual test.

Also temporarily taking care of an assertion failure that is reflected in 
GEODE-110 and GEODE-141 that are still under investigation.


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

Branch: refs/heads/feature/GEODE-137
Commit: 0a555b9e7e1e36fb3e9f651f3691ff50efee45d6
Parents: 3cef2d7
Author: Vivek Bhaskar vbhas...@pivotal.io
Authored: Thu Jul 30 17:14:57 2015 +0530
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:47 2015 -0700

--
 .../gemfire/internal/cache/TXRegionState.java| 17 -
 .../gemfire/disttx/DistTXDebugDUnitTest.java |  3 +++
 .../disttx/DistributedTransactionDUnitTest.java  | 19 +++
 3 files changed, 22 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0a555b9e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
index bb6ae5f..67cb8c5 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionState.java
@@ -596,11 +596,18 @@ public class TXRegionState {
 String regionFullPath = this.getRegion().getFullPath();
 int entryModsSize = this.entryMods.size();
 int entryEventListSize = entryEventList.size();
-if (entryModsSize != entryEventListSize) {
-  throw new UnsupportedOperationInTransactionException(
-  LocalizedStrings.DISTTX_TX_EXPECTED.toLocalizedString(
-  entry size of  + entryModsSize +  for region 
-  + regionFullPath, entryEventListSize));
+/*
+ * [DISTTX] TODO
+ * This assertion is not working for PutAll and RemoveAll operations 
+ * and thus guarding within Debug flags. May be enabled at later stage.
+ */
+if (logger.isDebugEnabled()) {
+  if (entryModsSize != entryEventListSize) {
+throw new UnsupportedOperationInTransactionException(
+LocalizedStrings.DISTTX_TX_EXPECTED
+.toLocalizedString(entry size of  + entryModsSize
++  for region  + regionFullPath, entryEventListSize));
+  }
 }
 
 int index = 0;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0a555b9e/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
index ff0a506..668f1e6 100644
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
@@ -62,6 +62,9 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
   }
 });
 InternalResourceManager.setResourceObserver(null);
+if (cache != null) {
+  cache.close();
+}
   }
 
   public static void createCacheInVm() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0a555b9e/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
index 2522e63..79d6f64 100644
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
@@ -72,13 +72,13 @@ public class DistributedTransactionDUnitTest extends 
CacheTestCase {
   }
 });
 
-this.invokeInEveryVM(new SerializableCallable() {
-  @Override
-  public Object call() throws Exception {
-System.setProperty(gemfire.log-level, fine);
-return null;
-  }
-}); 
+//this.invokeInEveryVM(new SerializableCallable() {
+//  @Override
+//  public Object call() throws Exception {
+//System.setProperty(gemfire.log-level, fine);
+//return null;
+//  }
+//});
 
 

[03/19] incubator-geode git commit: [GEODE-176] fixes the issue

2015-08-06 Thread qihong
[GEODE-176] fixes the issue


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

Branch: refs/heads/feature/GEODE-137
Commit: 863c4ca3471b96344e26dda80e4d39c4f6a8da52
Parents: cd06fb9
Author: eshu e...@pivotal.io
Authored: Thu Jul 30 11:42:28 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:47 2015 -0700

--
 .../gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/863c4ca3/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
index edb24d1..29319e0 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
@@ -348,7 +348,7 @@ public final class SimpleMemoryAllocatorImpl implements 
MemoryAllocator, MemoryI
   SetBucketRegion brs = prs.getAllLocalBucketRegions();
   if (brs != null) {
 for (BucketRegion br : brs) {
-  if (br != null) {
+  if (br != null  !br.isDestroyed()) {
 this.basicGetRegionLiveChunks(br, result);
   }
 



[06/19] incubator-geode git commit: GEODE-162: remove race condititions and long sleeps from region expiration test methods in RegionTestCase

2015-08-06 Thread qihong
GEODE-162: remove race condititions and long sleeps from region expiration test 
methods in RegionTestCase


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

Branch: refs/heads/feature/GEODE-137
Commit: cd06fb9985c2afc29a53de83bcf9f117fae945ba
Parents: b081a9e
Author: Darrel Schneider dschnei...@pivotal.io
Authored: Thu Jul 30 16:40:14 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:47 2015 -0700

--
 .../gemfire/internal/cache/LocalRegion.java |   7 +
 .../gemfire/cache30/RegionTestCase.java | 132 ---
 2 files changed, 60 insertions(+), 79 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cd06fb99/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
index 9ea26a7..495e992 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
@@ -8815,6 +8815,13 @@ public class LocalRegion extends AbstractRegion
 }
 return this.entryExpiryTasks.get(re);
   }
+  /**
+   * Used by unit tests to get access to the RegionIdleExpiryTask
+   * of this region. Returns null if no task exists.
+   */
+  public RegionIdleExpiryTask getRegionIdleExpiryTask() {
+return this.regionIdleExpiryTask;
+  }
   
   private void addExpiryTask(RegionEntry re, boolean ifAbsent)
   {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cd06fb99/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java 
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
index a20cfc5..69eeec0 100644
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
@@ -2085,7 +2085,7 @@ public abstract class RegionTestCase extends 
CacheTestCase {
   if (now = tilt)
 break;
   if (!region.isDestroyed()) {
-pause(100);
+pause(10);
 continue;
   }
   if (now = tilt - SLOP) {
@@ -2107,7 +2107,7 @@ public abstract class RegionTestCase extends 
CacheTestCase {
 break;
   Assert.assertTrue(System.currentTimeMillis() = tilt,
   Region failed to destroy);
-  pause(100);
+  pause(10);
 }
   }  
 
@@ -2704,7 +2704,7 @@ public abstract class RegionTestCase extends 
CacheTestCase {
 
 vm0.invoke(new CacheSerializableRunnable(testRegionTtlInvalidate) {
   public void run2() throws CacheException {
-final int timeout = 50; // ms
+final int timeout = 22; // ms
 final Object key = KEY;
 final Object value = VALUE;
 
@@ -2736,8 +2736,8 @@ public abstract class RegionTestCase extends 
CacheTestCase {
 finally {
   ExpiryTask.permitExpiration();
 }
-waitForInvalidate(entry, tilt);
-waitForInvalidate(region.getEntry(k2), tilt);
+waitForInvalidate(entry, tilt, 10);
+waitForInvalidate(region.getEntry(k2), tilt, 10);
   }
 });
   }
@@ -2753,7 +2753,7 @@ public abstract class RegionTestCase extends 
CacheTestCase {
   return;
 
 final String name = this.getUniqueName();
-final int timeout = 700; // ms
+final int timeout = 22; // ms
 final Object key = KEY;
 final Object value = VALUE;
 
@@ -3741,42 +3741,38 @@ public abstract class RegionTestCase extends 
CacheTestCase {
   throws CacheException, InterruptedException {
 
 final String name = this.getUniqueName();
-final int timeout = 20; // ms
-final int hugeTimeout = Integer.MAX_VALUE;
-final ExpirationAttributes expire =
-new ExpirationAttributes(timeout, ExpirationAction.INVALIDATE);
-final ExpirationAttributes hugeExpire =
-new ExpirationAttributes(hugeTimeout, ExpirationAction.INVALIDATE);
+;
 final Object key = KEY;
 final Object value = VALUE;
 
 AttributesFactory factory = new AttributesFactory(getRegionAttributes());
 factory.setStatisticsEnabled(true);
 RegionAttributes attrs = factory.create();
-Region region = null;
-long tilt;
+

[13/19] incubator-geode git commit: GEODE-155: - Fixes intermittent failure in RegionWithHDFS*DUnitTest about incorrect number of hoplog files getting created. - Caused due to an earlier test not clea

2015-08-06 Thread qihong
GEODE-155:
- Fixes intermittent failure in RegionWithHDFS*DUnitTest about incorrect number 
of hoplog files getting created.
- Caused due to an earlier test not cleaning up static variables in 
ParallelGatewaySenderQueue.
- These are indeed cleaned up during GemFireCacheImpl.close() if there are any 
GatewaySenders running in the system.
- But if a region with gateway-senders associated with it, is destroyed first 
before a cache.close(), then the gateway senders are only stopped,
and removed from allGatewaySenders list. But the static variables are not 
cleaned up.
- Later, during GemFireCacheImpl.close(), as the allGatewaySenders list is 
empty, it skips cleaning the static variables.
- As a fix, invoking a static clean-up method of ParallelGatewaySenderQueue 
explicitly during cache.close().
- Retained the non-static ParallelGatewaySenderQueue.cleanUp(), if required in 
future development for performing instance-specific clean-up.
- Minor formatting changes in the unit tests.


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

Branch: refs/heads/feature/GEODE-137
Commit: cb735a2045f124ee7c5c6ba84dbcafe4383008d7
Parents: 71f00b5
Author: ashetkar ashet...@pivotal.io
Authored: Tue Aug 4 14:06:51 2015 +0530
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:48 2015 -0700

--
 .../internal/cache/GemFireCacheImpl.java|  1 +
 .../parallel/ParallelGatewaySenderQueue.java| 41 +---
 .../internal/RegionWithHDFSBasicDUnitTest.java  | 22 +--
 .../RegionWithHDFSOffHeapBasicDUnitTest.java| 10 +++--
 .../hdfs/internal/RegionWithHDFSTestBase.java   |  6 +--
 5 files changed, 49 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cb735a20/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java
index 5487000..f5be144 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java
@@ -2018,6 +2018,7 @@ public class GemFireCacheImpl implements InternalCache, 
ClientCache, HasCachePer
   advisor.close();
 }
   }
+  ParallelGatewaySenderQueue.cleanUpStatics(null);
 } catch (CancelException ce) {
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cb735a20/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index f4f9528..9141905 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -633,15 +633,20 @@ public class ParallelGatewaySenderQueue implements 
RegionQueue {
* Wait a while for existing tasks to terminate. If the existing tasks still 
don't 
* complete, cancel them by calling shutdownNow. 
*/
-  private void cleanupConflationThreadPool() {
+  private static void cleanupConflationThreadPool(AbstractGatewaySender 
sender) {
 conflationExecutor.shutdown();// Disable new tasks from being submitted
 
 try {
 if (!conflationExecutor.awaitTermination(1, TimeUnit.SECONDS)) {
   conflationExecutor.shutdownNow(); // Cancel currently executing tasks
   // Wait a while for tasks to respond to being cancelled
-  if (!conflationExecutor.awaitTermination(1, TimeUnit.SECONDS))
-
logger.warn(LocalizedMessage.create(LocalizedStrings.ParallelGatewaySenderQueue_COULD_NOT_TERMINATE_CONFLATION_THREADPOOL,
 this.sender));
+if (!conflationExecutor.awaitTermination(1, TimeUnit.SECONDS)) {
+  logger
+  .warn(LocalizedMessage
+  .create(
+  
LocalizedStrings.ParallelGatewaySenderQueue_COULD_NOT_TERMINATE_CONFLATION_THREADPOOL,
+  (sender == null ? all : sender)));
+}
 }
 } catch (InterruptedException e) {

[1/2] incubator-geode git commit: GEODE-137: use local GemFire server to initialize ClientCache whenever possible.

2015-08-06 Thread qihong
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 7d4ae09fc - d0d48588c


GEODE-137: use local GemFire server to initialize ClientCache whenever possible.


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

Branch: refs/heads/develop
Commit: d0d48588c895cff7418090c50b57f9f4a740763c
Parents: 2e2a795
Author: Qihong Chen qc...@pivotal.io
Authored: Thu Aug 6 09:51:53 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:44:36 2015 -0700

--
 .../pivotal/gemfire/spark/connector/internal/LocatorHelper.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d0d48588/gemfire-spark-connector/gemfire-spark-connector/src/main/scala/io/pivotal/gemfire/spark/connector/internal/LocatorHelper.scala
--
diff --git 
a/gemfire-spark-connector/gemfire-spark-connector/src/main/scala/io/pivotal/gemfire/spark/connector/internal/LocatorHelper.scala
 
b/gemfire-spark-connector/gemfire-spark-connector/src/main/scala/io/pivotal/gemfire/spark/connector/internal/LocatorHelper.scala
index a010c62..3a094cc 100644
--- 
a/gemfire-spark-connector/gemfire-spark-connector/src/main/scala/io/pivotal/gemfire/spark/connector/internal/LocatorHelper.scala
+++ 
b/gemfire-spark-connector/gemfire-spark-connector/src/main/scala/io/pivotal/gemfire/spark/connector/internal/LocatorHelper.scala
@@ -65,8 +65,8 @@ object LocatorHelper extends Logging {
* Pick up at most 3 preferred servers from all available servers based on
* host name and Spark executor id.
*
-   * This method is used by DefaultGemFireConnection to create LocalCache. 
Usually 
-   * one server is enough to initialize LocalCacheFactory, but this provides 
two 
+   * This method is used by DefaultGemFireConnection to create ClientCache. 
Usually
+   * one server is enough to initialize ClientCacheFactory, but this provides 
two
* backup servers in case of the 1st server can't be connected.
*   
* @param servers all available servers in the form of (hostname, port) pairs



Git Push Summary

2015-08-06 Thread qihong
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-137 [deleted] e596a4eec


incubator-geode git commit: GEODE-185: Fix races in testRegionIdleInvalidate

2015-08-06 Thread dschneider
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 82de565d2 - 7d4ae09fc


GEODE-185: Fix races in testRegionIdleInvalidate

The test code is now careful to wait for the expiration clock to advance.
A different assertion will be triggered if the expiration clock goes back in 
time.
Fixed two places in the product expiration code that did not use the expiration 
clock.


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

Branch: refs/heads/develop
Commit: 7d4ae09fc92288788868739451254320617289ca
Parents: 82de565
Author: Darrel Schneider dschnei...@pivotal.io
Authored: Wed Aug 5 14:17:19 2015 -0700
Committer: Darrel Schneider dschnei...@pivotal.io
Committed: Thu Aug 6 09:46:12 2015 -0700

--
 .../gemfire/internal/cache/ExpiryTask.java   |  2 +-
 .../internal/cache/RegionIdleExpiryTask.java |  3 ++-
 .../gemstone/gemfire/cache30/RegionTestCase.java | 15 ++-
 .../src/test/java/dunit/DistributedTestCase.java | 19 +++
 4 files changed, 28 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7d4ae09f/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
index 95cd3a8..d5dc5ee 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
@@ -437,7 +437,7 @@ public abstract class ExpiryTask extends 
SystemTimer.SystemTimerTask {
 return super.toString() +  for  + getLocalRegion()
   + , ttl expiration time:  + expTtl
   + , idle expiration time:  + expIdle +
-  ([now: + System.currentTimeMillis() + ]);
+  ([now: + calculateNow() + ]);
   }
 
   // Abstract methods ///

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7d4ae09f/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionIdleExpiryTask.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionIdleExpiryTask.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionIdleExpiryTask.java
index fbcb12c..52975a2 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionIdleExpiryTask.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionIdleExpiryTask.java
@@ -39,7 +39,8 @@ class RegionIdleExpiryTask extends RegionExpiryTask {
 if (!getLocalRegion().EXPIRY_UNITS_MS) {
   timeout *= 1000;
 }
-return  timeout + System.currentTimeMillis();
+// Expiration should always use the DSClock instead of the System 
clock.
+return  timeout + getLocalRegion().cacheTimeMillis();
   }
 }
 // otherwise, expire at timeout plus last accessed time

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7d4ae09f/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java 
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
index 69eeec0..c063a55 100644
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
@@ -3853,29 +3853,34 @@ public abstract class RegionTestCase extends 
CacheTestCase {
 // expiration time to be extended.
 // For this phase we don't worry about actually expiring but just
 // making sure the expiration time gets extended.
-region.getAttributesMutator().setRegionIdleTimeout(new 
ExpirationAttributes(9000/*ms*/, ExpirationAction.INVALIDATE));
+final int EXPIRATION_MS = 9000;
+region.getAttributesMutator().setRegionIdleTimeout(new 
ExpirationAttributes(EXPIRATION_MS, ExpirationAction.INVALIDATE));
 
 LocalRegion lr = (LocalRegion) region;
 {
   ExpiryTask expiryTask = lr.getRegionIdleExpiryTask();
   region.put(key, value);
   long createExpiry = expiryTask.getExpirationTime();
-  waitForExpiryClockToChange(lr);
+  long changeTime = waitForExpiryClockToChange(lr, 
createExpiry-EXPIRATION_MS);
   

[02/19] incubator-geode git commit: GEODE-168: remove Bug34011JUnitTest

2015-08-06 Thread qihong
GEODE-168: remove Bug34011JUnitTest


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

Branch: refs/heads/feature/GEODE-137
Commit: daeb077f099545346f2ac8080689b2fe23db4aec
Parents: 6f6075f
Author: Darrel Schneider dschnei...@pivotal.io
Authored: Wed Jul 29 14:47:42 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:46 2015 -0700

--
 .../internal/cache/Bug34011JUnitTest.java   | 199 ---
 1 file changed, 199 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/daeb077f/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34011JUnitTest.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34011JUnitTest.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34011JUnitTest.java
deleted file mode 100644
index b673a56..000
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34011JUnitTest.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*=
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=
- */
-package com.gemstone.gemfire.internal.cache;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.Arrays;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-
-/**
- * To verify the bug no. 34011 no longer exists:
- * Disk region perf test for Persist only with Async writes. 
- * 
- * The test verifies that puts per second perfomance if bytes threshold being 
exceeded before time interval is not more than a factor
- * of 2 (the reverse is also tested, time interval causing flush's perfomance 
should not be better than byte-threshold exceeding by
- * a factor of 2)
- * 
- * Note : This test can fail due to external factors such as filesystem 
becoming slow or CPU being overloaded
- * during one run and fast during the second run.
- *  
- * @author Vikram Jadhav 
- */
-@Category(IntegrationTest.class)
-public class Bug34011JUnitTest extends DiskRegionTestingBase
-{
-  String stats1 = null;
-  String stats2 = null;
-  DiskRegionProperties diskProps1 = new DiskRegionProperties();
-  DiskRegionProperties diskProps2 = new DiskRegionProperties();
-  Region region1= null;
-  Region region2= null;
-  public float opPerSec1= 0l;
-  public float opPerSec2= 0l;
-  
-  @Before
-  public void setUp() throws Exception
-  {
-super.setUp();
-diskProps1.setDiskDirs(dirs);
-diskProps2.setDiskDirs(dirs);
-DiskStoreImpl.SET_IGNORE_PREALLOCATE = true;
-  }
-
-  @After
-  public void tearDown() throws Exception
-  {
-super.tearDown();
-DiskStoreImpl.SET_IGNORE_PREALLOCATE = false;
-  }
- 
-  private static int ENTRY_SIZE = 2;
-
-  private static int OP_COUNT = 10; // 10;
-
-  
-  /**
-   * First, the time interval is set to a low value such that time-interval 
always elapses before bytes threshold is reached.
-   * Then the bytes-threshold is set in such a way that byte threshold occurs 
before time-interval. The perfomance
-   * of the first one should not be more than a factor of two as compared to 
the perfomance of the second scenario. The
-   * reverse also hold true
-   *
-   */
- 
-  @Test
-  public void testpersistASync()
-  {
-
-// test-persistASync-ByteThreshold
-try {
- 
-  diskProps1.setTimeInterval(10);
-  diskProps1.setBytesThreshold(Integer.MAX_VALUE); // now a queue size
-  diskProps1.setRegionName(region1);
-  region1 = DiskRegionHelperFactory.getAsyncPersistOnlyRegion(cache, 
diskProps1);
-  
-}
-catch (Exception e) {
-  if(logWriter.fineEnabled()){
-e.printStackTrace();
-  }
-  fail(failed : test-persistASync-ByteThreshold.Exception=+e);
-}
-//Perf test for 1kb writes
-populateData1();
-if(logWriter.infoEnabled()){
-logWriter.info(testpersistASyncByteThreshold:: Stats for 1 kb writes :
-+ stats1);
-}
-   //  close region1
-region1.close();
- 
-  
-try {  

[01/19] incubator-geode git commit: GEODE-169: testEventsExpiryBug should expect Unexpected IOException.

2015-08-06 Thread qihong
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-137 6f6075f27 - e596a4eec


GEODE-169: testEventsExpiryBug should expect Unexpected IOException.


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

Branch: refs/heads/feature/GEODE-137
Commit: 3cef2d7103851b4f840a533c808ca80692e35f7a
Parents: daeb077
Author: Darrel Schneider dschnei...@pivotal.io
Authored: Wed Jul 29 15:31:08 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:46 2015 -0700

--
 .../gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java| 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3cef2d71/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
index 00336e9..b22ac27 100755
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
@@ -234,6 +234,7 @@ public class Bug36853EventsExpiryDUnitTest extends 
CacheTestCase
*/
   public void testEventsExpiryBug() throws Exception
   {
+addExpectedException(Unexpected IOException);
 addExpectedException(Connection reset);
 server.invoke(Bug36853EventsExpiryDUnitTest.class, generateEvents);
 client.invoke(Bug36853EventsExpiryDUnitTest.class,



[18/19] incubator-geode git commit: Fix GEODE-186 by removing sleeps in tests

2015-08-06 Thread qihong
Fix GEODE-186 by removing sleeps in tests

The old test scheduled tx suspension to timeout after 1 minute.
So the test always run for at least 1 minute.
A test hook now exists that allows the test to specify
a different time unit (default is still minutes) for
tx suspension expiration.

The sleeps in a bunch of other tests were not needed
since the tx operation is synchronous. So those sleeps
have simply been removed.

A couple of sleeps in clients waiting for something to
arrive that was done on a server have been converted to
a wait since server to client distribution is async.

Reviewed by Swapnil.


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

Branch: refs/heads/feature/GEODE-137
Commit: 389e2a8cac1f2b35aa3ebfd10e8c49ae993b0dc4
Parents: e4c77c6
Author: Darrel Schneider dschnei...@pivotal.io
Authored: Tue Aug 4 11:43:39 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:48 2015 -0700

--
 .../gemfire/internal/cache/TXManagerImpl.java   | 11 +--
 .../cache/ClientServerTransactionDUnitTest.java | 32 ++--
 .../cache/RemoteTransactionDUnitTest.java   | 30 --
 3 files changed, 45 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/389e2a8c/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
index 88714b0..dde3793 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
@@ -1117,6 +1117,10 @@ public final class TXManagerImpl implements 
CacheTransactionManager,
   private ConcurrentMapTransactionId, TXStateProxy suspendedTXs = new 
ConcurrentHashMapTransactionId, TXStateProxy();
   
   public TransactionId suspend() {
+return suspend(TimeUnit.MINUTES);
+  }
+  
+  TransactionId suspend(TimeUnit expiryTimeUnit) {
 TXStateProxy result = getTXState();
 if (result != null) {
   TransactionId txId = result.getTransactionId();
@@ -1137,7 +1141,7 @@ public final class TXManagerImpl implements 
CacheTransactionManager,
   LockSupport.unpark(waitingThread);
 }
   }
-  scheduleExpiry(txId);
+  scheduleExpiry(txId, expiryTimeUnit);
   return txId;
 }
 return null;
@@ -1266,8 +1270,9 @@ public final class TXManagerImpl implements 
CacheTransactionManager,
   /**
* schedules the transaction to expire after {@link #suspendedTXTimeout}
* @param txId
+   * @param expiryTimeUnit the time unit to use when scheduling the expiration
*/
-  private void scheduleExpiry(TransactionId txId) {
+  private void scheduleExpiry(TransactionId txId, TimeUnit expiryTimeUnit) {
 final GemFireCacheImpl cache = (GemFireCacheImpl) this.cache;
 if (suspendedTXTimeout  0) {
   if (logger.isDebugEnabled()) {
@@ -1279,7 +1284,7 @@ public final class TXManagerImpl implements 
CacheTransactionManager,
 if (logger.isDebugEnabled()) {
   logger.debug(TX: scheduling transaction: {} to expire after:{}, txId, 
suspendedTXTimeout);
 }
-cache.getCCPTimer().schedule(task, suspendedTXTimeout*60*1000);
+cache.getCCPTimer().schedule(task, 
TimeUnit.MILLISECONDS.convert(suspendedTXTimeout, expiryTimeUnit));
 this.expiryTasks.put(txId, task);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/389e2a8c/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
index 3ce8cec..d80f6bb 100644
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
@@ -16,6 +16,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import javax.naming.Context;
 import javax.transaction.UserTransaction;
@@ -78,6 +79,7 @@ import 

[09/19] incubator-geode git commit: GEODE-181: Add new unit and integration tests for FastLogger

2015-08-06 Thread qihong
GEODE-181: Add new unit and integration tests for FastLogger

Add new TestSuites for logging tests. Extract default config testing to
FastLoggerWithDefaultConfigJUnitTest. Move FastLoggerJUnitTest integration
tests to FastLoggerIntegrationJUnitTest. Create new unit tests in
FastLoggerJUnitTest. Update tests to full JUnit 4 syntax and use Rules
(GEODE-89).

Add mockito dependency to build for unit testing.

Completes: GEODE-89, GEODE-181, GEODE-10


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

Branch: refs/heads/feature/GEODE-137
Commit: 946f6b61ce66fec7b8f960cf91add816f17e551f
Parents: a9da142
Author: Kirk Lund kl...@pivotal.io
Authored: Tue Aug 4 11:39:44 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:47 2015 -0700

--
 build.gradle|   1 +
 .../gemfire/internal/logging/LogService.java|  53 +-
 .../internal/logging/log4j/Configurator.java|  65 ++-
 .../internal/logging/log4j/FastLogger.java  |  48 +-
 .../DistributedSystemLogFileJUnitTest.java  |  20 +-
 .../logging/LoggingIntegrationTestSuite.java|  14 +
 .../internal/logging/LoggingUnitTestSuite.java  |  12 +
 .../log4j/FastLoggerIntegrationJUnitTest.java   | 557 +++
 .../logging/log4j/FastLoggerJUnitTest.java  | 274 -
 .../FastLoggerWithDefaultConfigJUnitTest.java   |  74 +++
 .../log4j/Log4jIntegrationTestSuite.java|  12 +
 .../logging/log4j/Log4jUnitTestSuite.java   |  16 +
 12 files changed, 914 insertions(+), 232 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/946f6b61/build.gradle
--
diff --git a/build.gradle b/build.gradle
index c82e82a..42b4a14 100755
--- a/build.gradle
+++ b/build.gradle
@@ -278,6 +278,7 @@ subprojects {
 testCompile 'com.github.stefanbirkner:system-rules:1.9.0'
 testCompile 'edu.umd.cs.mtc:multithreadedtc:1.01'
 testCompile 'junit:junit:4.12'
+testCompile 'org.mockito:mockito-core:1.10.19'
 testCompile 'org.hamcrest:hamcrest-all:1.3'
 testCompile 'org.jmock:jmock:2.8.1'
 testCompile 'org.jmock:jmock-junit4:2.8.1'

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/946f6b61/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogService.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogService.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogService.java
index 6298cf6..a4a399d 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogService.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogService.java
@@ -12,6 +12,7 @@ import java.beans.PropertyChangeListener;
 import java.io.File;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -21,9 +22,11 @@ import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter.Result;
 import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.AppenderRef;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
 import org.apache.logging.log4j.core.config.LoggerConfig;
+import org.apache.logging.log4j.core.filter.AbstractFilterable;
 import org.apache.logging.log4j.core.lookup.Interpolator;
 import org.apache.logging.log4j.core.lookup.StrSubstitutor;
 import org.apache.logging.log4j.status.StatusLogger;
@@ -78,10 +81,9 @@ public class LogService extends LogManager {
   private static void init() {
 setLog4jConfigFileProperty();
 LoggerContext context = ((org.apache.logging.log4j.core.Logger) 
LogManager.getLogger(BASE_LOGGER_NAME, 
GemFireParameterizedMessageFactory.INSTANCE)).getContext();
-context.reconfigure();
 context.removePropertyChangeListener(propertyChangeListener);
 context.addPropertyChangeListener(propertyChangeListener);
-setFastLoggerDebugAvailableFlag();
+context.reconfigure(); // propertyChangeListener invokes 
configureFastLoggerDelegating
 configureLoggers(false, false);
   }
   
@@ -117,15 +119,17 @@ public class LogService extends LogManager {
   /**
* Check to see if the user has specified a Log4j configuration file.  If 
not, attempt
* to find a GemFire Log4j configuration file in various locations.
+   * 
+ 

[10/19] incubator-geode git commit: GEODE-175: change test to use a wait criteria instead of pause and use millis instead of seconds

2015-08-06 Thread qihong
GEODE-175: change test to use a wait criteria instead of pause and use millis 
instead of seconds


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

Branch: refs/heads/feature/GEODE-137
Commit: a9da1422d11d8944a210bae1294c9facd2265a80
Parents: 32186b9
Author: Darrel Schneider dschnei...@pivotal.io
Authored: Tue Aug 4 10:42:50 2015 -0700
Committer: Qihong Chen qc...@pivotal.io
Committed: Thu Aug 6 10:07:47 2015 -0700

--
 .../cache/RemoteTransactionDUnitTest.java   | 42 +---
 1 file changed, 27 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a9da1422/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
index 7c6d133..0daaafb 100644
--- 
a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
@@ -4006,10 +4006,15 @@ protected static class ClientListener extends 
CacheListenerAdapter {
 vm1.invoke(new SerializableCallable() {
   @Override
   public Object call() throws Exception {
+System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, true);
+try {
 RegionFactoryString, String rf = getCache().createRegionFactory();
 rf.setEntryTimeToLive(new ExpirationAttributes(1, 
ExpirationAction.LOCAL_DESTROY));
 rf.setScope(Scope.DISTRIBUTED_ACK);
 rf.create(regionName);
+} finally {
+  System.getProperties().remove(LocalRegion.EXPIRY_MS_PROPERTY);
+}
 return null;
   }
 });
@@ -4027,20 +4032,6 @@ protected static class ClientListener extends 
CacheListenerAdapter {
   @Override
   public Object call() throws Exception {
 final RegionString, String r = getCache().getRegion(regionName);
-r.put(key, value);
-r.put(nonTXkey, nonTXvalue);
-getCache().getCacheTransactionManager().begin();
-r.put(key, newvalue);
-// wait for entry to expire
-DistributedTestCase.pause(5000);
-TransactionId tx = getCache().getCacheTransactionManager().suspend();
-// A remote tx will allow expiration to happen on the side that
-// is not hosting the tx. But it will not allow an expiration
-// initiated on the hosting jvm.
-assertFalse(r.containsKey(key));
-assertFalse(r.containsKey(nonTXkey));
-getCache().getCacheTransactionManager().resume(tx);
-getCache().getCacheTransactionManager().commit();
 WaitCriterion wc2 = new WaitCriterion() {
   @Override
   public boolean done() {
@@ -4049,9 +4040,30 @@ protected static class ClientListener extends 
CacheListenerAdapter {
   
   @Override
   public String description() {
-return did not expire;
+return did not expire containsKey(key)= + r.containsKey(key) + 
 r.containsKey(nonTXKey)= + r.containsKey(nonTXKey);
   }
 };
+ExpiryTask.suspendExpiration();
+Region.Entry entry = null;
+long tilt;
+try {
+  r.put(key, value);
+  r.put(nonTXkey, nonTXvalue);
+  getCache().getCacheTransactionManager().begin();
+  r.put(key, newvalue);
+} 
+finally {
+  ExpiryTask.permitExpiration();
+}
+TransactionId tx = getCache().getCacheTransactionManager().suspend();
+// A remote tx will allow expiration to happen on the side that
+// is not hosting the tx. But it will not allow an expiration
+// initiated on the hosting jvm.
+// tx is hosted in vm2 so expiration can happen in vm1.
+DistributedTestCase.waitForCriterion(wc2, 3, 5, true);
+getCache().getCacheTransactionManager().resume(tx);
+assertTrue(r.containsKey(key));
+getCache().getCacheTransactionManager().commit();
 DistributedTestCase.waitForCriterion(wc2, 3, 5, true);
 return null;
   }



Git Push Summary

2015-08-06 Thread dschneider
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-185 [deleted] e300012b6


[2/4] incubator-geode git commit: Fix for GEODE-109

2015-08-06 Thread sbawaskar
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a6a0ef5/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZRemRangeByScoreExecutor.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZRemRangeByScoreExecutor.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZRemRangeByScoreExecutor.java
index ca6cd82..19356b7 100755
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZRemRangeByScoreExecutor.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZRemRangeByScoreExecutor.java
@@ -74,7 +74,7 @@ public class ZRemRangeByScoreExecutor extends 
SortedSetExecutor {
 try {
   if (start == Double.NEGATIVE_INFINITY  stop == 
Double.POSITIVE_INFINITY  startInclusive  stopInclusive) {
 numRemoved = keyRegion.size();
-context.getRegionCache().removeKey(key);
+context.getRegionProvider().removeKey(key);
   } else {
 removeList = getKeys(context, key, keyRegion, start, stop, 
startInclusive, stopInclusive);
   }
@@ -93,7 +93,7 @@ public class ZRemRangeByScoreExecutor extends 
SortedSetExecutor {
 if (oldVal != null)
   numRemoved++;
 if (keyRegion.isEmpty())
-  context.getRegionCache().removeKey(key);
+  context.getRegionProvider().removeKey(key);
   }
 }
 
command.setResponse(Coder.getIntegerResponse(context.getByteBufAllocator(), 
numRemoved));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a6a0ef5/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZScanExecutor.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZScanExecutor.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZScanExecutor.java
index 097e9be..faa8ffd 100755
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZScanExecutor.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/sortedset/ZScanExecutor.java
@@ -2,6 +2,7 @@ package com.gemstone.gemfire.internal.redis.executor.sortedset;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.regex.Pattern;
@@ -31,7 +32,7 @@ public class ZScanExecutor extends AbstractScanExecutor {
 }
 
 ByteArrayWrapper key = command.getKey();
-RegionByteArrayWrapper, DoubleWrapper keyRegion = 
(RegionByteArrayWrapper, DoubleWrapper) 
context.getRegionCache().getRegion(key);
+RegionByteArrayWrapper, DoubleWrapper keyRegion = 
(RegionByteArrayWrapper, DoubleWrapper) 
context.getRegionProvider().getRegion(key);
 checkDataType(key, RedisDataType.REDIS_SORTEDSET, context);
 if (keyRegion == null) {
   command.setResponse(Coder.getScanResponse(context.getByteBufAllocator(), 
new ArrayListString()));
@@ -96,7 +97,7 @@ public class ZScanExecutor extends AbstractScanExecutor {
   return;
 }
 
-ListByteArrayWrapper returnList = (ListByteArrayWrapper) 
getIteration(keyRegion.entrySet(), matchPattern, count, cursor);
+ListByteArrayWrapper returnList = (ListByteArrayWrapper) 
getIteration(new HashSet(keyRegion.entrySet()), matchPattern, count, cursor);
 
 command.setResponse(Coder.getScanResponse(context.getByteBufAllocator(), 
returnList));
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a6a0ef5/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/string/AppendExecutor.java
--
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/string/AppendExecutor.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/string/AppendExecutor.java
index fa83882..fda38c8 100755
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/string/AppendExecutor.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/executor/string/AppendExecutor.java
@@ -17,7 +17,7 @@ public class AppendExecutor extends StringExecutor {
   public void executeCommand(Command command, ExecutionHandlerContext context) 
{
 Listbyte[] commandElems = command.getProcessedCommand();
 
-RegionByteArrayWrapper, ByteArrayWrapper r = 
context.getRegionCache().getStringsRegion();;
+RegionByteArrayWrapper, ByteArrayWrapper r = 
context.getRegionProvider().getStringsRegion();;
 
 if (commandElems.size()  3) {
   
command.setResponse(Coder.getErrorResponse(context.getByteBufAllocator(), 
ArityDef.APPEND));


[1/4] incubator-geode git commit: Fix for GEODE-109

2015-08-06 Thread sbawaskar
Repository: incubator-geode
Updated Branches:
  refs/heads/develop d0d48588c - 1a6a0ef53


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a6a0ef5/gemfire-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java
--
diff --git 
a/gemfire-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java
 
b/gemfire-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java
new file mode 100755
index 000..4adfe07
--- /dev/null
+++ 
b/gemfire-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java
@@ -0,0 +1,414 @@
+package com.gemstone.gemfire.redis;
+
+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.io.IOException;
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Random;
+import java.util.Set;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.Tuple;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+@Category(IntegrationTest.class)
+public class SortedSetsJUnitTest {
+  private static Jedis jedis;
+  private static GemFireRedisServer server;
+  private static GemFireCache cache;
+  private static Random rand;
+  private static int port = 6379;
+
+  @BeforeClass
+  public static void setUp() throws IOException {
+rand = new Random();
+CacheFactory cf = new CacheFactory();
+//cf.set(log-file, redis.log);
+cf.set(log-level, error);
+cf.set(mcast-port, 0);
+cf.set(locators, );
+cache = cf.create();
+port = AvailablePortHelper.getRandomAvailableTCPPort();
+server = new GemFireRedisServer(localhost, port);
+
+server.start();
+jedis = new Jedis(localhost, port, 1000);
+  }
+
+  @Test
+  public void testZAddZRange() {
+int numMembers = 10;
+String key = randString();
+MapString, Double scoreMembers = new HashMapString, Double();
+
+for (int i = 0; i  numMembers; i++)
+  scoreMembers.put(randString(), rand.nextDouble());
+
+jedis.zadd(key, scoreMembers);
+int k = 0;
+for (String entry: scoreMembers.keySet())
+  assertNotNull(jedis.zscore(key, entry));
+
+SetTuple results = jedis.zrangeWithScores(key, 0, -1);
+MapString, Double resultMap = new HashMapString, Double();
+for (Tuple t: results) {
+  resultMap.put(t.getElement(), t.getScore());
+}
+
+assertEquals(scoreMembers, resultMap);
+
+for (int i = 0; i  10; i++) {
+  int start;
+  int stop;
+  do {
+start = rand.nextInt(numMembers);
+stop = rand.nextInt(numMembers);
+  } while (start  stop);
+  results = jedis.zrangeWithScores(key, start, stop);
+  ListEntryString, Double resultList = new ArrayListEntryString, 
Double();
+  for (Tuple t: results)
+resultList.add(new AbstractMap.SimpleEntryString, 
Double(t.getElement(), t.getScore()));
+  ListEntryString, Double list = new ArrayListEntryString, 
Double(scoreMembers.entrySet());
+  Collections.sort(list, new EntryCmp());
+  list = list.subList(start, stop + 1);
+  assertEquals(list, resultList);
+}
+  }
+
+  @Test
+  public void testZRevRange() {
+int numMembers = 10;
+String key = randString();
+
+MapString, Double scoreMembers = new HashMapString, Double();
+
+for (int i = 0; i  numMembers; i++)
+  scoreMembers.put(randString(), rand.nextDouble());
+
+jedis.zadd(key, scoreMembers);
+
+SetTuple results;
+
+for (int i = 0; i  10; i++) {
+  int start;
+  int stop;
+  do {
+start = rand.nextInt(numMembers);
+stop = rand.nextInt(numMembers);
+  } while (start  stop);
+  results = jedis.zrevrangeWithScores(key, start, stop);
+  ListEntryString, Double resultList = new ArrayListEntryString, 
Double();
+  for (Tuple t: results)
+resultList.add(new AbstractMap.SimpleEntryString, 
Double(t.getElement(), t.getScore()));
+  ListEntryString, Double list = new ArrayListEntryString, 
Double(scoreMembers.entrySet());
+  Collections.sort(list, new EntryRevCmp());
+  list = list.subList(start, stop + 1);
+  assertEquals(list, resultList);
+}
+  }
+
+  @Test
+  public void testZCount() {
+int num = 10;
+int runs = 2;
+for (int i = 0; i  runs; i++) {
+  Double min;
+  Double max;
+  do {
+min =