incubator-geode git commit: Fixing the spotless error on DiskSpaceLimitIntegrationTest.java

2016-11-08 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 35f92e074 -> 0fb509324


Fixing the spotless error on DiskSpaceLimitIntegrationTest.java


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

Branch: refs/heads/develop
Commit: 0fb5093245a42ee64dcc4816e80516e3683f34ef
Parents: 35f92e0
Author: nabarun 
Authored: Tue Nov 8 08:05:43 2016 -0800
Committer: nabarun 
Committed: Tue Nov 8 08:05:43 2016 -0800

--
 .../geode/internal/statistics/DiskSpaceLimitIntegrationTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0fb50932/geode-core/src/test/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java
index e8b3fd8..1702d9a 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/statistics/DiskSpaceLimitIntegrationTest.java
@@ -43,7 +43,7 @@ import java.util.concurrent.TimeoutException;
 public class DiskSpaceLimitIntegrationTest {
 
   private static final long FILE_SIZE_LIMIT = 256;
-  private static final long DISK_SPACE_LIMIT = FILE_SIZE_LIMIT*2;
+  private static final long DISK_SPACE_LIMIT = FILE_SIZE_LIMIT * 2;
 
   private File dir;
   private File dirOfDeletedFiles;



incubator-geode git commit: GEODE-2063: Increased the timeout on async thread join

2016-11-07 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 0a96cbd9a -> a20a6ba09


GEODE-2063: Increased the timeout on async thread join

* Increase the time for the main thread to wait for the async operation 
to complete.


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

Branch: refs/heads/develop
Commit: a20a6ba098ae2418134fc0deb42da3dcda8ea97c
Parents: 0a96cbd
Author: nabarun 
Authored: Wed Nov 2 13:38:30 2016 -0700
Committer: nabarun 
Committed: Mon Nov 7 13:27:55 2016 -0800

--
 .../cache/query/internal/index/MultiIndexCreationDUnitTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a20a6ba0/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java
index b577c34..69098c6 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java
@@ -131,12 +131,12 @@ public class MultiIndexCreationDUnitTest extends 
JUnit4CacheTestCase {
   }
 });
 
-ThreadUtils.join(a1, 6000);
+ThreadUtils.join(a1, 12);
 
 if (a1.exceptionOccurred()) {
   fail(a1.getException().getMessage());
 }
-ThreadUtils.join(a2, 6000);
+ThreadUtils.join(a2, 12);
 if (a2.exceptionOccurred()) {
   fail(a2.getException().getMessage());
 }



incubator-geode git commit: Fixing the spotless formatting errors

2016-11-03 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop bca948fcc -> aa05b5d2c


Fixing the spotless formatting errors


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

Branch: refs/heads/develop
Commit: aa05b5d2c3945f45c36f4a593c6ad4e11a4d9bfa
Parents: bca948f
Author: nabarunnag 
Authored: Thu Nov 3 12:38:53 2016 -0700
Committer: nabarunnag 
Committed: Thu Nov 3 12:38:53 2016 -0700

--
 .../cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java  | 4 ++--
 .../cache/execute/ClientServerFunctionExecutionDUnitTest.java| 4 ++--
 .../org/apache/geode/internal/cache/functions/TestFunction.java  | 3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aa05b5d2/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
index f83e2ff..2a8a64c 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java
@@ -82,8 +82,8 @@ public class PdxLocalQueryVersionedClassDUnitTest extends 
PDXQueryTestBase {
 ClientCacheFactory cf = new ClientCacheFactory();
 cf.addPoolServer(NetworkUtils.getServerHostName(server.getHost()), 
port1);
 ClientCache cache = getClientCache(cf);
-Region region = 
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
-.create(regionName);
+Region region =
+
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).create(regionName);
 
 for (int i = 0; i < numberOfEntries; i++) {
   PdxInstanceFactory pdxInstanceFactory =

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aa05b5d2/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index 0138cd1..07f6537 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -664,9 +664,9 @@ public class ClientServerFunctionExecutionDUnitTest extends 
PRClientServerTestBa
   ResultCollector rs = execute(member, Boolean.TRUE, function, isByName);
   ArrayList list = (ArrayList) rs.getResult();
   assertTrue("Value of send result of the executed function : " + 
list.get(0)
-  + "does not match the expected value : " + 1,((Integer) list.get(0)) 
== 1);
+  + "does not match the expected value : " + 1, ((Integer) 
list.get(0)) == 1);
   assertTrue("Value of last result of the executed function : " + 
list.get(0)
-  + "is not equal or more than expected value : " + 5,((Integer) 
list.get(1)) >= 5);
+  + "is not equal or more than expected value : " + 5, ((Integer) 
list.get(1)) >= 5);
 } catch (Exception ex) {
   ex.printStackTrace();
   Assert.fail("This is not expected Exception", ex);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aa05b5d2/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
index 0b0b368..4182bf9 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
@@ -695,7 +695,8 @@ public class TestFunction extends FunctionAdapter 
implements Declarable2 {
 + ds.getDistributedMember() + "with Context : " + context);
 if (retryCountForExecuteFunctionReexecuteException >= 5) {
   logger.fine("Tried Function 

incubator-geode git commit: GEODE-1932: Synchronized the test functions

2016-11-02 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop e26ae8d20 -> 9bbecb214


GEODE-1932: Synchronized the test functions

* Synchronized the test functions so that multiple execution doesn't 
corrupt the value of the static variables.
* Created new global variables so that they are not shared by the 
different test functions used by different 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/9bbecb21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/9bbecb21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/9bbecb21

Branch: refs/heads/develop
Commit: 9bbecb21460989f8c41ad81d5aa40b03a01646d6
Parents: e26ae8d
Author: nabarun 
Authored: Tue Nov 1 12:24:33 2016 -0700
Committer: nabarun 
Committed: Wed Nov 2 13:28:43 2016 -0700

--
 .../ClientServerFunctionExecutionDUnitTest.java|  7 ---
 .../geode/internal/cache/functions/TestFunction.java   | 13 +++--
 2 files changed, 11 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9bbecb21/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index d217792..0138cd1 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -403,7 +403,6 @@ public class ClientServerFunctionExecutionDUnitTest extends 
PRClientServerTestBa
* this is the case of HA then system should retry the function execution. 
After 5th attempt
* function will send Boolean as last result.
*/
-  @Category(FlakyTest.class) // GEODE-1932
   @Test
   public void testOnServerExecution_FunctionInvocationTargetException() {
 createScenario();
@@ -664,8 +663,10 @@ public class ClientServerFunctionExecutionDUnitTest 
extends PRClientServerTestBa
 try {
   ResultCollector rs = execute(member, Boolean.TRUE, function, isByName);
   ArrayList list = (ArrayList) rs.getResult();
-  assertTrue(((Integer) list.get(0)) == 1);
-  assertTrue(((Integer) list.get(1)) == 5);
+  assertTrue("Value of send result of the executed function : " + 
list.get(0)
+  + "does not match the expected value : " + 1,((Integer) list.get(0)) 
== 1);
+  assertTrue("Value of last result of the executed function : " + 
list.get(0)
+  + "is not equal or more than expected value : " + 5,((Integer) 
list.get(1)) >= 5);
 } catch (Exception ex) {
   ex.printStackTrace();
   Assert.fail("This is not expected Exception", ex);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9bbecb21/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
index f9f05ab..0b0b368 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/functions/TestFunction.java
@@ -92,6 +92,7 @@ public class TestFunction extends FunctionAdapter implements 
Declarable2 {
   private final Properties props;
   private static final String NOACKTEST = "NoAckTest";
   private static int retryCount = 0;
+  private static int retryCountForExecuteFunctionReexecuteException = 0;
   private static int firstExecutionCount = 0;
 
   // Default constructor for Declarable purposes
@@ -686,16 +687,16 @@ public class TestFunction extends FunctionAdapter 
implements Declarable2 {
 }
   }
 
-  private void executeFunctionReexecuteException(FunctionContext context) {
-retryCount++;
+  private synchronized void executeFunctionReexecuteException(FunctionContext 
context) {
+retryCountForExecuteFunctionReexecuteException++;
 DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
 LogWriter logger = ds.getLogWriter();
 logger.fine("Executing executeException in TestFunction on Member : "
 + ds.getDistributedMember() + "with Context : " + context);
-if (retryCount >= 5) {
+if (retryCountForExecuteFunctionReexecuteException >= 5) {
   logger.fine("Tried Function 

incubator-geode git commit: GEODE-2062: Removing a comment.

2016-11-02 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop a64f7f60e -> e26ae8d20


GEODE-2062: Removing a comment.

* A comment was checked in which is removed in this checkin


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

Branch: refs/heads/develop
Commit: e26ae8d20626567cf61deeccb4cabff30c145107
Parents: a64f7f6
Author: nabarun 
Authored: Wed Nov 2 13:22:42 2016 -0700
Committer: nabarun 
Committed: Wed Nov 2 13:22:42 2016 -0700

--
 .../org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e26ae8d2/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
index dd4cfc7..78b092f 100755
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
@@ -71,7 +71,7 @@ public class HashIndexDUnitTest extends 
JUnit4DistributedTestCase {
 
   @Test
   public void testHashIndexForConcurrentHashSet() throws Exception {
-doPut(333); // 111 entries for a key in the index (> 100 so creates a 
ConcurrentHashSet)//test
+doPut(333); // 111 entries for a key in the index (> 100 so creates a 
ConcurrentHashSet)
 doQuery();
 doUpdate(333);
 doQuery();



[2/3] incubator-geode git commit: GEODE-2062:Added new tests for PDX queries, order by queries and queries using indexes.

2016-11-02 Thread nnag
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a64f7f60/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxQueryDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxQueryDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxQueryDUnitTest.java
new file mode 100644
index 000..6f5e2c4
--- /dev/null
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PdxQueryDUnitTest.java
@@ -0,0 +1,3590 @@
+/*
+ * 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.dunit;
+
+import static org.apache.geode.internal.Assert.fail;
+import static org.junit.Assert.assertEquals;
+
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.logging.log4j.Logger;
+import org.junit.Test;
+
+import org.apache.geode.cache.AttributesFactory;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheException;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.PartitionAttributesFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.Scope;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.cache.client.ClientRegionShortcut;
+import org.apache.geode.cache.client.PoolManager;
+import org.apache.geode.cache.query.CacheUtils;
+import org.apache.geode.cache.query.IndexType;
+import org.apache.geode.cache.query.Query;
+import org.apache.geode.cache.query.QueryService;
+import org.apache.geode.cache.query.SelectResults;
+import org.apache.geode.cache.query.Struct;
+import org.apache.geode.cache.query.data.PortfolioPdx;
+import org.apache.geode.cache.query.data.PositionPdx;
+import org.apache.geode.cache.query.internal.Undefined;
+import org.apache.geode.cache.server.CacheServer;
+import org.apache.geode.cache30.CacheSerializableRunnable;
+import org.apache.geode.cache30.ClientServerTestCase;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.pdx.FieldType;
+import org.apache.geode.pdx.JSONFormatter;
+import org.apache.geode.pdx.PdxInstance;
+import org.apache.geode.pdx.PdxInstanceFactory;
+import org.apache.geode.pdx.internal.ClientTypeRegistration;
+import org.apache.geode.pdx.internal.PdxInstanceFactoryImpl;
+import org.apache.geode.pdx.internal.PdxType;
+import org.apache.geode.pdx.internal.PeerTypeRegistration;
+import org.apache.geode.pdx.internal.TypeRegistration;
+import org.apache.geode.test.dunit.Assert;
+import org.apache.geode.test.dunit.DistributedTestCase;
+import org.apache.geode.test.dunit.DistributedTestUtils;
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.Invoke;
+import org.apache.geode.test.dunit.NetworkUtils;
+import org.apache.geode.test.dunit.SerializableCallable;
+import org.apache.geode.test.dunit.SerializableRunnable;
+import org.apache.geode.test.dunit.VM;
+import org.junit.experimental.categories.Category;
+
+@Category(DistributedTest.class)
+public class PdxQueryDUnitTest extends PDXQueryTestBase {
+  public static final Logger logger = LogService.getLogger();
+
+  public PdxQueryDUnitTest() {
+super();
+  }
+
+  /**
+   * Tests client-server query on PdxInstance. The client receives projected 
value.
+   */
+  @Test
+  public void testServerQuery() throws CacheException {
+
+final Host host = Host.getHost(0);
+VM vm0 = host.getVM(0);
+VM vm1 = host.getVM(1);
+final int numberOfEntries = 5;
+
+// Start server1
+vm0.invoke(new CacheSerializableRunnable("Create Bridge Server") {
+  public void run2() throws CacheException {
+configAndStartBridgeServer();
+Region region = getRootRegion().getSubregion(regionName);
+for (int i = 0; i < numberOfEntries; i++) {
+  region.put("key-" + i, new TestObject(i, "vmware"));
+}
+  }
+});
+
+

[3/3] incubator-geode git commit: GEODE-2062:Added new tests for PDX queries, order by queries and queries using indexes.

2016-11-02 Thread nnag
GEODE-2062:Added new tests for PDX queries, order by queries and queries using 
indexes.

* PDXInstance and PDXFactoryImpl were used to validate multiple class 
version test rather than writing dummy PDX classes
* JUnit4CacheTestCase was used instead of Junit3 elements.


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

Branch: refs/heads/develop
Commit: a64f7f60e8d2e45519d7c0c7a52688e70c986a5e
Parents: 4265fa5
Author: nabarun 
Authored: Mon Oct 31 11:16:09 2016 -0700
Committer: nabarun 
Committed: Wed Nov 2 13:19:00 2016 -0700

--
 .../cache/query/dunit/HashIndexDUnitTest.java   |2 +-
 .../dunit/OrderByPartitionedDUnitTest.java  |  370 ++
 .../cache/query/dunit/PDXQueryTestBase.java |  451 +++
 .../PdxGroupByPartitionedQueryDUnitTest.java|   90 +
 .../query/dunit/PdxLocalQueryDUnitTest.java |  924 +
 .../PdxLocalQueryVersionedClassDUnitTest.java   |  173 +
 .../cache/query/dunit/PdxQueryDUnitTest.java| 3590 ++
 .../cache/query/dunit/PortfolioPdxVersion.java  |  103 +
 .../cache/query/dunit/PositionPdxVersion.java   |  163 +
 .../cache/query/dunit/QueryIndexDUnitTest.java  | 1331 +++
 10 files changed, 7196 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a64f7f60/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
index 78b092f..dd4cfc7 100755
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/HashIndexDUnitTest.java
@@ -71,7 +71,7 @@ public class HashIndexDUnitTest extends 
JUnit4DistributedTestCase {
 
   @Test
   public void testHashIndexForConcurrentHashSet() throws Exception {
-doPut(333); // 111 entries for a key in the index (> 100 so creates a 
ConcurrentHashSet)
+doPut(333); // 111 entries for a key in the index (> 100 so creates a 
ConcurrentHashSet)//test
 doQuery();
 doUpdate(333);
 doQuery();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a64f7f60/geode-core/src/test/java/org/apache/geode/cache/query/dunit/OrderByPartitionedDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/OrderByPartitionedDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/OrderByPartitionedDUnitTest.java
new file mode 100644
index 000..323559e
--- /dev/null
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/OrderByPartitionedDUnitTest.java
@@ -0,0 +1,370 @@
+/*
+ * 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.dunit;
+
+import static org.apache.geode.test.dunit.Assert.*;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.PartitionAttributesFactory;
+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.IndexExistsException;
+import org.apache.geode.cache.query.IndexInvalidException;
+import org.apache.geode.cache.query.IndexNameConflictException;
+import org.apache.geode.cache.query.IndexType;
+import org.apache.geode.cache.query.RegionNotFoundException;
+import org.apache.geode.cache.query.functional.OrderByPartitionedJUnitTest;
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.SerializableRunnable;
+import 

[1/3] incubator-geode git commit: GEODE-2062:Added new tests for PDX queries, order by queries and queries using indexes.

2016-11-02 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 4265fa593 -> a64f7f60e


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a64f7f60/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PortfolioPdxVersion.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PortfolioPdxVersion.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PortfolioPdxVersion.java
new file mode 100644
index 000..5a61c64
--- /dev/null
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PortfolioPdxVersion.java
@@ -0,0 +1,103 @@
+/*
+ * 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.dunit;
+
+import java.util.HashMap;
+
+import org.apache.geode.cache.query.data.CollectionHolder;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.pdx.PdxInstance;
+import org.apache.geode.pdx.PdxInstanceFactory;
+
+
+public class PortfolioPdxVersion {
+
+  private int ID;
+  public String pkid;
+  public PositionPdxVersion position1;
+  public PositionPdxVersion position2;
+  public Object[] position3;
+  public String description;
+  public long createTime;
+  public HashMap positions = new HashMap();
+  public HashMap collectionHolderMap = new HashMap();
+  String type;
+  public String status;
+  public String[] names = {"aaa", "bbb", "ccc", "ddd"};
+  public String unicodeṤtring;
+
+  public static String secIds[] = {"SUN", "IBM", "YHOO", "GOOG", "MSFT", 
"AOL", "APPL", "ORCL",
+  "SAP", "DELL", "RHAT", "NOVL", "HP"};
+
+  public PortfolioPdxVersion(int i) {
+ID = i;
+if (i % 2 == 0) {
+  description = null;
+} else {
+  description = "";
+}
+pkid = "" + i;
+status = i % 2 == 0 ? "active" : "inactive";
+type = "type" + (i % 3);
+position1 = new PositionPdxVersion(secIds[PositionPdxVersion.cnt % 
secIds.length],
+PositionPdxVersion.cnt * 1000);
+if (i % 2 != 0) {
+  position2 = new PositionPdxVersion(secIds[PositionPdxVersion.cnt % 
secIds.length],
+  PositionPdxVersion.cnt * 1000);
+} else {
+  position2 = null;
+}
+
+positions.put(secIds[PositionPdxVersion.cnt % secIds.length], new 
PositionPdxVersion(
+secIds[PositionPdxVersion.cnt % secIds.length], PositionPdxVersion.cnt 
* 1000));
+positions.put(secIds[PositionPdxVersion.cnt % secIds.length], new 
PositionPdxVersion(
+secIds[PositionPdxVersion.cnt % secIds.length], PositionPdxVersion.cnt 
* 1000));
+
+collectionHolderMap.put("0", new CollectionHolder());
+collectionHolderMap.put("1", new CollectionHolder());
+
+unicodeṤtring = i % 2 == 0 ? "ṤṶẐ" : "ṤẐṶ";
+Assert.assertTrue(unicodeṤtring.length() == 3);
+  }
+
+  public PortfolioPdxVersion(int i, int j) {
+this(i);
+this.position1.portfolioId = j;
+this.position3 = new Object[3];
+for (int k = 0; k < position3.length; k++) {
+  PositionPdxVersion p = new PositionPdxVersion(secIds[k], (k + 1) * 1000);
+  p.portfolioId = (k + 1);
+  this.position3[k] = p;
+}
+  }
+
+  public PdxInstance createPdxInstance(PdxInstanceFactory pdxFactory) {
+pdxFactory.writeInt("ID", this.ID);
+pdxFactory.writeString("pkid", this.pkid);
+pdxFactory.writeObject("position1", this.position1);
+pdxFactory.writeObject("position2", this.position2);
+pdxFactory.writeObject("positions", this.positions);
+pdxFactory.writeObject("collectionHolderMap", this.collectionHolderMap);
+pdxFactory.writeString("type", this.type);
+pdxFactory.writeString("status", this.status);
+pdxFactory.writeStringArray("names", this.names);
+pdxFactory.writeString("description", this.description);
+pdxFactory.writeLong("createTime", this.createTime);
+pdxFactory.writeObjectArray("position3", this.position3);
+
+return pdxFactory.create();
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a64f7f60/geode-core/src/test/java/org/apache/geode/cache/query/dunit/PositionPdxVersion.java
--
diff --git 

incubator-geode git commit: GEODE-502: Increased the startup timeout for DUnit tests

2016-10-24 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 774298116 -> a78d491d6


GEODE-502: Increased the startup timeout for DUnit tests

* In DUnitLauncher increased the startup timeout
* This is done to accomodate the extra time needed if GC kicks in.


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

Branch: refs/heads/develop
Commit: a78d491d60a40628a4ad99463a3482e830ca971f
Parents: 7742981
Author: nabarun 
Authored: Wed Oct 19 10:41:35 2016 -0700
Committer: nabarun 
Committed: Mon Oct 24 15:33:14 2016 -0700

--
 .../java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a78d491d/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
 
b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
index 3451695..5a80a64 100644
--- 
a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
+++ 
b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
@@ -72,7 +72,7 @@ public class DUnitLauncher {
   private static final int DEBUGGING_VM_NUM = -1;
   private static final int LOCATOR_VM_NUM = -2;
 
-  static final long STARTUP_TIMEOUT = 30 * 1000;
+  static final long STARTUP_TIMEOUT = 120 * 1000;
   private static final String SUSPECT_FILENAME = "dunit_suspect.log";
   private static File DUNIT_SUSPECT_FILE;
 



incubator-geode git commit: GEODE-1353: Added listeners to slow down the receiver.

2016-10-18 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 5c50954d1 -> 56836e59f


GEODE-1353: Added listeners to slow down the receiver.

* Added a listener on after create to slow down the receiver.
* This was done to avoid the need for a very large number of puts.
* When region size is more than 5 it can initiate the destroy region
* While the puts have been reduced to 2000 from 20,000
* This will make sure the queue is not empty.


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

Branch: refs/heads/develop
Commit: 56836e59f39a273432b6e64904c41c7854f6446f
Parents: 5c50954
Author: nabarun 
Authored: Tue Oct 4 16:21:26 2016 -0700
Committer: nabarun 
Committed: Tue Oct 18 14:13:19 2016 -0700

--
 .../wan/serial/SerialWANStatsDUnitTest.java | 43 
 1 file changed, 25 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/56836e59/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
index 4db4890..ceca847 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
@@ -379,54 +379,61 @@ public class SerialWANStatsDUnitTest extends WANTestBase {
* 1 region and sender configured on local site and 1 region and a 
* receiver configured on remote site. Puts to the local region are in 
progress.
* Remote region is destroyed in the middle.
+   *
+   * Better fix : slowed down the receiver after every create event, So a huge 
number of puts is not required.
+   *
* 
* @throws Exception
*/
-  @Category(FlakyTest.class) // GEODE-1353
   @Test
   public void testReplicatedSerialPropagationWithRemoteRegionDestroy() throws 
Exception {
-  int numEntries = 2;
+  int numEntries = 2000;
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
 //these are part of remote site
 vm2.invoke(() -> WANTestBase.createCache( nyPort ));
+
+//create one RR (RR_1) on remote site
+vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+  testName + "_RR_1", null, isOffHeap()  ));
+
+
 vm2.invoke(() -> WANTestBase.createReceiver());
 
+//This slows down the receiver
+vm2.invoke(() -> addListenerToSleepAfterCreateEvent(1000, testName + 
"_RR_1"));
+
+
 //these are part of local site
 vm4.invoke(() -> WANTestBase.createCache( lnPort ));
 vm5.invoke(() -> WANTestBase.createCache( lnPort ));
 vm6.invoke(() -> WANTestBase.createCache( lnPort ));
 vm7.invoke(() -> WANTestBase.createCache( lnPort ));
 
+//create one RR (RR_1) on local site
+vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+  testName + "_RR_1", "ln", isOffHeap()  ));
+vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+  testName + "_RR_1", "ln", isOffHeap()  ));
+vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+  testName + "_RR_1", "ln", isOffHeap()  ));
+vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+  testName + "_RR_1", "ln", isOffHeap()  ));
+
 //senders are created on local site
 vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
 false, 100, 100, false, false, null, true ));
 vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
 false, 100, 100, false, false, null, true ));
 
-//create one RR (RR_1) on remote site
-vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-testName + "_RR_1", null, isOffHeap()  ));
-//This is to cause a scenario where we have received at least X events and 
want to slow the receiver
-vm2.invoke(() -> WANTestBase.longPauseAfterNumEvents(500, 200));
 //start the senders on local site
 startSenderInVMs("ln", vm4, vm5);
 
-//create one RR (RR_1) on local site
-vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-testName + "_RR_1", "ln", isOffHeap()  ));
-vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-testName + "_RR_1", "ln", isOffHeap()  ));
-vm6.invoke(() -> 

incubator-geode git commit: GEODE-1978: Slowing down the receivers

2016-10-12 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop a78fa7537 -> 313bbab55


GEODE-1978: Slowing down the receivers

* Slowing down the receivers so that the senders do not complete
* transmission before the regions are destroyed in the receivers.
* Removing the flaky test tag


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

Branch: refs/heads/develop
Commit: 313bbab5513a9ec01ecf9206955c19d70a8fc26c
Parents: a78fa75
Author: nabarun 
Authored: Wed Oct 12 10:04:32 2016 -0700
Committer: nabarun 
Committed: Wed Oct 12 12:52:13 2016 -0700

--
 .../ConcurrentWANPropagation_1_DUnitTest.java   | 36 +++-
 1 file changed, 19 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/313bbab5/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java
index 8bfd8e7..041e3ca 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java
@@ -319,7 +319,6 @@ public class ConcurrentWANPropagation_1_DUnitTest extends 
WANTestBase {
* 
* @throws Exception
*/
-  @Category(FlakyTest.class) // GEODE-1978
   @Test
   public void testReplicatedSerialPropagationWithRemoteRegionDestroy() throws 
Exception {
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
@@ -327,37 +326,40 @@ public class ConcurrentWANPropagation_1_DUnitTest extends 
WANTestBase {
 
 //these are part of remote site
 createCacheInVMs(nyPort, vm2, vm3);
+
+//create one RR (RR_1) on remote site
+vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR_1", null, isOffHeap() ));
+vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR_1", null, isOffHeap() ));
+
 createReceiverInVMs(vm2, vm3);
 
+vm2.invoke(() -> 
addListenerToSleepAfterCreateEvent(1000,getTestMethodName() + "_RR_1"));
+vm3.invoke(() -> 
addListenerToSleepAfterCreateEvent(1000,getTestMethodName() + "_RR_1"));
 
 //these are part of local site
 createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
+//create one RR (RR_1) on local site
+vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
+vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
+vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
+vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
+
 //senders are created on local site
 vm4.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
 false, 100, 500, false, false, null, true, 5, OrderPolicy.KEY ));
 vm5.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
 false, 100, 500, false, false, null, true, 5, OrderPolicy.KEY ));
 
-//create one RR (RR_1) on remote site
-vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", null, isOffHeap() ));
-vm3.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", null, isOffHeap() ));
-
 //start the senders on local site
 startSenderInVMs("ln", vm4, vm5);
 
-//create one RR (RR_1) on local site
-vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
-vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
-vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
-vm7.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap() ));
-
 IgnoredException.addIgnoredException(BatchException70.class.getName());
 
IgnoredException.addIgnoredException(ServerOperationException.class.getName());
 



incubator-geode git commit: GEODE-1180: Resolved as a part of bb44eb6d51144a3c9798d4323eabf3d4beab8cda

2016-10-11 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f223a2e5b -> f079f3709


GEODE-1180: Resolved as a part of bb44eb6d51144a3c9798d4323eabf3d4beab8cda

* Removed the flaky tag


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

Branch: refs/heads/develop
Commit: f079f37093979571527f4ab8c67c2f96758ced40
Parents: f223a2e
Author: nabarun 
Authored: Tue Oct 11 14:52:41 2016 -0700
Committer: nabarun 
Committed: Tue Oct 11 14:52:41 2016 -0700

--
 .../cache/wan/parallel/ParallelWANPropagationDUnitTest.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f079f370/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
index 3836098..c8bf32a 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
@@ -705,7 +705,6 @@ public class ParallelWANPropagationDUnitTest extends 
WANTestBase {
 getTestMethodName() + "_PR", 1000 ));
   }
 
-  @Category(FlakyTest.class) // GEODE-1008 and GEODE-1180: random ports, async 
actions, thread sleeps, time sensitive, waitForCriterion
   @Test
   public void testPartitionedParallelPropagationHA() throws Exception {
 IgnoredException.addIgnoredException("Broken pipe");



incubator-geode git commit: GEODE-1586: Test assumed to fixed by ff2637d7aeadd0beda581d5c2422803f167021e1

2016-10-11 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 29e494803 -> f223a2e5b


GEODE-1586: Test assumed to fixed by ff2637d7aeadd0beda581d5c2422803f167021e1

* Removing the Flaky Tag


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

Branch: refs/heads/develop
Commit: f223a2e5b7cdad4a181c95fb78817bb297bdb578
Parents: 29e4948
Author: nabarun 
Authored: Tue Oct 11 14:26:08 2016 -0700
Committer: nabarun 
Committed: Tue Oct 11 14:26:08 2016 -0700

--
 .../wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f223a2e5/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
index e06e564..b755661 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
@@ -586,7 +586,7 @@ public class ConcurrentParallelGatewaySenderDUnitTest 
extends WANTestBase {
 getTestMethodName(), 1000 ));
   }
   
-  @Category(FlakyTest.class) // GEODE-1586
+
   @Test
   public void testPartitionedParallelPropagationHA() throws Exception {
 IgnoredException.addIgnoredException(SocketException.class.getName()); // 
for Connection reset



incubator-geode git commit: GEODE-1967: Old keys are removed from removedKeyValuesEntries

2016-10-10 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 3626c75f8 -> b2d85b4b0


GEODE-1967: Old keys are removed from removedKeyValuesEntries

* Old keys are removed from removedKeyValuesEntries after the mapping 
is removed from Compact map range indexes.
* New tests were added to handle various scenarios of old keys being 
destroyed and then inserted again.


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

Branch: refs/heads/develop
Commit: b2d85b4b0c74c25d7872aaca1bbe520b478563f7
Parents: 3626c75
Author: nabarun 
Authored: Fri Oct 7 13:57:34 2016 -0700
Committer: nabarun 
Committed: Mon Oct 10 17:22:05 2016 -0700

--
 .../internal/index/CompactMapRangeIndex.java|   9 +-
 .../MapRangeIndexMaintenanceJUnitTest.java  | 617 ++-
 2 files changed, 622 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b2d85b4b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/CompactMapRangeIndex.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/CompactMapRangeIndex.java
 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/CompactMapRangeIndex.java
index 234dfae..61c4e22 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/CompactMapRangeIndex.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/CompactMapRangeIndex.java
@@ -134,11 +134,14 @@ public class CompactMapRangeIndex extends AbstractMapIndex
   oldKeysAndValuesForEntry = Collections.EMPTY_MAP;
 }
 Set removedKeyValueEntries = oldKeysAndValuesForEntry != null ? 
oldKeysAndValuesForEntry.entrySet() : Collections.EMPTY_SET;
- for (Map.Entry keyValue : removedKeyValueEntries) {
+Iterator iterator = removedKeyValueEntries.iterator();
+ while (iterator.hasNext()) {
+   Entry keyValue = iterator.next();
   Object indexKey = keyValue.getKey() == null ? IndexManager.NULL : 
keyValue.getKey();
if (!presentKeys.contains(indexKey)) {
-CompactRangeIndex rg = (CompactRangeIndex) 
this.mapKeyToValueIndex.get(keyValue.getKey());
-rg.removeMapping(keyValue.getValue(), entry);
+ CompactRangeIndex rg = (CompactRangeIndex) 
this.mapKeyToValueIndex.get(keyValue.getKey());
+ rg.removeMapping(keyValue.getValue(), entry);
+ iterator.remove();
   }
 }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b2d85b4b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MapRangeIndexMaintenanceJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MapRangeIndexMaintenanceJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MapRangeIndexMaintenanceJUnitTest.java
index b651272..7ed00a4 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MapRangeIndexMaintenanceJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MapRangeIndexMaintenanceJUnitTest.java
@@ -82,7 +82,7 @@ public class MapRangeIndexMaintenanceJUnitTest{
 assertEquals(100, region.size());
 qs = CacheUtils.getQueryService();
 
-keyIndex1 = (IndexProtocol) qs.createIndex(INDEX_NAME, "positions['SUN', 
'IBM']", "/portfolio ");
+keyIndex1 = (IndexProtocol) qs.createIndex(INDEX_NAME, "positions['SUN', 
'IBM']", "/portfolio p");
 
 assertTrue(keyIndex1 instanceof CompactMapRangeIndex);
 
@@ -531,7 +531,622 @@ public class MapRangeIndexMaintenanceJUnitTest{
 assertEquals(1, results.size());
   }
 
+  @Test
+  public void 
updatingWithSameKeysDifferentValuesAfterRemovingShouldReinsertIndexMappings() 
throws Exception {
+AttributesFactory af = new AttributesFactory();
+af.setScope(Scope.LOCAL);
+region = CacheUtils.createRegion("portfolio", af.create(), false);
+qs = CacheUtils.getQueryService();
+Index keyIndex1 = qs.createIndex(INDEX_NAME, "positions[*]", "/portfolio");
+
+Portfolio p1 = new Portfolio(1, 1);
+HashMap map1 = new HashMap();
+map1.put("SUN", 1);
+map1.put("IBM", 2);
+p1.positions = map1;
+region.put(1, p1);
+
+
+Portfolio p2 = new Portfolio(1, 1);
+HashMap map2 = new HashMap();
+p2.positions = map2;
+map2.put("GOOG", 1);
+region.put(1, p2);
+
+SelectResults results = (SelectResults) 

incubator-geode git commit: GEODE-1926: Removing the extra getObjectInSerialSenderQueue call

2016-10-10 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 4b3ae7867 -> a0acc3ca6


GEODE-1926: Removing the extra getObjectInSerialSenderQueue call

* This was causing few tests to hang waiting for queues to drain.


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

Branch: refs/heads/develop
Commit: a0acc3ca646a72379f8fc25297d5301ffd95da80
Parents: 4b3ae78
Author: nabarun 
Authored: Mon Oct 10 14:09:43 2016 -0700
Committer: nabarun 
Committed: Mon Oct 10 14:09:43 2016 -0700

--
 .../geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java   | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a0acc3ca/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
index 28f5f83..79b9d86 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
@@ -811,7 +811,6 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
 logger.trace("{}: Trying head key + offset: {}", this, currentKey);
   }
   currentKey = inc(currentKey);
-  object = getObjectInSerialSenderQueue(currentKey);
   if (this.stats != null) {
 this.stats.incEventsNotQueuedConflated();
   }



incubator-geode git commit: GEODE-1926: Modification of peedAhead() function

2016-10-07 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop fbbdb824b -> 654b06ed2


GEODE-1926: Modification of peedAhead() function

* Modification of peedAhead() function check if heapCopy is successful 
before adding the key to peekedIds.
* Since peek() doesnt have access to the current key but just the 
object and hence cannot remove it from peekedIDs list, we moved the check for 
heapcopy into peekAhead.
* So now only if a successful heap copy is made then only the key will 
be placed into the peekedIDs list.


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

Branch: refs/heads/develop
Commit: 654b06ed2fc1d740fe6c2cb2b40fd92b17d5a8dc
Parents: fbbdb82
Author: nabarun 
Authored: Fri Oct 7 14:57:25 2016 -0700
Committer: nabarun 
Committed: Fri Oct 7 14:57:25 2016 -0700

--
 .../wan/serial/SerialGatewaySenderQueue.java|  56 ++
 .../serial/SerialWANConflationDUnitTest.java| 111 +++
 2 files changed, 148 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/654b06ed/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
index a8bb72d..28f5f83 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
@@ -513,13 +513,6 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
 //resetLastPeeked();
 while (batch.size() < size) {
   AsyncEvent object = peekAhead();
-  if (object != null && object instanceof GatewaySenderEventImpl) {
-GatewaySenderEventImpl copy = 
((GatewaySenderEventImpl)object).makeHeapCopyIfOffHeap();
-if (copy == null) {
-  continue;
-}
-object = copy;
-  }
   // Conflate here
   if (object != null) {
 batch.add(object);
@@ -759,17 +752,42 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
* 
* @throws CacheException
*/
-  private AsyncEvent peekAhead() throws CacheException {
-AsyncEvent object = null;
-long currentKey = -1;
+
+  private Long getCurrentKey(){
+long currentKey;
 if (this.peekedIds.isEmpty()) {
-   currentKey = getHeadKey(); 
+  currentKey = getHeadKey();
 } else {
-   Long lastPeek = this.peekedIds.peekLast();
-   if (lastPeek == null) {
-   return null;
-   }
-   currentKey = lastPeek.longValue() + 1;
+  Long lastPeek = this.peekedIds.peekLast();
+  if (lastPeek == null) {
+return null;
+  }
+  currentKey = lastPeek.longValue() + 1;
+}
+return currentKey;
+  }
+
+  private AsyncEvent getObjectInSerialSenderQueue(Long currentKey) {
+AsyncEvent object = optimalGet(currentKey);
+if ((null != object) && logger.isDebugEnabled()) {
+  logger.debug("{}: Peeked {}->{}", this, currentKey, object);
+}
+if (object != null && object instanceof GatewaySenderEventImpl) {
+  GatewaySenderEventImpl copy = 
((GatewaySenderEventImpl)object).makeHeapCopyIfOffHeap();
+  if (copy == null) {
+logger.debug("Unable to make heap copy and will not be added to 
peekedIds for object" +
+ " : {} ",object.toString());
+  }
+  object = copy;
+}
+return object;
+  }
+
+  private AsyncEvent peekAhead() throws CacheException {
+AsyncEvent object = null;
+Long currentKey = getCurrentKey();
+if(currentKey == null ){
+  return null;
 }
 
 
@@ -788,12 +806,12 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
 // does not save anything since GatewayBatchOp needs to GatewayEventImpl
 // in object form.
 while (before(currentKey, getTailKey())
-// use optimalGet here to fix bug 40654
-&& (object = optimalGet(Long.valueOf(currentKey))) == null) {
+&& (null == (object = getObjectInSerialSenderQueue(currentKey {
   if (logger.isTraceEnabled()) {
 logger.trace("{}: Trying head key + offset: {}", this, currentKey);
   }
   currentKey = inc(currentKey);
+  object = getObjectInSerialSenderQueue(currentKey);
   if (this.stats != null) {
 

[2/2] incubator-geode git commit: GEODE-136: Adding the Apache License header to the file.

2016-10-07 Thread nnag
GEODE-136: Adding the Apache License header to the file.

* This resolves the rat issue in precheckin


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

Branch: refs/heads/develop
Commit: 9189e3bb95fcd8547327c6047dafea5e0fd76dbb
Parents: 7b88c6c
Author: nabarun 
Authored: Fri Oct 7 11:51:57 2016 -0700
Committer: nabarun 
Committed: Fri Oct 7 11:55:32 2016 -0700

--
 .../cli/functions/GetRegionsFunctionJUnitTest.java  | 16 
 1 file changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9189e3bb/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
index 6c57160..74a0268 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
@@ -1,3 +1,19 @@
+/*
+ * 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.management.internal.cli.functions;
 
 import static org.mockito.Mockito.*;



incubator-geode git commit: Revert "GEODE-1926"

2016-10-07 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 9189e3bb9 -> fbbdb824b


Revert "GEODE-1926"

* Precehckin completion pending
This reverts commit 7b88c6cf7ad96675f81a138b2d03f8f3375168cf.


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

Branch: refs/heads/develop
Commit: fbbdb824b824bd169aaff7a6898b104e25e7069b
Parents: 9189e3b
Author: nabarun 
Authored: Fri Oct 7 12:04:29 2016 -0700
Committer: nabarun 
Committed: Fri Oct 7 12:04:29 2016 -0700

--
 .../wan/serial/SerialGatewaySenderQueue.java|  56 --
 .../serial/SerialWANConflationDUnitTest.java| 111 ---
 2 files changed, 19 insertions(+), 148 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fbbdb824/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
index 28f5f83..a8bb72d 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
@@ -513,6 +513,13 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
 //resetLastPeeked();
 while (batch.size() < size) {
   AsyncEvent object = peekAhead();
+  if (object != null && object instanceof GatewaySenderEventImpl) {
+GatewaySenderEventImpl copy = 
((GatewaySenderEventImpl)object).makeHeapCopyIfOffHeap();
+if (copy == null) {
+  continue;
+}
+object = copy;
+  }
   // Conflate here
   if (object != null) {
 batch.add(object);
@@ -752,42 +759,17 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
* 
* @throws CacheException
*/
-
-  private Long getCurrentKey(){
-long currentKey;
-if (this.peekedIds.isEmpty()) {
-  currentKey = getHeadKey();
-} else {
-  Long lastPeek = this.peekedIds.peekLast();
-  if (lastPeek == null) {
-return null;
-  }
-  currentKey = lastPeek.longValue() + 1;
-}
-return currentKey;
-  }
-
-  private AsyncEvent getObjectInSerialSenderQueue(Long currentKey) {
-AsyncEvent object = optimalGet(currentKey);
-if ((null != object) && logger.isDebugEnabled()) {
-  logger.debug("{}: Peeked {}->{}", this, currentKey, object);
-}
-if (object != null && object instanceof GatewaySenderEventImpl) {
-  GatewaySenderEventImpl copy = 
((GatewaySenderEventImpl)object).makeHeapCopyIfOffHeap();
-  if (copy == null) {
-logger.debug("Unable to make heap copy and will not be added to 
peekedIds for object" +
- " : {} ",object.toString());
-  }
-  object = copy;
-}
-return object;
-  }
-
   private AsyncEvent peekAhead() throws CacheException {
 AsyncEvent object = null;
-Long currentKey = getCurrentKey();
-if(currentKey == null ){
-  return null;
+long currentKey = -1;
+if (this.peekedIds.isEmpty()) {
+   currentKey = getHeadKey(); 
+} else {
+   Long lastPeek = this.peekedIds.peekLast();
+   if (lastPeek == null) {
+   return null;
+   }
+   currentKey = lastPeek.longValue() + 1;
 }
 
 
@@ -806,12 +788,12 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
 // does not save anything since GatewayBatchOp needs to GatewayEventImpl
 // in object form.
 while (before(currentKey, getTailKey())
-&& (null == (object = getObjectInSerialSenderQueue(currentKey {
+// use optimalGet here to fix bug 40654
+&& (object = optimalGet(Long.valueOf(currentKey))) == null) {
   if (logger.isTraceEnabled()) {
 logger.trace("{}: Trying head key + offset: {}", this, currentKey);
   }
   currentKey = inc(currentKey);
-  object = getObjectInSerialSenderQueue(currentKey);
   if (this.stats != null) {
 this.stats.incEventsNotQueuedConflated();
   }
@@ -821,7 +803,7 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
   logger.debug("{}: Peeked {}->{}", this, currentKey, object);
 }
 if (object != null) {
-  this.peekedIds.add(currentKey);
+  this.peekedIds.add(Long.valueOf(currentKey));
 }
 return object;
   }


[1/2] incubator-geode git commit: GEODE-1926

2016-10-07 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 769d9b3ae -> 9189e3bb9


GEODE-1926


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

Branch: refs/heads/develop
Commit: 7b88c6cf7ad96675f81a138b2d03f8f3375168cf
Parents: 769d9b3
Author: nabarun 
Authored: Thu Oct 6 16:06:31 2016 -0700
Committer: nabarun 
Committed: Fri Oct 7 10:00:21 2016 -0700

--
 .../wan/serial/SerialGatewaySenderQueue.java|  56 ++
 .../serial/SerialWANConflationDUnitTest.java| 111 +++
 2 files changed, 148 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7b88c6cf/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
index a8bb72d..28f5f83 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
@@ -513,13 +513,6 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
 //resetLastPeeked();
 while (batch.size() < size) {
   AsyncEvent object = peekAhead();
-  if (object != null && object instanceof GatewaySenderEventImpl) {
-GatewaySenderEventImpl copy = 
((GatewaySenderEventImpl)object).makeHeapCopyIfOffHeap();
-if (copy == null) {
-  continue;
-}
-object = copy;
-  }
   // Conflate here
   if (object != null) {
 batch.add(object);
@@ -759,17 +752,42 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
* 
* @throws CacheException
*/
-  private AsyncEvent peekAhead() throws CacheException {
-AsyncEvent object = null;
-long currentKey = -1;
+
+  private Long getCurrentKey(){
+long currentKey;
 if (this.peekedIds.isEmpty()) {
-   currentKey = getHeadKey(); 
+  currentKey = getHeadKey();
 } else {
-   Long lastPeek = this.peekedIds.peekLast();
-   if (lastPeek == null) {
-   return null;
-   }
-   currentKey = lastPeek.longValue() + 1;
+  Long lastPeek = this.peekedIds.peekLast();
+  if (lastPeek == null) {
+return null;
+  }
+  currentKey = lastPeek.longValue() + 1;
+}
+return currentKey;
+  }
+
+  private AsyncEvent getObjectInSerialSenderQueue(Long currentKey) {
+AsyncEvent object = optimalGet(currentKey);
+if ((null != object) && logger.isDebugEnabled()) {
+  logger.debug("{}: Peeked {}->{}", this, currentKey, object);
+}
+if (object != null && object instanceof GatewaySenderEventImpl) {
+  GatewaySenderEventImpl copy = 
((GatewaySenderEventImpl)object).makeHeapCopyIfOffHeap();
+  if (copy == null) {
+logger.debug("Unable to make heap copy and will not be added to 
peekedIds for object" +
+ " : {} ",object.toString());
+  }
+  object = copy;
+}
+return object;
+  }
+
+  private AsyncEvent peekAhead() throws CacheException {
+AsyncEvent object = null;
+Long currentKey = getCurrentKey();
+if(currentKey == null ){
+  return null;
 }
 
 
@@ -788,12 +806,12 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
 // does not save anything since GatewayBatchOp needs to GatewayEventImpl
 // in object form.
 while (before(currentKey, getTailKey())
-// use optimalGet here to fix bug 40654
-&& (object = optimalGet(Long.valueOf(currentKey))) == null) {
+&& (null == (object = getObjectInSerialSenderQueue(currentKey {
   if (logger.isTraceEnabled()) {
 logger.trace("{}: Trying head key + offset: {}", this, currentKey);
   }
   currentKey = inc(currentKey);
+  object = getObjectInSerialSenderQueue(currentKey);
   if (this.stats != null) {
 this.stats.incEventsNotQueuedConflated();
   }
@@ -803,7 +821,7 @@ public class SerialGatewaySenderQueue implements 
RegionQueue {
   logger.debug("{}: Peeked {}->{}", this, currentKey, object);
 }
 if (object != null) {
-  this.peekedIds.add(Long.valueOf(currentKey));
+  this.peekedIds.add(currentKey);
 }
 return object;
   }


[incubator-geode] Git Push Summary

2016-10-07 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop2 [deleted] e78aa68c4


incubator-geode git commit: GEODE-136: Adding the Apache License header to the file.

2016-10-07 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop2 [created] e78aa68c4


GEODE-136: Adding the Apache License header to the file.

* This resolves the rat issue in precheckin


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

Branch: refs/heads/develop2
Commit: e78aa68c4890191f481a38452d7e238048bac7d7
Parents: 769d9b3
Author: nabarun 
Authored: Fri Oct 7 11:51:57 2016 -0700
Committer: nabarun 
Committed: Fri Oct 7 11:51:57 2016 -0700

--
 .../cli/functions/GetRegionsFunctionJUnitTest.java  | 16 
 1 file changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e78aa68c/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
index 6c57160..74a0268 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/GetRegionsFunctionJUnitTest.java
@@ -1,3 +1,19 @@
+/*
+ * 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.management.internal.cli.functions;
 
 import static org.mockito.Mockito.*;



incubator-geode git commit: GEODE-1731: Reordered the creation of test elements

2016-10-05 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 0e2b53bcb -> c454d3ab7


GEODE-1731: Reordered the creation of test elements

* The test now initiates the killing of second sender after it has 
received one batch.
* Reordered the creation of cache, region and finally the receivers and 
senders.


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

Branch: refs/heads/develop
Commit: c454d3ab7c24d771b1b222944c2518eea69ff1df
Parents: 0e2b53b
Author: nabarun 
Authored: Tue Oct 4 14:06:45 2016 -0700
Committer: nabarun 
Committed: Wed Oct 5 10:24:53 2016 -0700

--
 ...oncurrentParallelGatewaySenderDUnitTest.java | 40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c454d3ab/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
index 8adc68c..3451b51 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
@@ -586,7 +586,6 @@ public class ConcurrentParallelGatewaySenderDUnitTest 
extends WANTestBase {
 getTestMethodName(), 1000 ));
   }
   
-  @Category(FlakyTest.class) // GEODE-1731
   @Test
   public void testPartitionedParallelPropagationHA() throws Exception {
 IgnoredException.addIgnoredException(SocketException.class.getName()); // 
for Connection reset
@@ -594,10 +593,25 @@ public class ConcurrentParallelGatewaySenderDUnitTest 
extends WANTestBase {
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
 createCacheInVMs(nyPort, vm2, vm3);
+
+vm2.invoke(() -> WANTestBase.createPartitionedRegion(
+  getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
+vm3.invoke(() -> WANTestBase.createPartitionedRegion(
+  getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
+
 createReceiverInVMs(vm2, vm3);
 
 createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
+vm4.invoke(() -> WANTestBase.createPartitionedRegion(
+  getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
+vm5.invoke(() -> WANTestBase.createPartitionedRegion(
+  getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
+vm6.invoke(() -> WANTestBase.createPartitionedRegion(
+  getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
+vm7.invoke(() -> WANTestBase.createPartitionedRegion(
+  getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
+
 vm4.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
 true, 100, 10, false, false, null, true, 6, OrderPolicy.KEY ));
 vm5.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
@@ -606,33 +620,25 @@ public class ConcurrentParallelGatewaySenderDUnitTest 
extends WANTestBase {
 true, 100, 10, false, false, null, true, 6, OrderPolicy.KEY ));
 vm7.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
 true, 100, 10, false, false, null, true, 6, OrderPolicy.KEY ));
-
-vm4.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
-vm5.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
-vm6.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
-vm7.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 2, 100, isOffHeap() ));
 
 startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
-vm2.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
-vm3.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
-
 AsyncInvocation inv1 = vm7.invokeAsync(() -> WANTestBase.doPuts( 
getTestMethodName() + "_PR", 5000 ));
+
 vm2.invoke(() -> Awaitility.await().atMost(3, 
TimeUnit.MILLISECONDS).until(() ->
   assertEquals("Failure in waiting for at least 10 

[1/2] incubator-geode git commit: GEODE-1364: Resolved as a part of GEODE-1588

2016-10-04 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f82626f46 -> 18c2dc3fb


GEODE-1364: Resolved as a part of GEODE-1588


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

Branch: refs/heads/develop
Commit: 0b61ae69d8486c137a30160c22d8985c37f76324
Parents: f82626f
Author: nabarun 
Authored: Tue Oct 4 15:33:13 2016 -0700
Committer: nabarun 
Committed: Tue Oct 4 15:33:13 2016 -0700

--
 .../internal/cache/wan/serial/SerialWANPropagationDUnitTest.java| 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0b61ae69/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
index a3c5ee4..2b97d7a 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
@@ -968,7 +968,6 @@ public class SerialWANPropagationDUnitTest extends 
WANTestBase {
 vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + 
"_RR_1", 8000));
   }
 
-  @Category(FlakyTest.class) // GEODE-1364, 1478
   @Test
   public void testReplicatedSerialPropagationToTwoWanSites() throws Exception {
 Integer lnPort = createFirstLocatorWithDSId(1);



incubator-geode git commit: GEODE-1804: Refactored the test

2016-10-04 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f0dab0aa3 -> f82626f46


GEODE-1804: Refactored the test

* Refactored the test to have the correct order of creation of cache, 
region and sender-receivers.
* Additional validity check for the local region size.


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

Branch: refs/heads/develop
Commit: f82626f46babe0f5fcce8dafd5deab2ca6b86860
Parents: f0dab0a
Author: nabarun 
Authored: Tue Oct 4 15:26:45 2016 -0700
Committer: nabarun 
Committed: Tue Oct 4 15:26:45 2016 -0700

--
 .../serial/SerialWANPropagationDUnitTest.java   | 55 +++-
 1 file changed, 29 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f82626f4/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
index 52cd25f..a3c5ee4 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
@@ -527,7 +527,6 @@ public class SerialWANPropagationDUnitTest extends 
WANTestBase {
 getTestMethodName() + "_RR_1", 1000 ));
   }
 
-  @Category(FlakyTest.class) // GEODE-1804
   @Test
   public void testReplicatedSerialPropagationWithRemoteRegionDestroy3()
   throws Exception {
@@ -535,51 +534,52 @@ public class SerialWANPropagationDUnitTest extends 
WANTestBase {
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 // these are part of remote site
 createCacheInVMs(nyPort, vm2, vm3);
-createReceiverInVMs(vm2, vm3);
-
-// these are part of local site
-createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
-
-// senders are created on local site
-vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
-false, 100, 200, false, false, null, true ));
-vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
-false, 100, 200, false, false, null, true ));
 
 // create one RR (RR_1) on remote site
 vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", null, isOffHeap()  ));
+  getTestMethodName() + "_RR_1", null, isOffHeap()  ));
 vm3.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", null, isOffHeap()  ));
+  getTestMethodName() + "_RR_1", null, isOffHeap()  ));
 
 // create another RR (RR_2) on remote site
 vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_2", null, isOffHeap()  ));
+  getTestMethodName() + "_RR_2", null, isOffHeap()  ));
 vm3.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_2", null, isOffHeap()  ));
-
-// start the senders on local site
-startSenderInVMs("ln", vm4, vm5);
+  getTestMethodName() + "_RR_2", null, isOffHeap()  ));
+
+createReceiverInVMs(vm2, vm3);
+
+// these are part of local site
+createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
 // create one RR (RR_1) on local site
 vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
+  getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
 vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
+  getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
 vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
+  getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
 vm7.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
+  getTestMethodName() + "_RR_1", "ln", isOffHeap()  ));
 
 // create another RR (RR_2) on local site
 vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_2", "ln", isOffHeap()  ));
+  getTestMethodName() + "_RR_2", "ln", isOffHeap()  ));
 vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR_2", "ln", isOffHeap()  ));
+  getTestMethodName() + "_RR_2", "ln", isOffHeap() 

incubator-geode git commit: GEODE-1384: Stat issues were fixed as a part of other tickets.

2016-10-04 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 71627eb81 -> 15a5267c4


GEODE-1384: Stat issues were fixed as a part of other tickets.

* Code refactored to have the correct order of creation of cache, 
region and sender receivers.


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

Branch: refs/heads/develop
Commit: 15a5267c47852efbed14cb9b85614a1208145c33
Parents: 71627eb
Author: nabarun 
Authored: Tue Oct 4 15:11:30 2016 -0700
Committer: nabarun 
Committed: Tue Oct 4 15:13:37 2016 -0700

--
 .../wan/parallel/ParallelWANStatsDUnitTest.java | 27 ++--
 1 file changed, 19 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/15a5267c/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
index 4a68608..9d2f1a5 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.geode.internal.cache.wan.parallel;
 
+import com.jayway.awaitility.Awaitility;
 import org.junit.Ignore;
 import org.junit.experimental.categories.Category;
 import org.junit.Test;
@@ -32,6 +33,7 @@ import static org.apache.geode.test.dunit.IgnoredException.*;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 import org.junit.experimental.categories.Category;
 
@@ -224,31 +226,40 @@ public class ParallelWANStatsDUnitTest extends 
WANTestBase{
 vm3.invoke(() -> WANTestBase.checkGatewayReceiverStats(10, NUM_PUTS, 
NUM_PUTS ));
   }
   
-  @Category(FlakyTest.class) // GEODE-1384
   @Test
   public void testParallelPropagationHA() throws Exception {
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
 createCacheInVMs(nyPort, vm2);
-createReceiverInVMs(vm2);
 
-createSenders(lnPort);
-
 createReceiverPR(vm2, 0);
-
+
+createReceiverInVMs(vm2);
+
+createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
+
 createSenderPRs(3);
 
+vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+  true, 100, 10, true, false, null, true ));
+vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+  true, 100, 10, true, false, null, true ));
+vm6.invoke(() -> WANTestBase.createSender( "ln", 2,
+  true, 100, 10, true, false, null, true ));
+vm7.invoke(() -> WANTestBase.createSender( "ln", 2,
+  true, 100, 10, true, false, null, true ));
+
 startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
 AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts( testName, 
1000 ));
-pause(200);
+vm2.invoke(() -> Awaitility.await().atMost(3, 
TimeUnit.MILLISECONDS).until(() ->
+  assertEquals("Waiting for first batch to be 
received",true,getRegionSize(testName) > 10)));
 AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender());
 inv1.join();
 inv2.join();
 
-vm2.invoke(() -> WANTestBase.validateRegionSize(
-testName, 1000 ));
+vm2.invoke(() -> WANTestBase.validateRegionSize(testName, 1000 ));
 
 ArrayList v5List = (ArrayList)vm5.invoke(() -> 
WANTestBase.getSenderStats( "ln", 0));
 ArrayList v6List = (ArrayList)vm6.invoke(() -> 
WANTestBase.getSenderStats( "ln", 0));



incubator-geode git commit: GEODE-1925 : Copy the resources directory inside build directory

2016-09-21 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop c4e63ac0d -> 813fa909c


GEODE-1925 : Copy the resources directory inside build directory

* Tests use the resources folder for its execution, hence it needs to 
be in the build directory.
* This was initially handled by gradle, but caused issues when test 
catagory tags were changed.
* This action is now handled by the test code.


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

Branch: refs/heads/develop
Commit: 813fa909c19247f0999fa719d0e5d0e8f04593ca
Parents: c4e63ac
Author: nabarun 
Authored: Wed Sep 21 14:44:04 2016 -0700
Committer: nabarun 
Committed: Wed Sep 21 14:44:04 2016 -0700

--
 extensions/geode-modules-tomcat7/build.gradle   | 9 -
 .../geode/modules/session/catalina/DeltaSession7.java   | 5 +++--
 extensions/geode-modules-tomcat8/build.gradle   | 8 
 extensions/geode-modules/build.gradle   | 9 -
 .../org/apache/geode/modules/session/EmbeddedTomcat.java| 2 +-
 .../org/apache/geode/modules/session/TestSessionsBase.java  | 3 +++
 6 files changed, 7 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/813fa909/extensions/geode-modules-tomcat7/build.gradle
--
diff --git a/extensions/geode-modules-tomcat7/build.gradle 
b/extensions/geode-modules-tomcat7/build.gradle
index 3c75e56..185bafd 100644
--- a/extensions/geode-modules-tomcat7/build.gradle
+++ b/extensions/geode-modules-tomcat7/build.gradle
@@ -15,15 +15,6 @@
  * limitations under the License.
  */
 
-test  {
-  doFirst {
-copy {
-  from 'build/resources/test/tomcat'
-  into 'build/test/tomcat/'
-}
-  }
-}
-
 dependencies {
   compile(project(':extensions/geode-modules')) {
 // Remove everything related to Tomcat 6.x

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/813fa909/extensions/geode-modules-tomcat7/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession7.java
--
diff --git 
a/extensions/geode-modules-tomcat7/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession7.java
 
b/extensions/geode-modules-tomcat7/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession7.java
index c9be3fe..0df05ff 100644
--- 
a/extensions/geode-modules-tomcat7/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession7.java
+++ 
b/extensions/geode-modules-tomcat7/src/main/java/org/apache/geode/modules/session/catalina/DeltaSession7.java
@@ -527,14 +527,15 @@ public class DeltaSession7 extends StandardSession 
implements DataSerializable,
 
 // Initialize the transients if necessary
 if (this.listeners == null) {
-  this.listeners = new ArrayList();
+  this.listeners = new ArrayList<>();
 }
 
 if (this.notes == null) {
-  this.notes = new Hashtable();
+  this.notes = new Hashtable<>();
 }
   }
 
+  @SuppressWarnings({"unchecked", "rawtypes"})
   protected ConcurrentMap readInAttributes(final DataInput in) throws 
IOException, ClassNotFoundException {
 return DataSerializer.readObject(in);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/813fa909/extensions/geode-modules-tomcat8/build.gradle
--
diff --git a/extensions/geode-modules-tomcat8/build.gradle 
b/extensions/geode-modules-tomcat8/build.gradle
index dfa86cf..df36ab3 100644
--- a/extensions/geode-modules-tomcat8/build.gradle
+++ b/extensions/geode-modules-tomcat8/build.gradle
@@ -15,14 +15,6 @@
  * limitations under the License.
  */
 
-test  {
-  doFirst {
-copy {
-  from 'build/resources/test/tomcat'
-  into 'build/test/tomcat/'
-}
-  }
-}
 
 dependencies {
   compile(project(':extensions/geode-modules')) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/813fa909/extensions/geode-modules/build.gradle
--
diff --git a/extensions/geode-modules/build.gradle 
b/extensions/geode-modules/build.gradle
index 81a926c..0ac8c9a 100644
--- a/extensions/geode-modules/build.gradle
+++ b/extensions/geode-modules/build.gradle
@@ -15,15 +15,6 @@
  * limitations under the License.
  */
 
-test  {
-  doFirst {
-copy {
-  from 'build/resources/test/tomcat'
-  into 'build/test/tomcat/'
-}
-  }
-}
-
 dependencies {
   compile project(':geode-core')
   


incubator-geode git commit: GEODE-1644: Check if key is an instance of Object[]

2016-09-14 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 9fbad68e5 -> 6a109a7f5


GEODE-1644: Check if key is an instance of Object[]

* Checking if the key is of the type object array
* This fixes the issue with forming the correct index name.


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

Branch: refs/heads/develop
Commit: 6a109a7f57a5402af458d593d93c2e328bd3281b
Parents: 9fbad68
Author: nabarun 
Authored: Wed Sep 14 10:08:29 2016 -0700
Committer: nabarun 
Committed: Wed Sep 14 10:08:29 2016 -0700

--
 .../gemfire/cache/query/internal/IndexTrackingQueryObserver.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6a109a7f/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/IndexTrackingQueryObserver.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/IndexTrackingQueryObserver.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/IndexTrackingQueryObserver.java
index e92e7ca..a8ab178 100644
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/IndexTrackingQueryObserver.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/IndexTrackingQueryObserver.java
@@ -55,7 +55,7 @@ public class IndexTrackingQueryObserver extends 
QueryObserverAdapter {
 String indexName;
 //Dont create new IndexInfo if one is already there in map for aggregation
 //of results later for whole partition region on this node.
-if(index instanceof MapRangeIndex || index instanceof 
CompactMapRangeIndex){
+if((index instanceof MapRangeIndex || index instanceof 
CompactMapRangeIndex) && key instanceof Object[]){
   indexName = index.getName()+ "-"+((Object[])key)[1];
 } else {
   indexName = index.getName();



incubator-geode git commit: GEODE-1066: Removing the FlakyTest tag

2016-08-22 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop b39ab8915 -> 9fa589708


GEODE-1066: Removing the FlakyTest tag

* Removed the FlakyTest tag
* Code was s1tabilized in a previous commit for GEODE-1066


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

Branch: refs/heads/develop
Commit: 9fa589708c03754c85e7d10e353fbe47294673db
Parents: b39ab89
Author: nabarun 
Authored: Mon Aug 22 13:59:42 2016 -0700
Committer: nabarun 
Committed: Mon Aug 22 14:01:00 2016 -0700

--
 .../cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9fa58970/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
index a6a68e3..8c255c1 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
@@ -164,7 +164,6 @@ public class SerialGatewaySenderEventListenerDUnitTest 
extends WANTestBase {
* Test validates whether the listener attached receives all the events. 
* When there are 2 listeners attached to the GatewaySender.
*/
-  @Category(FlakyTest.class) // GEODE-1066: random ports, waitForCriterion, 
time sensitive
   @Test
   public void testGatewaySender2EventListenerInvocation() {
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));



incubator-geode git commit: GEODE-1066: Replaced WaitCriterion with Awaitility

2016-08-15 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f8f8986f3 -> a1d2fa2bd


GEODE-1066: Replaced WaitCriterion with Awaitility

* Awaitility is used
* Correct order of creation of caches/regions/senders/recievers


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

Branch: refs/heads/develop
Commit: a1d2fa2bdc3c74946d37025455acb9516a9b6535
Parents: f8f8986
Author: nabarun 
Authored: Mon Aug 8 12:00:22 2016 -0700
Committer: nabarun 
Committed: Mon Aug 15 14:15:23 2016 -0700

--
 ...rialGatewaySenderEventListenerDUnitTest.java | 66 +---
 1 file changed, 28 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a1d2fa2b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
index 56d2bcc..a6a68e3 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
@@ -16,20 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.serial;
 
+import com.jayway.awaitility.Awaitility;
 import org.junit.Ignore;
 import org.junit.experimental.categories.Category;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
 
-import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 import org.junit.experimental.categories.Category;
 
@@ -171,6 +171,12 @@ public class SerialGatewaySenderEventListenerDUnitTest 
extends WANTestBase {
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
 createCacheInVMs(nyPort, vm2, vm3);
+
+vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", null, isOffHeap() ));
+vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", null, isOffHeap() ));
+
 createReceiverInVMs(vm2, vm3);
 
 createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
@@ -180,21 +186,12 @@ public class SerialGatewaySenderEventListenerDUnitTest 
extends WANTestBase {
 vm5.invoke(() -> WANTestBase.createSenderWithListener( "ln", 2,
 false, 100, 10, false, false, null, true, true));
 
-vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", null, isOffHeap() ));
-vm3.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", null, isOffHeap() ));
-
 startSenderInVMs("ln", vm4, vm5);
 
 vm4.invoke(() -> WANTestBase.createReplicatedRegion(
 getTestMethodName() + "_RR", "ln", isOffHeap() ));
 vm5.invoke(() -> WANTestBase.createReplicatedRegion(
 getTestMethodName() + "_RR", "ln", isOffHeap() ));
-vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", "ln", isOffHeap() ));
-vm7.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", "ln", isOffHeap() ));
 
 final Map keyValues = new HashMap();
 for(int i=0; i< 1000; i++) {
@@ -359,35 +356,28 @@ public class SerialGatewaySenderEventListenerDUnitTest 
extends WANTestBase {
 if(listeners.size() == 2) {
   final AsyncEventListener l1 = listeners.get(0);
   final AsyncEventListener l2 = listeners.get(1);
-
-  WaitCriterion wc = new WaitCriterion() {
-Map listenerMap1, listenerMap2;
-public boolean done() {
-  listenerMap1 = ((MyGatewaySenderEventListener)l1)
-  .getEventsMap();
-  
-  listenerMap2 = ((MyGatewaySenderEventListener2)l2)
+  Awaitility.await().atMost(6, TimeUnit.MILLISECONDS).until(()->{
+Map listenerMap1 = ((MyGatewaySenderEventListener)l1)
   .getEventsMap();
-  
-  boolean sizeCorrect = map.size() == listenerMap1.size();
-  boolean keySetCorrect = 

incubator-geode git commit: GEODE-1745: Fixed the comparison during query re-evaluation using CompactMapRangeIndexes

2016-08-15 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 6f37769cd -> f8f8986f3


GEODE-1745: Fixed the comparison during query re-evaluation using 
CompactMapRangeIndexes

* Initially the object to be searched was compared with the tuple 
returned by the Compact Range Index which contains the object to be searched 
and a key
* This led to mismatch to occur resulting in false query results.
* Fixed to compare with the first element of the tuple returned by the 
compact range index.


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

Branch: refs/heads/develop
Commit: f8f8986f39616114a97e7e7b9bad3af712e52f1f
Parents: 6f37769
Author: nabarun 
Authored: Wed Aug 10 14:15:29 2016 -0700
Committer: nabarun 
Committed: Mon Aug 15 14:11:55 2016 -0700

--
 .../gemfire/cache/query/internal/index/CompactRangeIndex.java | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f8f8986f/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndex.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndex.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndex.java
index d0a0ee5..ecfafb1 100644
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndex.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/CompactRangeIndex.java
@@ -984,6 +984,9 @@ public class CompactRangeIndex extends AbstractIndex {
 
 if (key != null) {
   right = key.evaluate(context);
+  if(null != right  && indexInfo._getIndex() instanceof 
CompactMapRangeIndex){
+right = ((Object[])right)[0];
+  }
 } else {
   right = keyVal;
 }



[6/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java
new file mode 100644
index 000..3ae9a01
--- /dev/null
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java
@@ -0,0 +1,1063 @@
+/*
+ * 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 com.gemstone.gemfire.internal.cache.wan.misc;
+
+import org.junit.Ignore;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+import com.gemstone.gemfire.cache.CacheClosedException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.internal.cache.ForceReattemptException;
+import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+
+@Category(DistributedTest.class)
+public class ReplicatedRegion_ParallelWANPropagationDUnitTest extends 
WANTestBase{
+
+  public ReplicatedRegion_ParallelWANPropagationDUnitTest() {
+super();
+// TODO Auto-generated constructor stub
+  }
+
+  final String expectedExceptions = null;
+  
+  
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 1L;
+
+  @Test
+  public void test_DR_PGS_1Nodes_Put_Receiver() throws Exception {
+try {
+  Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
+  Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+
+  createCacheInVMs(nyPort, vm2);
+  vm2.invoke(() -> WANTestBase.createReceiver());
+  vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", null, isOffHeap() ));
+
+  createCacheInVMs(lnPort, vm4);
+
+  vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", "ln1", isOffHeap() ));
+
+  vm4.invoke(() -> WANTestBase.createSender( "ln1", 2,
+  true, 10, 100, false, false, null, true ));
+
+  vm4.invoke(() -> WANTestBase.startSender( "ln1" ));
+  fail("Expected GatewaySenderConfigException where parallel gateway 
sender can not be used with replicated region");
+}
+catch (Exception e) {
+  if (!e.getCause().getMessage()
+  .contains("can not be used with replicated region")) {
+fail("Expected GatewaySenderConfigException where parallel gateway 
sender can not be used with replicated region");
+  }
+}
+  }
+  
+  /*1. Validate that parallelGatewaySenderId can be added to distributed region
+   *Region distributed ack/noack + PGS
+   *1. Find out the restrictions on totalNumBuckets on shadowPR
+   *2. Find out the restrictions on redundancy on shadowPR
+   *3. Find out the restrictions on localMaxMemory on shadowPR
+   *4. Find out the best way user will specify PR attributes to PGS
+   *5. Find out the restrictions on ordering.
+   *6. put on region populates the queue
+   *7. put on region reaches to remote site. Dispatcher works as expected
+   *8. m1 and m2 has DR(ack/noack). put on DR from m1 populates queue on both 
m1 and m2. Validate that remote site got all the events
+   *9. m1 and m2 has DR(ack/noack). create/put/destroy/operations populates 
the queue. Validate that remote site got correct events
+   *10. m1 and m2 has DR(ack/noack). localDestroy is called on m1's DR. This 
locally destroys M1's shadowPr
+   *11. m1 and m2 has 

[2/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java
new file mode 100644
index 000..f3b6765
--- /dev/null
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java
@@ -0,0 +1,338 @@
+/*
+ * 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 com.gemstone.gemfire.internal.cache.wan.serial;
+
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
+
+
+@Category(DistributedTest.class)
+public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase{
+
+  private static final long serialVersionUID = 1L;
+
+  public SerialWANPropagationsFeatureDUnitTest() {
+super();
+  }
+
+  @Test
+  public void testSerialReplicatedWanWithOverflow() {
+
+Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
+Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+
+createCacheInVMs(nyPort, vm2, vm3);
+createReceiverInVMs(vm2, vm3);
+
+createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
+
+vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 10, 10, false, false, null, true ));
+vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 10, 10, false, false, null, true ));
+
+vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap()  ));
+vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap()  ));
+
+startSenderInVMs("ln", vm4, vm5);
+vm2.invoke(() -> addListenerToSleepAfterCreateEvent(1000, 
getTestMethodName() + "_RR"));
+vm3.invoke(() -> addListenerToSleepAfterCreateEvent(1000, 
getTestMethodName() + "_RR"));
+
+vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap()  ));
+vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap()  ));
+vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap()  ));
+vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap()  ));
+
+vm4.invoke(() -> WANTestBase.doHeavyPuts(
+getTestMethodName() + "_RR", 15 ));
+
+vm2.invoke(() -> WANTestBase.validateRegionSize(
+getTestMethodName() + "_RR", 15, 24 ));
+vm3.invoke(() -> WANTestBase.validateRegionSize(
+getTestMethodName() + "_RR", 15, 24 ));
+  }
+
+  @Test
+  public void testSerialReplicatedWanWithPersistence() {
+
+Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
+Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+
+createCacheInVMs(nyPort, vm2, vm3);
+createReceiverInVMs(vm2, vm3);
+
+createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
+
+vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 100, 10, false, true, null, true ));
+vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 100, 10, false, true, null, true ));
+
+vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap()  ));
+vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap()  ));
+
+startSenderInVMs("ln", vm4, vm5);
+
+ 

[3/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
new file mode 100644
index 000..0cb60be
--- /dev/null
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
@@ -0,0 +1,1336 @@
+/*
+ * 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 com.gemstone.gemfire.internal.cache.wan.serial;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.EntryExistsException;
+import com.gemstone.gemfire.cache.client.ServerOperationException;
+import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.cache.wan.BatchException70;
+import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.FlakyTest;
+
+@Category(DistributedTest.class)
+public class SerialWANPropagationDUnitTest extends WANTestBase {
+
+  @Override
+  public final void postSetUpWANTestBase() throws Exception {
+IgnoredException.addIgnoredException("Connection reset");
+IgnoredException.addIgnoredException("Broken pipe");
+IgnoredException.addIgnoredException("Connection refused");
+IgnoredException.addIgnoredException("could not get remote locator 
information");
+IgnoredException.addIgnoredException("Unexpected IOException");
+  }
+
+  /**
+   * this test is disabled due to a high rate of failure in unit test runs
+   * see ticket #52190
+   */
+  @Ignore("TODO: test is disabled because of #52190")
+  @Test
+  public void testReplicatedSerialPropagation_withoutRemoteLocator() throws 
Exception {
+Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
+
+createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
+
+//keep the batch size high enough to reduce the number of exceptions in 
the log
+vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 100, 400, false, false, null, true ));
+vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 100, 400, false, false, null, true ));
+
+startSenderInVMs("ln", vm4, vm5);
+
+vm4.invoke(createReplicatedRegionRunnable());
+vm5.invoke(createReplicatedRegionRunnable());
+vm6.invoke(createReplicatedRegionRunnable());
+vm7.invoke(createReplicatedRegionRunnable());
+
+vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR",
+  1000 ));
+
+Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+
+createCacheInVMs(nyPort, vm2, vm3);
+
+vm2.invoke(() -> WANTestBase.createReceiver());
+vm3.invoke(() -> WANTestBase.createReceiver());
+
+vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap()  ));
+vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap()  ));
+
+vm4.invoke(() -> WANTestBase.validateRegionSize(
+getTestMethodName() + "_RR", 1000 ));
+
+vm2.invoke(() -> WANTestBase.validateRegionSize(
+getTestMethodName() + "_RR", 1000 ));
+vm3.invoke(() -> WANTestBase.validateRegionSize(
+getTestMethodName() + "_RR", 1000 ));
+  }
+
+  

[7/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java
new file mode 100644
index 000..cfe4169
--- /dev/null
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java
@@ -0,0 +1,448 @@
+/*
+ * 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 com.gemstone.gemfire.internal.cache.wan.concurrent;
+
+import org.junit.Ignore;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.wan.GatewaySender.OrderPolicy;
+import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.junit.categories.FlakyTest;
+
+/**
+ * All the test cases are similar to SerialWANPropagationDUnitTest except that
+ * the we create concurrent serial GatewaySender with concurrency of 4
+ */
+@Category(DistributedTest.class)
+public class ConcurrentWANPropagation_2_DUnitTest extends WANTestBase {
+
+  public ConcurrentWANPropagation_2_DUnitTest() {
+super();
+  }
+
+  private static final long serialVersionUID = 1L;
+
+  @Test
+  public void testSerialReplicatedWanWithOverflow() {
+
+Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
+Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
+
+createCacheInVMs(nyPort, vm2, vm3);
+createReceiverInVMs(vm2, vm3);
+
+createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
+
+//keep the maxQueueMemory low enough to trigger eviction
+vm4.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
+false, 10, 5, false, false, null, true, 5, OrderPolicy.KEY ));
+vm5.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
+false, 10, 5, false, false, null, true, 5, OrderPolicy.KEY ));
+
+vm2.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap() ));
+vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", null, isOffHeap() ));
+
+startSenderInVMs("ln", vm4, vm5);
+vm2.invoke(() -> addListenerToSleepAfterCreateEvent(1000, 
getTestMethodName() + "_RR"));
+vm3.invoke(() -> addListenerToSleepAfterCreateEvent(1000, 
getTestMethodName() + "_RR"));
+
+vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap() ));
+vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap() ));
+vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap() ));
+vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+getTestMethodName() + "_RR", "ln", isOffHeap() ));
+
+vm4.invoke(() -> WANTestBase.doHeavyPuts(
+getTestMethodName() + "_RR", 15 ));
+
+vm2.invoke(() -> WANTestBase.validateRegionSize(
+getTestMethodName() + "_RR", 15, 24));
+vm3.invoke(() -> WANTestBase.validateRegionSize(
+getTestMethodName() + "_RR", 15, 24 ));
+  }
+
+  @Ignore("Bug46921")
+  @Test
+  public void testSerialReplicatedWanWithPersistence() {
+
+Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
+Integer nyPort = (Integer)vm1.invoke(() -> 

[8/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
GEODE-1241: Fixed the misspelt names in Geode WAN module

* CamelCased few names which were not camelCased
* Spelling errors were fixed.
* Improvements are still required in variable names - using meaningful 
names.


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

Branch: refs/heads/develop
Commit: 6f37769cd9311df39bdf0d8f4809c425f2865fe8
Parents: 80f8a14
Author: nabarun 
Authored: Wed Aug 3 11:25:54 2016 -0700
Committer: nabarun 
Committed: Mon Aug 15 14:08:46 2016 -0700

--
 .../gemfire/internal/i18n/LocalizedStrings.java |2 +-
 .../AsyncEventQueueStatsDUnitTest.java  |2 +-
 .../client/internal/GatewaySenderBatchOp.java   |   10 +-
 .../internal/locator/wan/LocatorDiscovery.java  |   16 +-
 .../internal/locator/wan/LocatorHelper.java |4 +-
 .../locator/wan/WanLocatorDiscovererImpl.java   |6 +-
 .../wan/GatewaySenderEventRemoteDispatcher.java |2 +-
 .../cache/wan/GatewaySenderFactoryImpl.java |2 +-
 .../wan/parallel/ParallelGatewaySenderImpl.java |2 +-
 ...RemoteSerialGatewaySenderEventProcessor.java |6 +-
 .../cache/CacheXml70GatewayDUnitTest.java   |   32 +-
 .../cache/CacheXml80GatewayDUnitTest.java   |8 +-
 .../internal/cache/UpdateVersionDUnitTest.java  |   20 +-
 .../cache/wan/CacheClientNotifierDUnitTest.java |4 +-
 .../gemfire/internal/cache/wan/WANTestBase.java |   72 +-
 ...oncurrentParallelGatewaySenderDUnitTest.java |8 +-
 ...allelGatewaySenderOperation_2_DUnitTest.java |   10 +-
 .../ConcurrentWANPropagation_1_DUnitTest.java   |  568 
 .../ConcurrentWANPropagation_2_DUnitTest.java   |  448 ++
 .../ConcurrentWANPropogation_1_DUnitTest.java   |  568 
 .../ConcurrentWANPropogation_2_DUnitTest.java   |  448 --
 .../CommonParallelGatewaySenderDUnitTest.java   |8 +-
 ...wWANConcurrencyCheckForDestroyDUnitTest.java |4 +-
 .../cache/wan/misc/PDXNewWanDUnitTest.java  |2 +-
 ...dRegion_ParallelWANPersistenceDUnitTest.java |   16 +-
 ...dRegion_ParallelWANPropagationDUnitTest.java | 1063 ++
 ...dRegion_ParallelWANPropogationDUnitTest.java | 1065 --
 .../SenderWithTransportFilterDUnitTest.java |   20 +-
 ...downAllPersistentGatewaySenderDUnitTest.java |   14 +-
 .../wan/misc/WANConfigurationJUnitTest.java |  109 +-
 .../wan/misc/WANLocatorServerDUnitTest.java |2 +-
 .../wan/misc/WanAutoDiscoveryDUnitTest.java |6 +-
 .../cache/wan/misc/WanValidationsDUnitTest.java |   96 +-
 ...ropagationConcurrentOpsOffHeapDUnitTest.java |   44 +
 .../ParallelWANPropagationOffHeapDUnitTest.java |   43 +
 ...ropogationConcurrentOpsOffHeapDUnitTest.java |   44 -
 .../ParallelWANPropogationOffHeapDUnitTest.java |   43 -
 .../SerialWANPropagationOffHeapDUnitTest.java   |   38 +
 ...ation_PartitionedRegionOffHeapDUnitTest.java |   39 +
 .../SerialWANPropogationOffHeapDUnitTest.java   |   43 -
 ...ation_PartitionedRegionOffHeapDUnitTest.java |   43 -
 ...llelGatewaySenderQueueOverflowDUnitTest.java |   24 +-
 .../ParallelWANConflationDUnitTest.java |4 +-
 ...ersistenceEnabledGatewaySenderDUnitTest.java |   12 +-
 ...lelWANPropagationConcurrentOpsDUnitTest.java |4 +-
 .../ParallelWANPropagationDUnitTest.java|2 +-
 .../wan/parallel/ParallelWANStatsDUnitTest.java |6 +-
 ...tewaySenderDistributedDeadlockDUnitTest.java |   12 +-
 ...rialGatewaySenderEventListenerDUnitTest.java |4 +-
 .../SerialGatewaySenderOperationsDUnitTest.java |   10 +-
 .../SerialGatewaySenderQueueDUnitTest.java  |   26 +-
 ...ersistenceEnabledGatewaySenderDUnitTest.java |   14 +-
 .../serial/SerialWANPropagationDUnitTest.java   | 1336 ++
 .../SerialWANPropagationLoopBackDUnitTest.java  |8 +-
 ...NPropagation_PartitionedRegionDUnitTest.java |  412 ++
 .../SerialWANPropagationsFeatureDUnitTest.java  |  338 +
 .../serial/SerialWANPropogationDUnitTest.java   | 1336 --
 ...NPropogation_PartitionedRegionDUnitTest.java |  412 --
 .../SerialWANPropogationsFeatureDUnitTest.java  |  338 -
 .../wan/serial/SerialWANStatsDUnitTest.java |   10 +-
 .../wan/wancommand/WANCommandTestBase.java  |   30 +-
 .../wan/wancommand/WanCommandListDUnitTest.java |   12 +-
 .../wancommand/WanCommandStatusDUnitTest.java   |6 +-
 .../management/WANManagementDUnitTest.java  |4 +-
 .../ClusterConfigurationDUnitTest.java  |6 +-
 .../pulse/TestRemoteClusterDUnitTest.java   |4 +-
 66 files changed, 4663 insertions(+), 4687 deletions(-)
--



[4/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationOffHeapDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationOffHeapDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationOffHeapDUnitTest.java
new file mode 100644
index 000..b08b5c2
--- /dev/null
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationOffHeapDUnitTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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 com.gemstone.gemfire.internal.cache.wan.offheap;
+
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+import 
com.gemstone.gemfire.internal.cache.wan.parallel.ParallelWANPropagationDUnitTest;
+
+@SuppressWarnings("serial")
+@Category(DistributedTest.class)
+public class ParallelWANPropagationOffHeapDUnitTest extends 
ParallelWANPropagationDUnitTest {
+
+  public ParallelWANPropagationOffHeapDUnitTest() {
+super();
+  }
+
+  @Override
+  public boolean isOffHeap() {
+return true;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropogationConcurrentOpsOffHeapDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropogationConcurrentOpsOffHeapDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropogationConcurrentOpsOffHeapDUnitTest.java
deleted file mode 100644
index aa74fa8..000
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropogationConcurrentOpsOffHeapDUnitTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.internal.cache.wan.offheap;
-
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
-import 
com.gemstone.gemfire.internal.cache.wan.parallel.ParallelWANPropagationConcurrentOpsDUnitTest;
-
-@SuppressWarnings("serial")
-@Category(DistributedTest.class)
-public class ParallelWANPropogationConcurrentOpsOffHeapDUnitTest extends
-ParallelWANPropagationConcurrentOpsDUnitTest {
-
-  public ParallelWANPropogationConcurrentOpsOffHeapDUnitTest() {
-super();
-  }
-
-  @Override
-  public boolean isOffHeap() {
-return true;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropogationOffHeapDUnitTest.java

[1/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 80f8a1408 -> 6f37769cd


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
deleted file mode 100644
index c51c992..000
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.internal.cache.wan.serial;
-
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.CancelException;
-import com.gemstone.gemfire.cache.CacheClosedException;
-import com.gemstone.gemfire.internal.cache.ForceReattemptException;
-import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-
-@Category(DistributedTest.class)
-public class SerialWANPropogation_PartitionedRegionDUnitTest extends 
WANTestBase {
-
-  private static final long serialVersionUID = 1L;
-
-  public SerialWANPropogation_PartitionedRegionDUnitTest() {
-super();
-  }
-
-  @Test
-  public void testPartitionedSerialPropagation() throws Exception {
-
-Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
-Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
-
-createCacheInVMs(nyPort, vm2, vm3);
-createReceiverInVMs(vm2, vm3);
-
-createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
-
-vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
-false, 100, 10, false, false, null, true ));
-vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
-false, 100, 10, false, false, null, true ));
-
-vm4.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
-vm5.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
-vm6.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
-vm7.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
-
-vm4.invoke(() -> WANTestBase.startSender( "ln" ));
-//vm5.invoke(() -> WANTestBase.startSender( "ln" ));
-
-vm2.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
-vm3.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
-
-vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_PR",
-1000 ));
-
-vm2.invoke(() -> WANTestBase.validateRegionSize(
-getTestMethodName() + "_PR", 1000 ));
-  }
-
-  @Test
-  public void testBothReplicatedAndPartitionedSerialPropagation()
-  throws Exception {
-
-Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
-Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
-
-createCacheInVMs(nyPort, vm2, vm3);
-createReceiverInVMs(vm2, vm3);
-
-createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
-
-vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
-false, 100, 

[5/8] incubator-geode git commit: GEODE-1241: Fixed the misspelt names in Geode WAN module

2016-08-15 Thread nnag
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
deleted file mode 100644
index afa03d5..000
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java
+++ /dev/null
@@ -1,1065 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.internal.cache.wan.misc;
-
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
-import com.gemstone.gemfire.cache.CacheClosedException;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.internal.cache.ForceReattemptException;
-import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
-import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.test.dunit.Wait;
-
-@Category(DistributedTest.class)
-public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends 
WANTestBase{
-
-  public ReplicatedRegion_ParallelWANPropogationDUnitTest() {
-super();
-// TODO Auto-generated constructor stub
-  }
-
-  final String expectedExceptions = null;
-  
-  
-  /**
-   * 
-   */
-  private static final long serialVersionUID = 1L;
-
-  @Test
-  public void test_DR_PGS_1Nodes_Put_Receiver() throws Exception {
-try {
-  Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
-  Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
-
-  createCacheInVMs(nyPort, vm2);
-  vm2.invoke(() -> WANTestBase.createReceiver());
-  vm2.invoke(() -> WANTestBase.createReplicatedRegion(
-  getTestMethodName() + "_RR", null, isOffHeap() ));
-
-  createCacheInVMs(lnPort, vm4);
-
-  vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-  getTestMethodName() + "_RR", "ln1", isOffHeap() ));
-
-  vm4.invoke(() -> WANTestBase.createSender( "ln1", 2,
-  true, 10, 100, false, false, null, true ));
-
-  vm4.invoke(() -> WANTestBase.startSender( "ln1" ));
-  fail("Expected GatewaySenderConfigException where parallel gateway 
sender can not be used with replicated region");
-}
-catch (Exception e) {
-  if (!e.getCause().getMessage()
-  .contains("can not be used with replicated region")) {
-fail("Expected GatewaySenderConfigException where parallel gateway 
sender can not be used with replicated region");
-  }
-}
-  }
-  
-  /*1. Validate that parallelGAtewaySenderId can be added to distributed region
-   *Region distributed ack/noack + PGS
-   *1. Find out the restrictions on totalNumBuckets on shadowPR
-   *2. Find out the restrictions on redundancy on shadowPR
-   *3. Find out the restrictions on localMaxMemory on shadowPR
-   *4. Find out the best way user will specify PR attributes to PGS
-   *5. Find out the restrictions on ordering.
-   *6. put on region populates the queue
-   *7. put on region reaches to remote site. Dispatcher works as expected
-   *8. m1 and m2 has DR(ack/noack). put on DR from m1 populates queue on both 
m1 and m2. Validate that remote site got all the events
-   *9. m1 and m2 has DR(ack/noack). create/put/destroy/operations populates 
the queue. Validate that remote site 

incubator-geode git commit: GEODE-977: Stats are being read from the correct VMs.

2016-08-03 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop c685299d5 -> 6ec789e84


GEODE-977: Stats are being read from the correct VMs.

* VM4 was missed while reading the stats
* Corrected the order of creating cache, region and senders/receivers.
* Stats code has been modified in previous commits and now being 
assumed to be stable.
* Flaky tag has been removed until the failures start reappearing.


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

Branch: refs/heads/develop
Commit: 6ec789e846e7c8585ea1e01fff335c64a4b8a067
Parents: c685299
Author: nabarun 
Authored: Wed Aug 3 13:18:35 2016 -0700
Committer: nabarun 
Committed: Wed Aug 3 13:18:35 2016 -0700

--
 .../wan/parallel/ParallelWANStatsDUnitTest.java   | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6ec789e8/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
index 16a5d92..1f855c1 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
@@ -273,7 +273,6 @@ public class ParallelWANStatsDUnitTest extends WANTestBase{
* 
* @throws Exception
*/
-  @Category(FlakyTest.class) // GEODE-977: random ports, time sensitive, 
waitForCriterion
   @Test
   public void testParallePropagationWithRemoteRegionDestroy() throws Exception 
{
 addIgnoredException("RegionDestroyedException");
@@ -281,12 +280,11 @@ public class ParallelWANStatsDUnitTest extends 
WANTestBase{
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
 createCacheInVMs(nyPort, vm2);
+createReceiverPR(vm2, 0);
 createReceiverInVMs(vm2);
 
 createSenders(lnPort);
 
-createReceiverPR(vm2, 0);
-
 vm2.invoke(() -> WANTestBase.addCacheListenerAndDestroyRegion(
 testName));
 
@@ -301,7 +299,7 @@ public class ParallelWANStatsDUnitTest extends WANTestBase{
 vm4.invoke(() -> WANTestBase.validateRegionSize(
 testName, 2000 ));
 
-ArrayList v4List = (ArrayList)vm5.invoke(() -> 
WANTestBase.getSenderStats( "ln", -1));
+ArrayList v4List = (ArrayList)vm4.invoke(() -> 
WANTestBase.getSenderStats( "ln", -1));
 ArrayList v5List = (ArrayList)vm5.invoke(() -> 
WANTestBase.getSenderStats( "ln", -1));
 ArrayList v6List = (ArrayList)vm6.invoke(() -> 
WANTestBase.getSenderStats( "ln", -1));
 ArrayList v7List = (ArrayList)vm7.invoke(() -> 
WANTestBase.getSenderStats( "ln", -1));
@@ -311,7 +309,6 @@ public class ParallelWANStatsDUnitTest extends WANTestBase{
 assertTrue(v4List.get(5) + v5List.get(5) + v6List.get(5) + v7List.get(5) 
>= 1); //batches redistributed
   }
 
-  @Category(FlakyTest.class) // GEODE-977: random ports and relies on stats
   @Test
   public void testParallelPropogationWithFilter() throws Exception {
 
@@ -319,10 +316,15 @@ public class ParallelWANStatsDUnitTest extends 
WANTestBase{
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator(2,lnPort ));
 
 createCacheInVMs(nyPort, vm2);
+
+createReceiverPR(vm2, 1);
+
 createReceiverInVMs(vm2);
 
 createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
+createSenderPRs(0);
+
 vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
 true, 100, 10, false, false,
 new MyGatewayEventFilter(), true ));
@@ -336,11 +338,9 @@ public class ParallelWANStatsDUnitTest extends WANTestBase{
   true, 100, 10, false, false,
   new MyGatewayEventFilter(), true ));
   
-createSenderPRs(0);
-
 startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
-createReceiverPR(vm2, 1);
+
 
 vm4.invoke(() -> WANTestBase.doPuts( testName, 1000 ));
 
@@ -351,7 +351,7 @@ public class ParallelWANStatsDUnitTest extends WANTestBase{
 ArrayList v5List = (ArrayList)vm5.invoke(() -> 
WANTestBase.getSenderStats( "ln", 0 ));
 ArrayList v6List = (ArrayList)vm6.invoke(() -> 
WANTestBase.getSenderStats( "ln", 0 ));
 ArrayList v7List = (ArrayList)vm7.invoke(() -> 
WANTestBase.getSenderStats( "ln", 0 ));
-
+
 

incubator-geode git commit: GEODE-1207: Removing FlakyTest tag

2016-08-01 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 0620b059e -> cb9c1e799


GEODE-1207: Removing FlakyTest tag

* Fixed in a previous commit for GEODE-1207


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

Branch: refs/heads/develop
Commit: cb9c1e79963eba60eaec2682978d7ba192517add
Parents: 0620b05
Author: nabarun 
Authored: Mon Aug 1 17:06:35 2016 -0700
Committer: nabarun 
Committed: Mon Aug 1 17:06:35 2016 -0700

--
 .../gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java   | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/cb9c1e79/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
index a175fad..00bfa1a 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
@@ -41,7 +41,6 @@ public class WANSSLDUnitTest extends WANTestBase{
 super();
   }
 
-  @Category(FlakyTest.class) // GEODE-1207: random ports, eats exceptions, 
time sensitive, waitForCriterion
   @Test
   public void testSenderSSLReceiverSSL(){
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));



incubator-geode git commit: GEODE-933: Refactored test code to stabilize it

2016-08-01 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 59e4c447e -> 0620b059e


GEODE-933: Refactored test code to stabilize it

* Made sure the senders are running before the puts are started.
* Correct order of creation of cache, region and senders/receivers.
* Code assumed to be stabilized from refactoring of WANTestBase
* Removing the FlakyTest tag.
* Test assumed to be stable until it fails again.


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

Branch: refs/heads/develop
Commit: 0620b059e99c15f0b472523992b0263bac81dbfa
Parents: 59e4c44
Author: nabarun 
Authored: Mon Aug 1 16:10:52 2016 -0700
Committer: nabarun 
Committed: Mon Aug 1 16:15:42 2016 -0700

--
 ...arallelGatewaySenderOperationsDUnitTest.java | 59 +++-
 1 file changed, 44 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0620b059/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
index a1036f4..4981c97 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
@@ -249,50 +249,79 @@ public class ParallelGatewaySenderOperationsDUnitTest 
extends WANTestBase {
   /**
* Normal scenario in which a sender is stopped and then started again.
*/
-  @Category(FlakyTest.class) // GEODE-933: thread sleeps, random ports, async 
actions, time sensitive
   @Test
   public void testParallelPropagationSenderStartAfterStop() throws Exception {
 IgnoredException.addIgnoredException("Broken pipe");
 Integer[] locatorPorts = createLNAndNYLocators();
 Integer lnPort = locatorPorts[0];
 Integer nyPort = locatorPorts[1];
+String regionName = getTestMethodName() + "_PR";
 
-createSendersReceiversAndPartitionedRegion(lnPort, nyPort, false, true);
+
+createCacheInVMs(nyPort, vm2, vm3);
+createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
+
+vm2.invoke(() -> createPartitionedRegion(regionName, "ln", 1, 100, 
isOffHeap()));
+vm3.invoke(() -> createPartitionedRegion(regionName, "ln", 1, 100, 
isOffHeap()));
+
+createReceiverInVMs(vm2, vm3);
+
+vm4.invoke(() -> createPartitionedRegion(regionName, "ln", 1, 100, 
isOffHeap()));
+vm5.invoke(() -> createPartitionedRegion(regionName, "ln", 1, 100, 
isOffHeap()));
+vm6.invoke(() -> createPartitionedRegion(regionName, "ln", 1, 100, 
isOffHeap()));
+vm7.invoke(() -> createPartitionedRegion(regionName, "ln", 1, 100, 
isOffHeap()));
+
+vm4.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, 
true));
+vm5.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, 
true));
+vm6.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, 
true));
+vm7.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, 
true));
+
+startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
 //make sure all the senders are running before doing any puts
-waitForSendersRunning();
+vm4.invoke(() -> waitForSenderRunningState("ln"));
+vm5.invoke(() -> waitForSenderRunningState("ln"));
+vm6.invoke(() -> waitForSenderRunningState("ln"));
+vm7.invoke(() -> waitForSenderRunningState("ln"));
 
 //FIRST RUN: now, the senders are started. So, do some of the puts
-vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_PR", 200 ));
+vm4.invoke(() -> WANTestBase.doPuts( regionName, 200 ));
 
 //now, stop all of the senders
-stopSenders();
-
-Wait.pause(2000);
-
+vm4.invoke(() -> stopSender("ln"));
+vm5.invoke(() -> stopSender("ln"));
+vm6.invoke(() -> stopSender("ln"));
+vm7.invoke(() -> stopSender("ln"));
+
+//Region size on remote site should remain same and below the number of 
puts done in the FIRST RUN
+vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(regionName, 200 
));
+
 //SECOND RUN: do some of the puts after the senders are stopped
-vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_PR", 1000 ));
+

incubator-geode git commit: GEODE-1147: Remove FlakyTest Tag

2016-08-01 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 80ac9956e -> b9387fb57


GEODE-1147: Remove FlakyTest Tag

* Refactored the test in correct order of creation of cache, region and 
sender/receiver.
* The WANTestBase.preTearDown was refactored in GEODE-1588
* FlakyTest tag removed till failure is noticed again.


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

Branch: refs/heads/develop
Commit: b9387fb573d3d2a15964f6435fd9247ee56cd856
Parents: 80ac995
Author: nabarun 
Authored: Mon Aug 1 14:18:28 2016 -0700
Committer: nabarun 
Committed: Mon Aug 1 14:18:28 2016 -0700

--
 ...NPropogation_PartitionedRegionDUnitTest.java | 33 +++-
 1 file changed, 18 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b9387fb5/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
index be8c353..c51c992 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
@@ -368,7 +368,6 @@ public class 
SerialWANPropogation_PartitionedRegionDUnitTest extends WANTestBase
 getTestMethodName() + "_PR", 1000 ));
   }
 
-  @Category(FlakyTest.class) // GEODE-1147: random ports, time sensitive, 
waitForCriterion, eats exceptions
   @Test
   public void testPartitionedSerialPropagationWithParallelThreads() throws 
Exception {
 
@@ -378,32 +377,36 @@ public class 
SerialWANPropogation_PartitionedRegionDUnitTest extends WANTestBase
 createCacheInVMs(nyPort, vm2, vm3);
 createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
-vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
-false, 100, 10, false, false, null, true ));
-vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
-false, 100, 10, false, false, null, true ));
-
 vm4.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
+  getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
 vm5.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
+  getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
 vm6.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
+  getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
 vm7.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
-
-startSenderInVMs("ln", vm4, vm5);
-
+  getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
 vm2.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
+  getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
 vm3.invoke(() -> WANTestBase.createPartitionedRegion(
-getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
+  getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
+
 createReceiverInVMs(vm2, vm3);
 
+vm4.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 100, 10, false, false, null, true ));
+vm5.invoke(() -> WANTestBase.createSender( "ln", 2,
+false, 100, 10, false, false, null, true ));
+
+startSenderInVMs("ln", vm4, vm5);
+
+
+
 vm4.invoke(() -> WANTestBase.doMultiThreadedPuts( // TODO: eats exceptions
 getTestMethodName() + "_PR", 1000 ));
 
 vm2.invoke(() -> WANTestBase.validateRegionSize(
 getTestMethodName() + "_PR", 1000 ));
+vm3.invoke(() -> WANTestBase.validateRegionSize(
+  getTestMethodName() + "_PR", 1000 ));
   }
 }



incubator-geode git commit: GEODE-1148: Refactored the test case

2016-08-01 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop d9bec3178 -> 80ac9956e


GEODE-1148: Refactored the test case

* Fixed the order of creation of cache, region, and receivers/senders
* StopAckThread function was fixed as a part of GEODE-1588
* WANTestBase.preTearDown has been running for a lot of other tests 
without failures.
* Removing the flaky tag till failures reoccur.
* Pause was replaced with validate receiver region sizes to make sure 
no send operation was running when the test was shutdown.


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

Branch: refs/heads/develop
Commit: 80ac9956e77b8a4e096f489ee36ce5a707ac8195
Parents: d9bec31
Author: nabarun 
Authored: Mon Aug 1 13:47:33 2016 -0700
Committer: nabarun 
Committed: Mon Aug 1 14:13:37 2016 -0700

--
 .../SerialWANPropagationLoopBackDUnitTest.java  | 53 ++--
 1 file changed, 27 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/80ac9956/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
index c715cb8..4b53626 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
@@ -133,8 +133,7 @@ public class SerialWANPropagationLoopBackDUnitTest extends 
WANTestBase {
 assertEquals(1, createList1.size());
 assertEquals(1, createList2.size());
   }
-  
-  @Category(FlakyTest.class) // GEODE-1148: random ports, eats exceptions 
(fixed 1), time sensitive, thread sleeps, waitForCriterion
+
   @Test
   public void testReplicatedSerialPropagationLoopBack3SitesLoop() throws 
Exception {
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
@@ -145,12 +144,22 @@ public class SerialWANPropagationLoopBackDUnitTest 
extends WANTestBase {
 createCacheInVMs(nyPort, vm4, vm7);
 createCacheInVMs(tkPort, vm5);
 
+vm3.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", "ln", isOffHeap()));
+vm4.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", "ny", isOffHeap()));
+vm5.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", "tk", isOffHeap()));
+
+vm6.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", "ln", isOffHeap() ));
+vm7.invoke(() -> WANTestBase.createReplicatedRegion(
+  getTestMethodName() + "_RR", "ny", isOffHeap() ));
+
 vm3.invoke(() -> WANTestBase.createReceiver());
 vm4.invoke(() -> WANTestBase.createReceiver());
 vm5.invoke(() -> WANTestBase.createReceiver());
 
-// using vm5 for sender in ds 3. cache is already created.
-
 vm6.invoke(() -> WANTestBase.createSender( "ln", 2,
 false, 100, 10, false, false, null, true ));
 vm7.invoke(() -> WANTestBase.createSender( "ny", 3,
@@ -158,48 +167,37 @@ public class SerialWANPropagationLoopBackDUnitTest 
extends WANTestBase {
 vm5.invoke(() -> WANTestBase.createSender( "tk", 1,
   false, 100, 10, false, false, null, true ));
 
-
-vm3.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", "ln", isOffHeap()));
-vm4.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", "ny", isOffHeap()));
-vm5.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", "tk", isOffHeap()));
-
 vm6.invoke(() -> WANTestBase.startSender( "ln" ));
 vm7.invoke(() -> WANTestBase.startSender( "ny" ));
 vm5.invoke(() -> WANTestBase.startSender( "tk" ));
-
+
+// using vm5 for sender in ds 3. cache is already created.
 vm6.invoke(() -> WANTestBase.addQueueListener( "ln",
   false ));
 vm7.invoke(() -> WANTestBase.addQueueListener( "ny",
   false ));
 vm5.invoke(() -> WANTestBase.addQueueListener( "tk",
   false ));
-  
-
-vm6.invoke(() -> WANTestBase.createReplicatedRegion(
-getTestMethodName() + "_RR", "ln", isOffHeap() ));
-

incubator-geode git commit: GEODE-1011: Rearranged the order of creating test elements

2016-08-01 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 983010e4a -> 237035720


GEODE-1011: Rearranged the order of creating test elements

* Caches are created first, followed by region and sender/receiver
* Removed the pauses, as they are not necessary. Awaitility handles the 
waiting
* Issue assumed to be resolved after WAN refactoring
* Flaky tag removed


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

Branch: refs/heads/develop
Commit: 237035720189d0ca72d63848460e2e77a9a2c3d0
Parents: 983010e
Author: nabarun 
Authored: Fri Jul 29 14:12:10 2016 -0700
Committer: nabarun 
Committed: Mon Aug 1 10:09:41 2016 -0700

--
 ...allelGatewaySenderOperation_1_DUnitTest.java | 48 ++--
 1 file changed, 25 insertions(+), 23 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/23703572/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
index 4645488..ab1c06b 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
@@ -597,26 +597,14 @@ public class 
ConcurrentParallelGatewaySenderOperation_1_DUnitTest extends WANTes
* Normal scenario in which a sender is stopped and then started again on 
accessor node.
* @throws Exception
*/
-  @Category(FlakyTest.class) // GEODE-1011: random ports, time sensitive, 
waitForCriterion, 5 minute timeouts, 5 second thread sleeps, async actions
   @Test
   public void testParallelPropagationSenderStartAfterStopOnAccessorNode() 
throws Throwable {
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));
 Integer nyPort = (Integer)vm1.invoke(() -> 
WANTestBase.createFirstRemoteLocator( 2, lnPort ));
 
 createCacheInVMs(nyPort, vm2, vm3);
-createReceiverInVMs(vm2, vm3);
-
 createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
 
-vm4.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
-true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
-vm5.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
-true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
-vm6.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
-true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
-vm7.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
-true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
-
 vm4.invoke(() -> WANTestBase.createPartitionedRegion(
 getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() ));
 vm5.invoke(() -> WANTestBase.createPartitionedRegion(
@@ -626,6 +614,15 @@ public class 
ConcurrentParallelGatewaySenderOperation_1_DUnitTest extends WANTes
 vm7.invoke(() -> WANTestBase.createPartitionedRegionAsAccessor(
 getTestMethodName() + "_PR", "ln", 1, 100));
 
+vm4.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
+  true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
+vm5.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
+  true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
+vm6.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
+  true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
+vm7.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2,
+  true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY ));
+
 startSenderInVMs("ln", vm4, vm5, vm6, vm7);
 
 vm2.invoke(() -> WANTestBase.createPartitionedRegion(
@@ -633,6 +630,9 @@ public class 
ConcurrentParallelGatewaySenderOperation_1_DUnitTest extends WANTes
 vm3.invoke(() -> WANTestBase.createPartitionedRegion(
 getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
 
+
+createReceiverInVMs(vm2, vm3);
+
 //make sure all the senders are not running on accessor nodes and running 
on non-accessor nodes
 vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" ));
 

incubator-geode git commit: GEODE-1062: Removed FlakyTest tag

2016-07-29 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 2800efe8b -> 02c6818b4


GEODE-1062: Removed FlakyTest tag

* Test fixed in an earlier commit.
* No failures noticed


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

Branch: refs/heads/develop
Commit: 02c6818b43b9a7c9fb1d29ad0634c214b4020f13
Parents: 2800efe
Author: nabarun 
Authored: Fri Jul 29 16:39:37 2016 -0700
Committer: nabarun 
Committed: Fri Jul 29 16:39:37 2016 -0700

--
 .../internal/cache/wan/serial/SerialWANPropogationDUnitTest.java| 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/02c6818b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
index 4ecc841..5a32884 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
@@ -105,7 +105,6 @@ public class SerialWANPropogationDUnitTest extends 
WANTestBase {
 getTestMethodName() + "_RR", "ln", isOffHeap()   );
   }
 
-  @Category(FlakyTest.class) // GEODE-935 AND GEODE-1062: time sensitive, 
random ports, thread sleeps
   @Test
   public void testReplicatedSerialPropagation_withoutRemoteSite() throws 
Exception {
 Integer lnPort = (Integer)vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));



incubator-geode git commit: GEODE-1032: Removed FlakyTest tag

2016-07-29 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 9943ba46e -> 2800efe8b


GEODE-1032: Removed FlakyTest tag

* Test was fixed in a previous commit for GEODE-1032
* No failures were noticed hence removing the flaky tag


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

Branch: refs/heads/develop
Commit: 2800efe8b8a32343f109b00db7119cd73537659f
Parents: 9943ba4
Author: nabarun 
Authored: Fri Jul 29 16:34:00 2016 -0700
Committer: nabarun 
Committed: Fri Jul 29 16:34:00 2016 -0700

--
 .../internal/cache/wan/serial/SerialWANPropogationDUnitTest.java| 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2800efe8/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
index 7df9689..4ecc841 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
@@ -910,7 +910,6 @@ public class SerialWANPropogationDUnitTest extends 
WANTestBase {
 vm6.invoke(() -> WANTestBase.checkMinimumGatewayReceiverStats( 1, 1 ));
   }
 
-  @Category(FlakyTest.class) // GEODE-975 AND GEODE-1032: random ports, 
waitForCriterion, short timeouts, async actions
   @Test
   public void 
testReplicatedSerialPropagationWithRemoteReceiverRestartedOnOtherNode() throws 
Exception {
 Integer lnPort = (Integer) vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId( 1 ));



incubator-geode git commit: GEODE-1121: Removing flaky tag

2016-07-29 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop bf6cf4147 -> 9943ba46e


GEODE-1121: Removing flaky tag

* This test was fixed in an earlier commit.
* As no failures occured, removing the flaky tag


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

Branch: refs/heads/develop
Commit: 9943ba46ee5d5b4b0107b8ddf9537fe3337b32fa
Parents: bf6cf41
Author: nabarun 
Authored: Fri Jul 29 14:24:44 2016 -0700
Committer: nabarun 
Committed: Fri Jul 29 14:24:44 2016 -0700

--
 .../cache/wan/concurrent/ConcurrentWANPropogation_2_DUnitTest.java  | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9943ba46/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropogation_2_DUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropogation_2_DUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropogation_2_DUnitTest.java
index 4b8d6bf..06e0ecb 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropogation_2_DUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentWANPropogation_2_DUnitTest.java
@@ -48,7 +48,6 @@ public class ConcurrentWANPropogation_2_DUnitTest extends 
WANTestBase {
 
   private static final long serialVersionUID = 1L;
 
-  @Category(FlakyTest.class) // GEODE-1121: random ports, async behavior, time 
sensitive, waitForCriterion, possibly memory intensive
   @Test
   public void testSerialReplicatedWanWithOverflow() {
 



incubator-geode git commit: GEODE-1674: Using a immuatable object to pass the HashIndexSet and its mask

2016-07-27 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop c556f011a -> 6e8f42f38


GEODE-1674: Using a immuatable object to pass the HashIndexSet and its mask

* Immutable ojects pairs the mask and set together
* There is no race condition in which the mask differs from the set 
leading to any ArrayOutOfBoundsException.


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

Branch: refs/heads/develop
Commit: 6e8f42f38af3914cea943a48c14f868590b8964e
Parents: c556f01
Author: nabarun 
Authored: Tue Jul 19 10:31:52 2016 -0700
Committer: nabarun 
Committed: Wed Jul 27 09:47:53 2016 -0700

--
 .../query/internal/index/HashIndexSet.java  | 202 ++-
 .../internal/index/HashIndexJUnitTest.java  |   2 +-
 .../internal/index/HashIndexSetJUnitTest.java   |  20 +-
 3 files changed, 117 insertions(+), 107 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6e8f42f3/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/HashIndexSet.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/HashIndexSet.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/HashIndexSet.java
index 5ed724b..55cbac1 100755
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/HashIndexSet.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/HashIndexSet.java
@@ -24,23 +24,17 @@ package com.gemstone.gemfire.cache.query.internal.index;
 
 import static it.unimi.dsi.fastutil.HashCommon.arraySize;
 import it.unimi.dsi.fastutil.HashCommon;
-import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
 
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
 import com.gemstone.gemfire.cache.query.TypeMismatchException;
-import 
com.gemstone.gemfire.cache.query.internal.index.AbstractIndex.InternalIndexStatistics;
 import com.gemstone.gemfire.cache.query.internal.parse.OQLLexerTokenTypes;
 import com.gemstone.gemfire.cache.query.internal.types.TypeUtils;
 import com.gemstone.gemfire.internal.cache.CachePerfStats;
-import com.gemstone.gemfire.internal.cache.CachedDeserializable;
-import com.gemstone.gemfire.internal.cache.RegionEntry;
-import com.gemstone.gemfire.internal.offheap.StoredObject;
 import com.gemstone.gemfire.pdx.internal.PdxString;
 
 /**
@@ -55,18 +49,41 @@ public class HashIndexSet implements Set {
* optional statistics object to track number of hash collisions and time
* spent probing based on hash collisions
*/
-  private transient CachePerfStats cacheStats;
+  final class HashIndexSetProperties{
+/** the set of Objects */
+final protected transient Object[] set;
+/** used for hashing into the table**/
+final protected int mask;
+
+/** the current number of entries in the set */
+protected transient int size = 0;
+
+/** the current number of open slots in the hash.
+ * Originally used when we collapsed collided keys into collections
+ * Not really used now */
+protected transient int free;
+
+/** number of removed tokens in the set, these are index positions that 
may be reused*/
+transient int removedTokens;
 
-  /** the current number of entries in the set */
-  protected transient int _size;
+/** size of the backing table (-1)**/
+protected int n;
 
-  /** the current number of open slots in the hash.
-   * Originally used when we collapsed collided keys into collections
-   * Not really used now */
-  protected transient int _free;
+/**
+ * The maximum number of elements before rehashing
+ */
+protected int maxSize;
+
+private int computeNumFree() {
+  return this.n - this.size;
+}
 
-  /** number of removed tokens in the set, these are index positions that may 
be reused*/
-  transient int _removedTokens;
+public HashIndexSetProperties(final Object[] set, final int mask) {
+  this.set = set;
+  this.mask = mask;
+}
+  }
+  private transient CachePerfStats cacheStats;
 
   /** the load above which rehashing occurs. */
   protected static final float DEFAULT_LOAD_FACTOR = 0.5f;
@@ -74,25 +91,13 @@ public class HashIndexSet implements Set {
   protected static final int DEFAULT_INITIAL_CAPACITY = 128;
 
   protected float _loadFactor;
-  
-  /** size of the backing table (-1)**/
-  protected int n;
-  
-  /** 

incubator-geode git commit: GEODE-1612: Gets a list of random ports at once

2016-07-18 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f4fdfa915 -> b830c2774


GEODE-1612: Gets a list of random ports at once

* Getting a random port for each locator one by one led to different 
locators getting assigned the same port number
* By getting a list of available ports at one shot reduces the 
possiblity of locators being assigned the same port number
* This will not solve the problem of locators being assigned a port 
which is in use.
* We can't pass 0 as the locator port parameter because we need the 
ring topology before the locators are started.
This closes #204


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

Branch: refs/heads/develop
Commit: b830c277455126c1748733105403b6f52c6e16ce
Parents: f4fdfa9
Author: nabarun 
Authored: Wed Jul 13 11:49:45 2016 -0700
Committer: nabarun 
Committed: Mon Jul 18 11:37:35 2016 -0700

--
 .../wan/misc/WanAutoDiscoveryDUnitTest.java | 22 +---
 1 file changed, 10 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b830c277/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
index 48cc379..a84f393 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
@@ -295,21 +295,19 @@ public class WanAutoDiscoveryDUnitTest extends 
WANTestBase {
   @Test
   public void test_RingTopology() {
 
+int [] ports = 
AvailablePortHelper.getRandomAvailableTCPPortsForDUnitSite(4);
+
 final Set site1LocatorsPort = new HashSet();
-int site1Port1 = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-site1LocatorsPort.add("localhost["+site1Port1+"]");
+site1LocatorsPort.add("localhost["+ports[0]+"]");

 final Set site2LocatorsPort = new HashSet();
-int site2Port1 = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-site2LocatorsPort.add("localhost["+site2Port1+"]");
+site2LocatorsPort.add("localhost["+ports[1]+"]");

 final Set site3LocatorsPort = new HashSet();
-int site3Port1 = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-site3LocatorsPort.add("localhost["+site3Port1+"]");
+site3LocatorsPort.add("localhost["+ports[2]+"]");

 final Set site4LocatorsPort = new HashSet();
-int site4Port1 = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-site4LocatorsPort.add("localhost["+site4Port1+"]");
+site4LocatorsPort.add("localhost["+ports[3]+"]");

 Map dsVsPort = new HashMap();
 dsVsPort.put(1, site1LocatorsPort);
@@ -320,13 +318,13 @@ public class WanAutoDiscoveryDUnitTest extends 
WANTestBase {
 int AsyncInvocationArrSize = 9;
 AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize];

-async[0] = vm0.invokeAsync(() -> WANTestBase.createLocator( 1, site1Port1, 
site1LocatorsPort, site2LocatorsPort));
+async[0] = vm0.invokeAsync(() -> WANTestBase.createLocator( 1, ports[0], 
site1LocatorsPort, site2LocatorsPort));

-async[1] = vm1.invokeAsync(() -> WANTestBase.createLocator( 2, site2Port1, 
site2LocatorsPort, site3LocatorsPort));
+async[1] = vm1.invokeAsync(() -> WANTestBase.createLocator( 2, ports[1], 
site2LocatorsPort, site3LocatorsPort));

-async[2] = vm2.invokeAsync(() -> WANTestBase.createLocator( 3, site3Port1, 
site3LocatorsPort, site4LocatorsPort));
+async[2] = vm2.invokeAsync(() -> WANTestBase.createLocator( 3, ports[2], 
site3LocatorsPort, site4LocatorsPort));

-async[3] = vm3.invokeAsync(() -> WANTestBase.createLocator( 4, site4Port1, 
site4LocatorsPort, site1LocatorsPort));
+async[3] = vm3.invokeAsync(() -> WANTestBase.createLocator( 4, ports[3], 
site4LocatorsPort, site1LocatorsPort));

// pause(5000);
 try {



incubator-geode git commit: GEODE-1600: startLocatorAndDS takes 0 as port number parameter [Forced Update!]

2016-07-14 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 0dc34e17b -> 8a28f5233 (forced update)


GEODE-1600: startLocatorAndDS takes 0 as port number parameter

* Use of getAvailableTCP port led to race conditions which led to 
locators being assigned ports in use.
* Use of 0 now assignes a port number to the locator after the server 
is started.
* Code modification to accept 0 as a valid port number until a real 
port number is assigned after the server is started.
This closes #202


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

Branch: refs/heads/develop
Commit: 8a28f52334ac08183d53b427fa9bb8feaab8f834
Parents: 5b28987
Author: nabarun 
Authored: Mon Jul 11 14:11:38 2016 -0700
Committer: nabarun 
Committed: Thu Jul 14 09:50:05 2016 -0700

--
 .../internal/AbstractDistributionConfig.java|  5 ++-
 .../distributed/internal/InternalLocator.java   |  8 +
 .../test/dunit/standalone/DUnitLauncher.java| 36 +---
 3 files changed, 35 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8a28f523/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
index 531e462..601818e 100644
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
@@ -322,7 +322,10 @@ public abstract class AbstractDistributionConfig
   int portVal = 0;
   try {
 portVal = Integer.parseInt(port);
-if (portVal < 1 || portVal > 65535) {
+if(0 == portVal){
+  return "";
+}
+else if (portVal < 1 || portVal > 65535) {
   throw new 
IllegalArgumentException(LocalizedStrings.AbstractDistributionConfig_INVALID_LOCATOR_0_THE_PORT_1_WAS_NOT_GREATER_THAN_ZERO_AND_LESS_THAN_65536.toLocalizedString(new
 Object[] {value, Integer.valueOf(portVal)}));
 }
   } catch (NumberFormatException ex) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8a28f523/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
index de191e8..1a343dc 100755
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
@@ -603,6 +603,14 @@ public class InternalLocator extends Locator implements 
ConnectListener {
 this.handler, new DelayedPoolStatHelper(), group, this.toString());
   }
 
+  //Reset the file names with the correct port number if startLocatorAndDS was 
called with port number 0
+  public void resetInternalLocatorFileNamesWithCorrectPortNumber(int port){
+this.stateFile = new File("locator" + port + "view.dat");
+File productUseFile = new File("locator"+port+"views.log");
+this.productUseLog = new ProductUseLog(productUseFile);
+  }
+
+
   private void startTcpServer() throws IOException {
 
logger.info(LocalizedMessage.create(LocalizedStrings.InternalLocator_STARTING_0,
 this));
 server.start();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8a28f523/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
--
diff --git 
a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
 
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
index b53327d..3335158 100755
--- 
a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
+++ 
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
@@ -141,8 +141,6 @@ public class DUnitLauncher {
 DUNIT_SUSPECT_FILE.delete();
 DUNIT_SUSPECT_FILE.deleteOnExit();
 
-locatorPort = AvailablePortHelper.getRandomAvailableTCPPort();
- 
 //create 

incubator-geode git commit: GEODE-1600: startLocatorAndDS takes 0 as port number parameter

2016-07-14 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 5b2898761 -> 0dc34e17b


GEODE-1600: startLocatorAndDS takes 0 as port number parameter

* Use of getAvailableTCP port led to race conditions which led to 
locators being assigned ports in use.
* Use of 0 now assignes a port number to the locator after the server 
is started.
* Code modification to accept 0 as a valid port number until a real 
port number is assigned after the server is started.


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

Branch: refs/heads/develop
Commit: 0dc34e17bb3cf0e88a51d7dff517f299a5fb277e
Parents: 5b28987
Author: nabarun 
Authored: Mon Jul 11 14:11:38 2016 -0700
Committer: nabarun 
Committed: Thu Jul 14 09:48:44 2016 -0700

--
 .../internal/AbstractDistributionConfig.java|  5 ++-
 .../distributed/internal/InternalLocator.java   |  8 +
 .../test/dunit/standalone/DUnitLauncher.java| 36 +---
 3 files changed, 35 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0dc34e17/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
index 531e462..601818e 100644
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/AbstractDistributionConfig.java
@@ -322,7 +322,10 @@ public abstract class AbstractDistributionConfig
   int portVal = 0;
   try {
 portVal = Integer.parseInt(port);
-if (portVal < 1 || portVal > 65535) {
+if(0 == portVal){
+  return "";
+}
+else if (portVal < 1 || portVal > 65535) {
   throw new 
IllegalArgumentException(LocalizedStrings.AbstractDistributionConfig_INVALID_LOCATOR_0_THE_PORT_1_WAS_NOT_GREATER_THAN_ZERO_AND_LESS_THAN_65536.toLocalizedString(new
 Object[] {value, Integer.valueOf(portVal)}));
 }
   } catch (NumberFormatException ex) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0dc34e17/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
index de191e8..1a343dc 100755
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
@@ -603,6 +603,14 @@ public class InternalLocator extends Locator implements 
ConnectListener {
 this.handler, new DelayedPoolStatHelper(), group, this.toString());
   }
 
+  //Reset the file names with the correct port number if startLocatorAndDS was 
called with port number 0
+  public void resetInternalLocatorFileNamesWithCorrectPortNumber(int port){
+this.stateFile = new File("locator" + port + "view.dat");
+File productUseFile = new File("locator"+port+"views.log");
+this.productUseLog = new ProductUseLog(productUseFile);
+  }
+
+
   private void startTcpServer() throws IOException {
 
logger.info(LocalizedMessage.create(LocalizedStrings.InternalLocator_STARTING_0,
 this));
 server.start();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0dc34e17/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
--
diff --git 
a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
 
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
index b53327d..3335158 100755
--- 
a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
+++ 
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
@@ -141,8 +141,6 @@ public class DUnitLauncher {
 DUNIT_SUSPECT_FILE.delete();
 DUNIT_SUSPECT_FILE.deleteOnExit();
 
-locatorPort = AvailablePortHelper.getRandomAvailableTCPPort();
- 
 //create an RMI registry and add an object to share 

incubator-geode git commit: GEODE-1639: Receivers selects a different port if the selected port is in use.

2016-07-13 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop c4cf82101 -> 23211ddca


GEODE-1639: Receivers selects a different port if the selected port is in use.

* If the selected port is in use then the receiver will select another 
port between 20001 and 2
This closes #194


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

Branch: refs/heads/develop
Commit: 23211ddcaf9a6be719ba9f1915a6ca862a2eef71
Parents: c4cf821
Author: nabarun 
Authored: Wed Jul 6 16:34:03 2016 -0700
Committer: nabarun 
Committed: Wed Jul 13 13:45:15 2016 -0700

--
 .../gemstone/gemfire/internal/AvailablePort.java|  7 ---
 .../cache/wan/wancommand/WANCommandTestBase.java| 16 
 2 files changed, 12 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/23211ddc/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java 
b/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
index 95ca22b..5fa826f 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
@@ -33,7 +33,8 @@ public class AvailablePort {
 
   /** Is the port available for a Socket (TCP) connection? */
   public static final int SOCKET = 0;
-
+  public static final int AVAILABLE_PORTS_LOWER_BOUND = 20001;// 2/udp is 
securid
+  public static final int AVAILABLE_PORTS_UPPER_BOUND = 2;//3/tcp is 
spoolfax
   /** Is the port available for a JGroups (UDP) multicast connection */
   public static final int MULTICAST = 1;
 
@@ -434,8 +435,8 @@ public class AvailablePort {
 //   rangeBase=1024;
 //   rangeTop=5000;
 // }
-rangeBase = 20001; // 2/udp is securid
-rangeTop =  2; // 3/tcp is spoolfax
+rangeBase = AVAILABLE_PORTS_LOWER_BOUND; // 2/udp is securid
+rangeTop =  AVAILABLE_PORTS_UPPER_BOUND; // 3/tcp is spoolfax
 
 return rand.nextInt(rangeTop-rangeBase) + rangeBase;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/23211ddc/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
index af72ed1..ec38b31 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
@@ -25,6 +25,7 @@ import 
com.gemstone.gemfire.cache.wan.GatewaySender.OrderPolicy;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.wan.AbstractGatewaySender;
 import com.gemstone.gemfire.management.ManagementService;
@@ -230,12 +231,11 @@ public abstract class WANCommandTestBase extends 
CliCommandTestBase {
 InternalDistributedSystem ds = getSystem(props);
 cache = CacheFactory.create(ds);
 GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
-int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-fact.setStartPort(port);
-fact.setEndPort(port);
+fact.setStartPort(AvailablePort.AVAILABLE_PORTS_LOWER_BOUND);
+fact.setEndPort(AvailablePort.AVAILABLE_PORTS_UPPER_BOUND);
 fact.setManualStart(true);
 GatewayReceiver receiver = fact.create();
-return port;
+return receiver.getPort();
   }
 
   public int createReceiverWithGroup(int locPort, String groups) {
@@ -248,12 +248,12 @@ public abstract class WANCommandTestBase extends 
CliCommandTestBase {
 InternalDistributedSystem ds = getSystem(props);
 cache = CacheFactory.create(ds);
 GatewayReceiverFactory fact = cache.createGatewayReceiverFactory();
-int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-fact.setStartPort(port);
-fact.setEndPort(port);
+

incubator-geode git commit: GEODE-1587: Replaced AtomicInteger with AtomicIntegerFieldUpdater

2016-07-13 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 31336f15a -> c4cf82101


GEODE-1587: Replaced AtomicInteger with AtomicIntegerFieldUpdater

* Use of AtomicIntegerFieldUpdater decereased the memory overhead per 
entry during index creation

This closes #191


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

Branch: refs/heads/develop
Commit: c4cf821018e5727323f7819b783677f4dd8da21f
Parents: 31336f1
Author: nabarun 
Authored: Mon Jun 27 10:25:20 2016 -0700
Committer: nabarun 
Committed: Wed Jul 13 12:03:37 2016 -0700

--
 .../query/internal/index/AbstractIndex.java | 29 +++-
 1 file changed, 16 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c4cf8210/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/AbstractIndex.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/AbstractIndex.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/AbstractIndex.java
index 393428b..6c0d509 100644
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/AbstractIndex.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/cache/query/internal/index/AbstractIndex.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
@@ -96,7 +96,10 @@ import com.gemstone.gemfire.pdx.internal.PdxString;
 public abstract class AbstractIndex implements IndexProtocol
 {
   private static final Logger logger = LogService.getLogger();
-  
+
+  private static final AtomicIntegerFieldUpdater 
atomicUpdater =  AtomicIntegerFieldUpdater
+.newUpdater(RegionEntryToValuesMap.class, "numValues");
+
   final String indexName;
 
   final Region region;
@@ -1421,7 +1424,7 @@ public abstract class AbstractIndex implements 
IndexProtocol
* @return true if limit is satisfied.
*/
   protected boolean verifyLimit(Collection result, int limit,
-  ExecutionContext context) {   
+  ExecutionContext context) {
 if (limit > 0) {
  /* if (!context.isDistinct()) {
 return ((Bag)result).size() == limit;
@@ -1737,7 +1740,7 @@ public abstract class AbstractIndex implements 
IndexProtocol
   {
 protected Map map;
 private boolean useList;
-private AtomicInteger numValues = new AtomicInteger(0);
+volatile int numValues;
 
 RegionEntryToValuesMap(boolean useList) {
   this.map = new ConcurrentHashMap(2, 0.75f, 1);
@@ -1786,7 +1789,7 @@ public abstract class AbstractIndex implements 
IndexProtocol
 coll.add(value);
 map.put(entry, coll);
   }
-  numValues.incrementAndGet();
+  atomicUpdater.incrementAndGet(this);
 }
 
 public void addAll(RegionEntry entry, Collection values)
@@ -1796,7 +1799,7 @@ public abstract class AbstractIndex implements 
IndexProtocol
 Collection coll = useList?new ArrayList(values.size()):new 
IndexConcurrentHashSet(values.size(), 0.75f, 1);
 coll.addAll(values);
 map.put(entry, coll);
-numValues.addAndGet(values.size());
+atomicUpdater.addAndGet(this,values.size());
   } else if (object instanceof Collection) {
 Collection coll = (Collection) object;
 // If its a list query might get ConcurrentModificationException.
@@ -1815,7 +1818,7 @@ public abstract class AbstractIndex implements 
IndexProtocol
 coll.add(object);
 map.put(entry, coll);
   }
-  numValues.addAndGet(values.size());
+  atomicUpdater.addAndGet(this,values.size());
 }
 
 public Object get(RegionEntry entry)
@@ -1853,14 +1856,14 @@ public abstract class AbstractIndex implements 
IndexProtocol
   if (coll.size() == 0) {
 map.remove(entry);
   }
-  numValues.decrementAndGet();
+  atomicUpdater.decrementAndGet(this);
 }
   }
   else {
 if (object.equals(value)) {
   map.remove(entry);
 }
-this.numValues.decrementAndGet();
+atomicUpdater.decrementAndGet(this);
   }
 }
 
@@ -1868,7 +1871,7 @@ public abstract class AbstractIndex implements 
IndexProtocol
 {
   Object retVal = 

incubator-geode git commit: GEODE-1586: Re-arranged the validation sequence in the test case. * Validate that the receiver region side before validating that the sender's queues are drained. * This gi

2016-07-06 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop c065b6aef -> ff2637d7a


GEODE-1586: Re-arranged the validation sequence in the test case.
* Validate that the receiver region side before validating that the 
sender's queues are drained.
* This gives the sender's queues additional time to drain.
* size() in CustomEntryConcurrentHashMap is written such that if the 
counts do not change in two iterations, that value is returned as size.
* This size() will not be always consistent.
* Only the test can be modified to ensure that the queues get enough 
time to drain out.

This closes #189


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

Branch: refs/heads/develop
Commit: ff2637d7aeadd0beda581d5c2422803f167021e1
Parents: c065b6a
Author: nabarun 
Authored: Thu Jun 30 10:47:16 2016 -0700
Committer: nabarun 
Committed: Wed Jul 6 09:36:23 2016 -0700

--
 ...oncurrentParallelGatewaySenderDUnitTest.java | 22 +---
 1 file changed, 14 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ff2637d7/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
index 5790a8d..ee9edf8 100644
--- 
a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
+++ 
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
@@ -16,6 +16,7 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.concurrent;
 
+import com.jayway.awaitility.Awaitility;
 import org.junit.experimental.categories.Category;
 import org.junit.Test;
 
@@ -40,6 +41,7 @@ import com.gemstone.gemfire.test.dunit.Wait;
 
 import java.net.SocketException;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Test the functionality of ParallelGatewaySender with multiple dispatchers.
@@ -621,29 +623,33 @@ public class ConcurrentParallelGatewaySenderDUnitTest 
extends WANTestBase {
 getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
 
 AsyncInvocation inv1 = vm7.invokeAsync(() -> WANTestBase.doPuts( 
getTestMethodName() + "_PR", 5000 ));
-Wait.pause(500);
+vm2.invoke(() -> Awaitility.await().atMost(3, 
TimeUnit.MILLISECONDS).until(() ->
+  assertEquals("Failure in waiting for at least 10 events to be received 
by the receiver",
+true, (getRegionSize(getTestMethodName() + "_PR") > 10 ;
 AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender());
 AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase.doPuts( 
getTestMethodName() + "_PR", 1 ));
-Wait.pause(1500);
+vm2.invoke(() -> Awaitility.await().atMost(3, 
TimeUnit.MILLISECONDS).until(() ->
+  assertEquals("Failure in waiting for additional 2000 events to be 
received by the receiver ",
+true,getRegionSize(getTestMethodName() + "_PR") > 7000 )));
 AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender());
 inv1.join();
 inv2.join();
 inv3.join();
 inv4.join();
-
+
 vm6.invoke(() -> WANTestBase.validateRegionSize(
   getTestMethodName() + "_PR", 1 ));
 vm7.invoke(() -> WANTestBase.validateRegionSize(
   getTestMethodName() + "_PR", 1 ));
+
+vm2.invoke(() -> WANTestBase.validateRegionSize(
+  getTestMethodName() + "_PR", 1 ));
+vm3.invoke(() -> WANTestBase.validateRegionSize(
+  getTestMethodName() + "_PR", 1 ));
 
 //verify all buckets drained on the sender nodes that up and running.
 vm6.invoke(() -> 
WANTestBase.validateParallelSenderQueueAllBucketsDrained("ln"));
 vm7.invoke(() -> 
WANTestBase.validateParallelSenderQueueAllBucketsDrained("ln"));
-
-vm2.invoke(() -> WANTestBase.validateRegionSize(
-getTestMethodName() + "_PR", 1 ));
-vm3.invoke(() -> WANTestBase.validateRegionSize(
-getTestMethodName() + "_PR", 1 ));
   }
   
   @Test



incubator-geode git commit: GEODE-1339: Added test to validate getAllIndexes and getIndex functions for Lucene.

2016-06-30 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop ec5578a22 -> 369d4320d


GEODE-1339: Added test to validate  getAllIndexes and getIndex functions for 
Lucene.

* Added test to validate that a list of the indexes is returned if they 
are present in the system
* validated that an empty list is returned when there are no indexes in 
the system.
* getIndex function call with index name and region name as parameter 
will return the index object
* Null is returned when unmatched index names / region names are used 
or there are no indexes in the system.


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

Branch: refs/heads/develop
Commit: 369d4320d18b0c6afdb40a36970316e64e3d7e62
Parents: ec5578a
Author: nabarun 
Authored: Mon Jun 27 15:12:28 2016 -0700
Committer: nabarun 
Committed: Thu Jun 30 15:54:45 2016 -0700

--
 .../lucene/LuceneIndexCreationDUnitTest.java| 114 ++-
 ...nDUnitTest.verifyXMLEmptyIndexList.cache.xml |  33 ++
 ...nitTest.verifyXMLMultipleIndexList.cache.xml |  39 +++
 3 files changed, 184 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/369d4320/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationDUnitTest.java
--
diff --git 
a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationDUnitTest.java
 
b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationDUnitTest.java
index f51c848..cec8d0e 100644
--- 
a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationDUnitTest.java
+++ 
b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationDUnitTest.java
@@ -33,13 +33,13 @@ import org.junit.runner.RunWith;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
 import static com.gemstone.gemfire.cache.lucene.test.LuceneTestUtilities.*;
 import static junitparams.JUnitParamsRunner.$;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 @Category(DistributedTest.class)
 @RunWith(JUnitParamsRunner.class)
@@ -51,6 +51,65 @@ public class LuceneIndexCreationDUnitTest extends 
LuceneDUnitTest {
 
getCache().createRegionFactory(RegionShortcut.PARTITION).create(REGION_NAME);
   }
 
+
+  @Test
+  @Parameters({"1", "2" , "10"})
+  public void verifyThatIndexObjectsAreListedWhenPresentInTheSystem(int 
numberOfIndexes){
+SerializableRunnableIF createIndex = getMultipleIndexes(numberOfIndexes);
+dataStore1.invoke(() -> initDataStore(createIndex));
+dataStore1.invoke(() -> verifyIndexList(numberOfIndexes));
+
+dataStore2.invoke(() -> initDataStore(createIndex));
+dataStore2.invoke(() -> verifyIndexList(numberOfIndexes));
+  }
+
+  @Test
+  @Parameters({"1", "2" , "10"})
+  public void verifyThatIndexObjectIsRetrievedWhenPresentInTheSystem(int 
numberOfIndexes){
+SerializableRunnableIF createIndex = getMultipleIndexes(numberOfIndexes);
+dataStore1.invoke(() -> initDataStore(createIndex));
+dataStore1.invoke(() -> verifyIndexes(numberOfIndexes));
+
+dataStore2.invoke(() -> initDataStore(createIndex));
+dataStore2.invoke(() -> verifyIndexes(numberOfIndexes));
+  }
+
+  @Test
+  public void verifyThatEmptyListIsOutputWhenThereAreNoIndexesInTheSystem(){
+dataStore1.invoke(() -> verifyIndexList(0));
+dataStore2.invoke(() -> verifyIndexList(0));
+  }
+
+  @Test
+  public void verifyNullIsReturnedWhenGetIndexIsCalledAndNoIndexesArePresent(){
+dataStore1.invoke(() -> {
+  LuceneService luceneService = LuceneServiceProvider.get(getCache());
+  assertNull(luceneService.getIndex(INDEX_NAME,REGION_NAME));
+});
+
+dataStore2.invoke(() -> {
+  LuceneService luceneService = LuceneServiceProvider.get(getCache());
+  assertNull(luceneService.getIndex(INDEX_NAME,REGION_NAME));
+});
+  }
+
+  @Test
+  public void verifyNullIsReturnedWhenGetIndexIsCalledWithNoMatchingIndex(){
+SerializableRunnableIF createIndex = get2FieldsIndexes();
+dataStore1.invoke(() -> createIndex);
+dataStore2.invoke(() -> createIndex);
+dataStore1.invoke(() -> {
+  LuceneService luceneService = LuceneServiceProvider.get(getCache());
+  assertNull(luceneService.getIndex(INDEX_NAME+"_A",REGION_NAME));
+});
+
+dataStore2.invoke(() -> {
+  

incubator-geode git commit: GEODE-1599: Array size allocation method was changed to prevent race condition in CopyOnWriteArray

2016-06-30 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 186a09a74 -> ec5578a22


GEODE-1599: Array size allocation method was changed to prevent race condition 
in CopyOnWriteArray

* toArray(new Statistics[statlist.size()]); was converted to 
toArray(new Statistics[0]);
* This is done to avoid a race condition.
* The size of the CopyOnWriteArray may increase after allocating the 
size for the array in which the CopyOnWriteArray is to be placed


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

Branch: refs/heads/develop
Commit: ec5578a22c75dbdf7ae698b805307915fcf763a0
Parents: 186a09a
Author: nabarun 
Authored: Mon Jun 27 11:12:51 2016 -0700
Committer: nabarun 
Committed: Thu Jun 30 15:07:29 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ec5578a2/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
index a672127..14a4d53 100755
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystem.java
@@ -1720,7 +1720,7 @@ public class InternalDistributedSystem
   @Override
   public final Statistics[] getStatistics() {
 List statsList = this.statsList;
-return (Statistics[])statsList.toArray(new Statistics[statsList.size()]);
+return (Statistics[])statsList.toArray(new Statistics[0]);
   }
   
   // StatisticsFactory methods



incubator-geode git commit: GEODE-1557: Not logging BucketNotFoundException

2016-06-20 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 2df86745a -> 83c7c6616


GEODE-1557: Not logging BucketNotFoundException

Not logging BucketNotFoundException as an error in LuceneEventLister and added
a test shouldIgnoreBucketNotFoundException to verify it

This closes #168


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

Branch: refs/heads/develop
Commit: 83c7c661648c9fd7b0dac054dde60e2ae1ef12cd
Parents: 2df8674
Author: Aparna Dharmakkan 
Authored: Thu Jun 16 16:07:04 2016 -0700
Committer: nabarun 
Committed: Mon Jun 20 16:51:34 2016 -0700

--
 .../lucene/internal/LuceneEventListener.java| 10 +++---
 .../internal/LuceneEventListenerJUnitTest.java  | 21 
 2 files changed, 28 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/83c7c661/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
--
diff --git 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
index ca8077d..a7150c0 100644
--- 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
+++ 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
@@ -36,6 +36,7 @@ import 
com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
 import com.gemstone.gemfire.internal.cache.BucketNotFoundException;
 import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
+import com.gemstone.gemfire.internal.cache.partitioned.Bucket;
 import 
com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy.TestHook;
 import com.gemstone.gemfire.internal.logging.LogService;
 
@@ -68,7 +69,7 @@ public class LuceneEventListener implements 
AsyncEventListener {
 Region region = event.getRegion();
 Object key = event.getKey();
 Object callbackArgument = event.getCallbackArgument();
-
+
 IndexRepository repository = repositoryManager.getRepository(region, 
key, callbackArgument);
 
 Operation op = event.getOperation();
@@ -86,12 +87,15 @@ public class LuceneEventListener implements 
AsyncEventListener {
 }
 affectedRepos.add(repository);
   }
-  
+
   for(IndexRepository repo : affectedRepos) {
 repo.commit();
   }
   return true;
-} catch(IOException | BucketNotFoundException e) {
+} catch(BucketNotFoundException e) {
+  logger.debug("Bucket not found while saving to lucene index: " + 
e.getMessage());
+  return false;
+} catch(IOException e) {
   logger.error("Unable to save to lucene index", e);
   return false;
 } finally {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/83c7c661/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
--
diff --git 
a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
 
b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
index 53c9db1..86ed481 100644
--- 
a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
+++ 
b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
@@ -18,13 +18,17 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal;
 
+import static org.junit.Assert.*;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.*;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.mockito.Mockito;
@@ -34,7 +38,9 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent;
 import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository;
 import com.gemstone.gemfire.cache.lucene.internal.repository.RepositoryManager;
+import com.gemstone.gemfire.internal.cache.BucketNotFoundException;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import 

[2/2] incubator-geode git commit: GEODE-11: Removed ParseException from LuceneQueryFactory.create, added LuceneQueryException

2016-06-16 Thread nnag
GEODE-11: Removed ParseException from LuceneQueryFactory.create, added 
LuceneQueryException

Adding a new exception to wrap lucene exceptions called LuceneQueryException. 
Removed lucene exceptions from the public API.


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

Branch: refs/heads/develop
Commit: 786c862e1c158859b90d52ee0d053507b65e8a01
Parents: 28d2ce0
Author: Aparna Dharmakkan 
Authored: Thu Jun 16 11:20:13 2016 -0700
Committer: nabarun 
Committed: Thu Jun 16 16:14:35 2016 -0700

--
 .../cache/lucene/LuceneQueryException.java  | 36 
 .../cache/lucene/LuceneQueryFactory.java|  4 +--
 .../cache/lucene/LuceneQueryProvider.java   |  5 +--
 .../lucene/internal/StringQueryProvider.java|  8 +++--
 .../internal/distributed/LuceneFunction.java|  3 +-
 .../lucene/LuceneQueriesIntegrationTest.java|  4 +--
 .../internal/StringQueryProviderJUnitTest.java  | 13 +++
 .../IndexRepositoryImplPerformanceTest.java |  5 +--
 8 files changed, 59 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/786c862e/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
--
diff --git 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
new file mode 100644
index 000..683b799
--- /dev/null
+++ 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
@@ -0,0 +1,36 @@
+/*
+ * 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 com.gemstone.gemfire.cache.lucene;
+
+import com.gemstone.gemfire.GemFireCheckedException;
+
+/**
+ * Thrown when a lucene query fails.
+ */
+public class LuceneQueryException extends GemFireCheckedException {
+
+  public LuceneQueryException(final String message) {
+super(message);
+  }
+
+  public LuceneQueryException(final String message, final Throwable cause) {
+super(message, cause);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/786c862e/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
--
diff --git 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
index a7844a2..8e36bbb 100644
--- 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
+++ 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
@@ -80,10 +80,8 @@ public interface LuceneQueryFactory {
* @param  the key type in the query results
* @param  the value type in the query results
* @return LuceneQuery object
-   * @throws ParseException
*/
-  public  LuceneQuery create(String indexName, String regionName, 
String queryString, String defaultField)
-  throws ParseException;
+  public  LuceneQuery create(String indexName, String regionName, 
String queryString, String defaultField);
 
   /**
* Creates a wrapper object for Lucene's Query object. This {@link 
LuceneQuery} builder method could be used in

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/786c862e/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryProvider.java
--
diff --git 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryProvider.java
 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryProvider.java
index 92a3a1c..7f1c269 100644

[1/2] incubator-geode git commit: GEODE-11: Added LuceneQueryException to search signature

2016-06-16 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 28d2ce069 -> 2fe3a4b2c


GEODE-11: Added LuceneQueryException to search signature

Search will now throw a LuceneQueryException if a query cannot be parsed.

This closes #163


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

Branch: refs/heads/develop
Commit: 2fe3a4b2cb0399f71b15c99824807d822f5e0ab0
Parents: 786c862
Author: Aparna Dharmakkan 
Authored: Thu Jun 16 14:12:42 2016 -0700
Committer: nabarun 
Committed: Thu Jun 16 16:14:35 2016 -0700

--
 .../gemfire/cache/lucene/LuceneQuery.java   |  2 +-
 .../cache/lucene/LuceneQueryException.java  |  4 +++
 .../cache/lucene/internal/LuceneQueryImpl.java  | 17 +++---
 ...IndexCreationPersistenceIntegrationTest.java | 17 +++---
 .../lucene/LuceneQueriesIntegrationTest.java| 34 ++--
 .../LuceneQueryImplIntegrationTest.java |  2 +-
 .../distributed/LuceneFunctionJUnitTest.java|  3 +-
 .../cache/lucene/test/LuceneTestUtilities.java  |  5 +--
 8 files changed, 46 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2fe3a4b2/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
--
diff --git 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
index 2de9c0b..93426b9 100644
--- 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
+++ 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
@@ -29,7 +29,7 @@ public interface LuceneQuery {
   /**
* Execute the search and get results. 
*/
-  public LuceneQueryResults search();
+  public LuceneQueryResults search() throws LuceneQueryException;
   
   /**
* Get page size setting of current query. 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2fe3a4b2/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
--
diff --git 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
index 683b799..fb03b4a 100644
--- 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
+++ 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryException.java
@@ -33,4 +33,8 @@ public class LuceneQueryException extends 
GemFireCheckedException {
   public LuceneQueryException(final String message, final Throwable cause) {
 super(message, cause);
   }
+
+  public LuceneQueryException(final Throwable cause) {
+super(cause);
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2fe3a4b2/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
--
diff --git 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
index c6b8878..92f1957 100644
--- 
a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
+++ 
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
@@ -20,9 +20,11 @@
 package com.gemstone.gemfire.cache.lucene.internal;
 
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.execute.FunctionException;
 import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.cache.lucene.LuceneQuery;
+import com.gemstone.gemfire.cache.lucene.LuceneQueryException;
 import com.gemstone.gemfire.cache.lucene.LuceneQueryFactory;
 import com.gemstone.gemfire.cache.lucene.LuceneQueryProvider;
 import com.gemstone.gemfire.cache.lucene.LuceneQueryResults;
@@ -55,7 +57,7 @@ public class LuceneQueryImpl implements LuceneQuery {
   }
 
   @Override
-  public LuceneQueryResults search() {
+  public LuceneQueryResults search() throws LuceneQueryException {
 TopEntriesCollectorManager manager = new TopEntriesCollectorManager(null, 
limit);
 LuceneFunctionContext context = new 
LuceneFunctionContext<>(query, indexName, manager, limit);
 

incubator-geode git commit: GEODE-1543: Change the log level from error to info

2016-06-15 Thread nnag
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f59e8d0b2 -> 612a9d995


GEODE-1543: Change the log level from error to info

* When multiple peers join the cluster conncurrently, only the first one 
that joins will distribute the index creation and other will try to create the 
index locally because of the distributed message and then log an error 
afterwards.
* This is an expected behaviour and hence should not be logged as error but 
rather as a info.

This closes #156


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

Branch: refs/heads/develop
Commit: 612a9d99566ac71421e5cd986c6ce6e391dedd30
Parents: f59e8d0
Author: nabarun 
Authored: Wed Jun 15 15:35:30 2016 -0700
Committer: nabarun 
Committed: Wed Jun 15 15:46:59 2016 -0700

--
 .../java/com/gemstone/gemfire/internal/cache/LocalRegion.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/612a9d99/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
--
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java 
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
index 8b9664f..e5897cc 100644
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
@@ -2452,8 +2452,9 @@ public class LocalRegion extends AbstractRegion
 indexes.add(qs.createIndex(icd.getIndexName(), icd.getIndexType(), 
icd.getIndexExpression(), fromClause, icd.getIndexImportString(), 
!isOverflowToDisk));
   }
 
-} catch (Exception ex) {
-  logger.error("Failed to create index {} on region {} with exception: 
{}", icd.getIndexName(), this.getFullPath(), ex);
+}
+catch (Exception ex) {
+  logger.info("Failed to create index {} on region {} with exception: 
{}", icd.getIndexName(), this.getFullPath(), ex);
 
   // Check if the region index creation is from cache.xml, in that 
case throw exception.
   // Other case is when bucket regions are created dynamically, in 
that case ignore the exception.