[geode] branch develop updated: Feature/expand pubsub support (#5284)

2020-06-25 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 5e2baea  Feature/expand pubsub support (#5284)
5e2baea is described below

commit 5e2baea7516b5e900f2699afddb63c59a20a1ab3
Author: Darrel Schneider 
AuthorDate: Thu Jun 25 05:47:48 2020 -0700

Feature/expand pubsub support (#5284)

Co-authored-by: Jens Deppe 
Co-authored-by: Sarah 
Co-authored-by: Darrel Schneider 
---
 geode-redis/build.gradle   |   1 +
 .../executor/pubsub/PubSubIntegrationTest.java | 329 +
 .../geode/redis/mocks/DummySubscription.java   |   5 +
 .../apache/geode/redis/mocks/MockSubscriber.java   |  53 
 .../geode/redis/internal/GeodeRedisServer.java |   4 +-
 .../geode/redis/internal/RedisCommandType.java |   4 +-
 .../executor/pubsub/PunsubscribeExecutor.java  |  56 +++-
 .../executor/pubsub/UnsubscribeExecutor.java   |  55 +++-
 .../apache/geode/redis/internal/netty/Coder.java   |   2 +-
 .../internal/netty/ExecutionHandlerContext.java|   7 +
 .../redis/internal/pubsub/ChannelSubscription.java |   4 +
 .../redis/internal/pubsub/PatternSubscription.java |   4 +
 .../apache/geode/redis/internal/pubsub/PubSub.java |  11 +
 .../geode/redis/internal/pubsub/PubSubImpl.java|  29 +-
 .../geode/redis/internal/pubsub/Subscription.java  |   6 +
 .../geode/redis/internal/pubsub/Subscriptions.java |  39 ++-
 geode-redis/src/test/resources/expected-pom.xml|  11 +
 17 files changed, 569 insertions(+), 51 deletions(-)

diff --git a/geode-redis/build.gradle b/geode-redis/build.gradle
index 6932b29..bd58ce7 100644
--- a/geode-redis/build.gradle
+++ b/geode-redis/build.gradle
@@ -38,6 +38,7 @@ dependencies {
   implementation('io.netty:netty-all')
   implementation('org.apache.logging.log4j:log4j-api')
   implementation('commons-codec:commons-codec')
+  implementation('org.apache.commons:commons-lang3')
 
   testImplementation(project(':geode-junit'))
   testImplementation('org.mockito:mockito-core')
diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubIntegrationTest.java
index 7389d5b..20c4a60 100644
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubIntegrationTest.java
@@ -22,6 +22,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -29,6 +30,7 @@ import org.junit.ClassRule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import redis.clients.jedis.Jedis;
+import redis.clients.jedis.Protocol;
 
 import org.apache.geode.redis.GeodeRedisServerRule;
 import org.apache.geode.redis.mocks.MockBinarySubscriber;
@@ -66,6 +68,27 @@ public class PubSubIntegrationTest {
   }
 
   @Test
+  @SuppressWarnings("unchecked")
+  public void punsubscribe_whenNonexistent() {
+assertThat((List) 
subscriber.sendCommand(Protocol.Command.PUNSUBSCRIBE, "Nonexistent"))
+.containsExactly("punsubscribe".getBytes(), "Nonexistent".getBytes(), 
0L);
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void unsubscribe_whenNoSubscriptionsExist_shouldNotHang() {
+assertThat((List) 
subscriber.sendCommand(Protocol.Command.UNSUBSCRIBE))
+.containsExactly("unsubscribe".getBytes(), null, 0L);
+  }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void punsubscribe_whenNoSubscriptionsExist_shouldNotHang() {
+assertThat((List) 
subscriber.sendCommand(Protocol.Command.PUNSUBSCRIBE))
+.containsExactly("punsubscribe".getBytes(), null, 0L);
+  }
+
+  @Test
   public void testOneSubscriberOneChannel() {
 List expectedMessages = Arrays.asList("hello");
 
@@ -90,6 +113,170 @@ public class PubSubIntegrationTest {
   }
 
   @Test
+  public void punsubscribe_givenSubscribe_doesNotReduceSubscriptions() {
+MockSubscriber mockSubscriber = new MockSubscriber();
+
+Runnable runnable = () -> {
+  subscriber.subscribe(mockSubscriber, "salutations");
+};
+
+Thread subscriberThread = new Thread(runnable);
+subscriberThread.start();
+try {
+  waitFor(() -> mockSubscriber.getSubscribedChannels() == 1);
+
+  mockSubscriber.punsubscribe("salutations");
+  waitFor(() -> mockSubscriber.punsubscribe

[geode] branch develop updated (9cc61bf -> 036e94f)

2020-06-25 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 9cc61bf  GEODE-8217: Deserialize attribute before update and remove. 
(#5256)
 add 036e94f  GEODE-8305: Revert "Feature/expand pubsub support (#5284)" 
(#5310)

No new revisions were added by this update.

Summary of changes:
 .../executor/pubsub/PubSubIntegrationTest.java | 329 -
 .../geode/redis/mocks/DummySubscription.java   |   5 -
 .../apache/geode/redis/mocks/MockSubscriber.java   |  53 
 .../geode/redis/internal/RedisCommandType.java |   4 +-
 .../executor/pubsub/PunsubscribeExecutor.java  |  56 +---
 .../executor/pubsub/UnsubscribeExecutor.java   |  55 +---
 .../apache/geode/redis/internal/netty/Coder.java   |   2 +-
 .../internal/netty/ExecutionHandlerContext.java|   7 -
 .../redis/internal/pubsub/ChannelSubscription.java |   4 -
 .../redis/internal/pubsub/PatternSubscription.java |   4 -
 .../apache/geode/redis/internal/pubsub/PubSub.java |  11 -
 .../geode/redis/internal/pubsub/PubSubImpl.java|  29 +-
 .../geode/redis/internal/pubsub/Subscription.java  |   6 -
 .../geode/redis/internal/pubsub/Subscriptions.java |  39 +--
 14 files changed, 50 insertions(+), 554 deletions(-)



[geode] branch develop updated (15d6d26 -> f84e9e8)

2020-06-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 15d6d26  First pass at switching to liberica jdk. (#5312)
 add f84e9e8  GEODE-8303: refactor Redis (String)SetExecutor (#5216)

No new revisions were added by this update.

Summary of changes:
 .../executor/string/SetIntegrationTest.java|  54 ++
 .../internal/executor/string/SetExecutor.java  | 209 +++--
 .../string/StringSetExecutorJUnitTest.java |  23 ++-
 3 files changed, 221 insertions(+), 65 deletions(-)



[geode] branch develop updated (868d4bc -> 13d17ec)

2020-07-07 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 868d4bc  GEODE-8330: Structural Improvements to Versioning
 add 13d17ec  GEODE-8313: Improve RedisData synchronization for toData 
(#5318)

No new revisions were added by this update.

Summary of changes:
 geode-redis/build.gradle   |   1 +
 .../executor/hash/HashesAndCrashesDUnitTest.java   | 314 +
 .../config/DUnitSocketAddressResolver.java |   6 +
 .../geode/redis/internal/data/RedisHash.java   |  47 ++-
 .../apache/geode/redis/internal/data/RedisSet.java |  36 ++-
 .../geode/redis/internal/data/RedisString.java |   9 +
 .../internal/executor/key/RenameFunction.java  |   6 +
 7 files changed, 398 insertions(+), 21 deletions(-)
 create mode 100644 
geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/hash/HashesAndCrashesDUnitTest.java



[geode] branch develop updated: GEODE-8351: DUnit tests for Delta Propagation (#5364)

2020-07-14 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 1ebd307  GEODE-8351: DUnit tests for Delta Propagation (#5364)
1ebd307 is described below

commit 1ebd307ae1ae87c53f0ff6b8f0c83ab2feda93cd
Author: Sarah Abbey <41928668+sabbeypivo...@users.noreply.github.com>
AuthorDate: Tue Jul 14 10:02:00 2020 -0400

GEODE-8351: DUnit tests for Delta Propagation (#5364)
---
 .../geode/redis/internal/data/DeltaDUnitTest.java  | 315 +
 .../redis/internal/data/ByteArrayWrapper.java  |   6 +-
 .../geode/redis/internal/data/NullRedisSet.java|   2 +
 .../apache/geode/redis/internal/data/RedisSet.java |   2 +
 4 files changed, 323 insertions(+), 2 deletions(-)

diff --git 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
new file mode 100644
index 000..e07e71b
--- /dev/null
+++ 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
@@ -0,0 +1,315 @@
+/*
+ * 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.redis.internal.data;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.function.Function;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.partition.PartitionRegionHelper;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.util.BlobHelper;
+import org.apache.geode.test.awaitility.GeodeAwaitility;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+
+@SuppressWarnings("unchecked")
+public class DeltaDUnitTest {
+
+  @ClassRule
+  public static RedisClusterStartupRule clusterStartUp = new 
RedisClusterStartupRule(4);
+
+  private static final String LOCAL_HOST = "127.0.0.1";
+  private static final int ITERATION_COUNT = 1000;
+  private static final int JEDIS_TIMEOUT =
+  Math.toIntExact(GeodeAwaitility.getTimeout().toMillis());
+  private static Jedis jedis1;
+  private static Jedis jedis2;
+
+  private static Properties locatorProperties;
+
+  private static MemberVM locator;
+  private static MemberVM server1;
+  private static MemberVM server2;
+
+  private static int redisServerPort1;
+  private static int redisServerPort2;
+
+  @BeforeClass
+  public static void classSetup() {
+locatorProperties = new Properties();
+locatorProperties.setProperty(MAX_WAIT_TIME_RECONNECT, "15000");
+
+locator = clusterStartUp.startLocatorVM(0, locatorProperties);
+server1 = clusterStartUp.startRedisVM(1, locator.getPort());
+server2 = clusterStartUp.startRedisVM(2, locator.getPort());
+
+redisServerPort1 = clusterStartUp.getRedisPort(1);
+redisServerPort2 = clusterStartUp.getRedisPort(2);
+
+jedis1 = new Jedis(LOCAL_HOST, redisServerPort1, JEDIS_TIMEOUT);
+jedis2 = new Jedis(LOCAL_HOST, redisServerPort2, JEDIS_TIMEOUT);
+  }
+
+  @Before
+  public void testSetup() {
+jedis1.flushAll();
+  }
+
+  @AfterClass
+  public static void tearDown() {
+jedis1.disconnect();
+jedis2.disconnect();
+
+server1.stop();
+server2.stop();
+  }
+
+  @Test
+  public void shouldCorrectlyPropagateDeltaToSecondaryServer_whenAppending() {
+String key = "key";
+String baseValue = "value-";
+jedis1.set(key, baseValue

[geode] branch develop updated: GEODE-8358: Run Geode Redis session tests against native Redis (#5373)

2020-07-16 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 86e3266  GEODE-8358: Run Geode Redis session tests against native 
Redis (#5373)
86e3266 is described below

commit 86e3266962911c2914cdecd222418cdab87df62d
Author: Sarah Abbey <41928668+sabbeypivo...@users.noreply.github.com>
AuthorDate: Thu Jul 16 15:23:48 2020 -0400

GEODE-8358: Run Geode Redis session tests against native Redis (#5373)
---
 geode-redis/build.gradle   |  6 ++
 .../session/NativeRedisSessionAcceptanceTest.java  | 65 ++
 ...NativeRedisSessionExpirationAcceptanceTest.java | 53 ++
 ...stDUnitTest.java => RedisSessionDUnitTest.java} | 10 +++-
 .../geode/redis/session/SessionDUnitTest.java  | 63 -
 .../redis/session/SessionExpirationDUnitTest.java  |  2 +-
 6 files changed, 182 insertions(+), 17 deletions(-)

diff --git a/geode-redis/build.gradle b/geode-redis/build.gradle
index 6c98e03..c06acb5 100644
--- a/geode-redis/build.gradle
+++ b/geode-redis/build.gradle
@@ -53,12 +53,18 @@ dependencies {
   integrationTestRuntime(project(':geode-log4j'))
 
   acceptanceTestImplementation(sourceSets.integrationTest.output)
+  acceptanceTestImplementation(sourceSets.distributedTest.output)
   acceptanceTestImplementation(sourceSets.commonTest.output)
   acceptanceTestImplementation(project(':geode-dunit'))
   acceptanceTestImplementation(project(':geode-junit'))
   acceptanceTestImplementation('redis.clients:jedis')
   acceptanceTestImplementation('org.testcontainers:testcontainers')
   acceptanceTestRuntime(project(':geode-log4j'))
+  
acceptanceTestImplementation('org.springframework.boot:spring-boot-starter-web')
 {
+exclude module: 'spring-boot-starter-tomcat'
+  }
+  
acceptanceTestImplementation('org.springframework.boot:spring-boot-starter-data-redis')
+  
acceptanceTestImplementation('org.springframework.session:spring-session-data-redis')
 
   distributedTestCompile('org.apache.logging.log4j:log4j-core')
   distributedTestImplementation(project(':geode-dunit'))
diff --git 
a/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.java
 
b/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.java
new file mode 100644
index 000..fcc45fd
--- /dev/null
+++ 
b/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.java
@@ -0,0 +1,65 @@
+/*
+ * 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 session;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.rules.TestRule;
+import org.testcontainers.containers.GenericContainer;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.redis.session.RedisSessionDUnitTest;
+import org.apache.geode.test.junit.rules.IgnoreOnWindowsRule;
+
+public class NativeRedisSessionAcceptanceTest extends RedisSessionDUnitTest {
+
+  @ClassRule
+  public static TestRule ignoreOnWindowsRule = new IgnoreOnWindowsRule();
+
+  @BeforeClass
+  public static void setup() {
+GenericContainer redisContainer = new 
GenericContainer<>("redis:5.0.6").withExposedPorts(6379);
+redisContainer.start();
+int[] availablePorts = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+ports.put(APP1, availablePorts[0]);
+ports.put(APP2, availablePorts[1]);
+ports.put(SERVER1, redisContainer.getFirstMappedPort());
+
+jedisConnetedToServer1 = new Jedis("localhost", ports.get(SERVER1), 
JEDIS_TIMEOUT);
+startSpringApp(APP1, SERVER1, DEFAULT_SESSION_TIMEOUT);
+startSpringApp(APP2, SERVER1, DEFAULT_SESSION_TIMEOUT);
+  }
+
+  @Test
+  @Ignore
+  public void should_getSessionFromServer1_whenServer2GoesDown() {
+// Only using one server for Native Redis
+  }
+
+  @Test
+  @

[geode] branch develop updated: GEODE-8365: Redis Delta not propagating updated hash values properly (#5377)

2020-07-17 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 28fb073  GEODE-8365: Redis Delta not propagating updated hash values 
properly (#5377)
28fb073 is described below

commit 28fb073f075d598608c99cdce03e611f3f633c4a
Author: Sarah Abbey <41928668+sabbeypivo...@users.noreply.github.com>
AuthorDate: Fri Jul 17 09:35:40 2020 -0400

GEODE-8365: Redis Delta not propagating updated hash values properly (#5377)
---
 .../session/NativeRedisSessionAcceptanceTest.java  |   4 +-
 ...NativeRedisSessionExpirationAcceptanceTest.java |   4 +-
 .../geode/redis/internal/data/DeltaDUnitTest.java  | 188 ++---
 .../geode/redis/session/RedisSessionDUnitTest.java |   4 +-
 .../geode/redis/session/SessionDUnitTest.java  |  26 +--
 .../redis/session/SessionExpirationDUnitTest.java  |   4 +-
 .../geode/redis/internal/data/RedisHash.java   |  12 +-
 7 files changed, 76 insertions(+), 166 deletions(-)

diff --git 
a/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.java
 
b/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.java
index fcc45fd..1103e5f 100644
--- 
a/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.java
+++ 
b/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.java
@@ -41,8 +41,8 @@ public class NativeRedisSessionAcceptanceTest extends 
RedisSessionDUnitTest {
 ports.put(SERVER1, redisContainer.getFirstMappedPort());
 
 jedisConnetedToServer1 = new Jedis("localhost", ports.get(SERVER1), 
JEDIS_TIMEOUT);
-startSpringApp(APP1, SERVER1, DEFAULT_SESSION_TIMEOUT);
-startSpringApp(APP2, SERVER1, DEFAULT_SESSION_TIMEOUT);
+startSpringApp(APP1, DEFAULT_SESSION_TIMEOUT, ports.get(SERVER1));
+startSpringApp(APP2, DEFAULT_SESSION_TIMEOUT, ports.get(SERVER1));
   }
 
   @Test
diff --git 
a/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionExpirationAcceptanceTest.java
 
b/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionExpirationAcceptanceTest.java
index 74ab68d..ec2a15e 100644
--- 
a/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionExpirationAcceptanceTest.java
+++ 
b/geode-redis/src/acceptanceTest/java/session/NativeRedisSessionExpirationAcceptanceTest.java
@@ -41,8 +41,8 @@ public class NativeRedisSessionExpirationAcceptanceTest 
extends SessionExpiratio
 ports.put(SERVER1, redisContainer.getFirstMappedPort());
 
 jedisConnetedToServer1 = new Jedis("localhost", ports.get(SERVER1), 
JEDIS_TIMEOUT);
-startSpringApp(APP1, SERVER1, SHORT_SESSION_TIMEOUT);
-startSpringApp(APP2, SERVER1, SHORT_SESSION_TIMEOUT);
+startSpringApp(APP1, SHORT_SESSION_TIMEOUT, ports.get(SERVER1));
+startSpringApp(APP2, SHORT_SESSION_TIMEOUT, ports.get(SERVER1));
   }
 
   @Test
diff --git 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
index e07e71b..036f0de 100644
--- 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
+++ 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
@@ -18,16 +18,12 @@ package org.apache.geode.redis.internal.data;
 import static 
org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
 import static org.assertj.core.api.Assertions.assertThat;
 
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Set;
-import java.util.function.Function;
+import java.util.Random;
 
 import org.junit.AfterClass;
 import org.junit.Before;
@@ -36,10 +32,9 @@ import org.junit.ClassRule;
 import org.junit.Test;
 import redis.clients.jedis.Jedis;
 
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.partition.PartitionRegionHelper;
+import org.apache.geode.internal.cache.BucketDump;
 import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.internal.util.BlobHelper;
+import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.test.awaitility.GeodeAwaitility;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
@@ -66,6 +61,7 @@ public class DeltaDUnitTest {
 
   private static int redisServerPort1;
   private static int redisServerPort2;
+  private static Random random;
 
   @BeforeClass
   public static void classSetup() {
@@ -81,6 +77,7 @@ public class DeltaDUnitTest {
 
 jedis1 = new Jedis(LOCAL_HOST, redisServerPort1, JEDIS_TIMEOUT);
 jed

[geode] branch develop updated (018339f -> 0a91484)

2020-08-10 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 018339f  GEODE-8409: S*STORE need to handle target that is not a redis 
set (#5429)
 add 0a91484  GEODE-8393: change memberDeparted to disconnect the 
connection (#5431)

No new revisions were added by this update.

Summary of changes:
 .../executor/CrashAndNoRepeatDUnitTest.java| 137 +
 .../executor/hash/HashesAndCrashesDUnitTest.java   |  34 +
 .../internal/executor/pubsub/PubSubDUnitTest.java  |  17 +--
 .../geode/redis/session/SessionDUnitTest.java  |  57 +++--
 .../internal/netty/ExecutionHandlerContext.java|  20 +--
 5 files changed, 86 insertions(+), 179 deletions(-)



[geode] branch develop updated: Revert "GEODE-8393: change memberDeparted to disconnect the connection (#5431)" (#5441)

2020-08-10 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new d19368f  Revert "GEODE-8393: change memberDeparted to disconnect the 
connection (#5431)" (#5441)
d19368f is described below

commit d19368f7eb676026d1f921eac4106ff465131cc0
Author: Darrel Schneider 
AuthorDate: Mon Aug 10 19:44:44 2020 -0700

Revert "GEODE-8393: change memberDeparted to disconnect the connection 
(#5431)" (#5441)

This reverts commit 0a91484b05f1caffa8cc3a59cc7fc38abe4376ed.
---
 .../executor/CrashAndNoRepeatDUnitTest.java| 137 -
 .../executor/hash/HashesAndCrashesDUnitTest.java   |  34 -
 .../internal/executor/pubsub/PubSubDUnitTest.java  |  17 ++-
 .../geode/redis/session/SessionDUnitTest.java  |  57 ++---
 .../internal/netty/ExecutionHandlerContext.java|  20 ++-
 5 files changed, 179 insertions(+), 86 deletions(-)

diff --git 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/CrashAndNoRepeatDUnitTest.java
 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/CrashAndNoRepeatDUnitTest.java
index b3d7741..b24ee7e 100644
--- 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/CrashAndNoRepeatDUnitTest.java
+++ 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/CrashAndNoRepeatDUnitTest.java
@@ -26,25 +26,30 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.util.Properties;
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Supplier;
 
+import io.lettuce.core.ClientOptions;
+import io.lettuce.core.RedisClient;
+import io.lettuce.core.RedisCommandExecutionException;
+import io.lettuce.core.api.StatefulRedisConnection;
+import io.lettuce.core.api.sync.RedisCommands;
+import io.lettuce.core.resource.ClientResources;
 import org.apache.logging.log4j.Logger;
+import org.junit.After;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
-import redis.clients.jedis.Jedis;
-import redis.clients.jedis.exceptions.JedisConnectionException;
 
 import org.apache.geode.cache.control.RebalanceFactory;
 import org.apache.geode.cache.control.RebalanceResults;
 import org.apache.geode.cache.control.ResourceManager;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.logging.internal.log4j.api.LogService;
-import org.apache.geode.test.awaitility.GeodeAwaitility;
+import 
org.apache.geode.redis.session.springRedisTestApplication.config.DUnitSocketAddressResolver;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.rules.ExecutorServiceRule;
@@ -68,9 +73,10 @@ public class CrashAndNoRepeatDUnitTest {
   private static MemberVM server3;
 
   private static int[] redisPorts;
-  private static final String LOCAL_HOST = "127.0.0.1";
-  private static final int JEDIS_TIMEOUT =
-  Math.toIntExact(GeodeAwaitility.getTimeout().toMillis());
+
+  private RedisClient redisClient;
+  private StatefulRedisConnection connection;
+  private RedisCommands commands;
 
   @Rule
   public ExecutorServiceRule executor = new ExecutorServiceRule();
@@ -113,11 +119,36 @@ public class CrashAndNoRepeatDUnitTest {
 
   }
 
-  private synchronized Jedis connect(AtomicReference jedisRef) {
-jedisRef.set(new Jedis(LOCAL_HOST, redisPorts[0], JEDIS_TIMEOUT));
-return jedisRef.get();
+  @Before
+  public void before() {
+String redisPort1 = "" + redisPorts[0];
+String redisPort2 = "" + redisPorts[1];
+String redisPort3 = "" + redisPorts[2];
+// For now only tell the client about redisPort1.
+// That server is never restarted so clients should
+// never fail due to the server they are connected to failing.
+DUnitSocketAddressResolver dnsResolver =
+new DUnitSocketAddressResolver(new String[] {redisPort1});
+
+ClientResources resources = ClientResources.builder()
+.socketAddressResolver(dnsResolver)
+.build();
+
+redisClient = RedisClient.create(resources, "redis://localhost");
+redisClient.setOptions(ClientOptions.builder()
+.autoReconnect(true)
+.build());
+connection = redisClient.connect();
+commands = connection.sync();
+  }
+
+  @After
+  public void after() {
+connection.close();
+redisClient.shutdown();
   }
 
+
   private MemberVM startRedisVM(int vmID, int redisPort) {
 int locatorPort = locator.getPort();
 return

[geode] branch develop updated: GEODE-8451 Redis PING response contains unneeded quotes (#5472)

2020-08-24 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 666ea7d  GEODE-8451 Redis PING response contains unneeded quotes 
(#5472)
666ea7d is described below

commit 666ea7d29ecfcb02974654eccfd7ffd8b7ec1a32
Author: John Hutchison 
AuthorDate: Mon Aug 24 23:24:52 2020 -0400

GEODE-8451 Redis PING response contains unneeded quotes (#5472)
---
 .../org/apache/geode/redis/internal/executor/RedisResponse.java| 4 
 .../geode/redis/internal/executor/connection/PingExecutor.java | 4 ++--
 .../src/main/java/org/apache/geode/redis/internal/netty/Coder.java | 7 +--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
index 75a91c1..8a6d153 100644
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
@@ -52,6 +52,10 @@ public class RedisResponse {
 return new RedisResponse((bba) -> Coder.getSimpleStringResponse(bba, 
stringValue));
   }
 
+  public static RedisResponse string(byte[] byteArray) {
+return new RedisResponse((bba) -> Coder.getSimpleStringResponse(bba, 
byteArray));
+  }
+
   public static RedisResponse bulkString(Object value) {
 return new RedisResponse((bba) -> {
   try {
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
index b66fe72..80a7c1a 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
@@ -30,10 +30,10 @@ public class PingExecutor extends AbstractExecutor {
   public RedisResponse executeCommand(Command command,
   ExecutionHandlerContext context) {
 List commandElems = command.getProcessedCommand();
-Object result = PING_RESPONSE;
+byte[] result = PING_RESPONSE.getBytes();
 if (commandElems.size() > 1) {
   result = commandElems.get(1);
 }
-return RedisResponse.bulkString(result);
+return RedisResponse.string(result);
   }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
index 6c06c08..9b20ee7 100644
--- a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
+++ b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
@@ -260,10 +260,13 @@ public class Coder {
 
   public static ByteBuf getSimpleStringResponse(ByteBufAllocator alloc, String 
string) {
 byte[] simpAr = stringToBytes(string);
+return getSimpleStringResponse(alloc, simpAr);
+  }
 
-ByteBuf response = alloc.buffer(simpAr.length + 20);
+  public static ByteBuf getSimpleStringResponse(ByteBufAllocator alloc, byte[] 
byteArray) {
+ByteBuf response = alloc.buffer(byteArray.length + 20);
 response.writeByte(SIMPLE_STRING_ID);
-response.writeBytes(simpAr);
+response.writeBytes(byteArray);
 response.writeBytes(CRLFar);
 return response;
   }



[geode] branch develop updated: GEODE-8451 Redis PING response contains unneeded quotes (#5472)

2020-08-24 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 666ea7d  GEODE-8451 Redis PING response contains unneeded quotes 
(#5472)
666ea7d is described below

commit 666ea7d29ecfcb02974654eccfd7ffd8b7ec1a32
Author: John Hutchison 
AuthorDate: Mon Aug 24 23:24:52 2020 -0400

GEODE-8451 Redis PING response contains unneeded quotes (#5472)
---
 .../org/apache/geode/redis/internal/executor/RedisResponse.java| 4 
 .../geode/redis/internal/executor/connection/PingExecutor.java | 4 ++--
 .../src/main/java/org/apache/geode/redis/internal/netty/Coder.java | 7 +--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
index 75a91c1..8a6d153 100644
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RedisResponse.java
@@ -52,6 +52,10 @@ public class RedisResponse {
 return new RedisResponse((bba) -> Coder.getSimpleStringResponse(bba, 
stringValue));
   }
 
+  public static RedisResponse string(byte[] byteArray) {
+return new RedisResponse((bba) -> Coder.getSimpleStringResponse(bba, 
byteArray));
+  }
+
   public static RedisResponse bulkString(Object value) {
 return new RedisResponse((bba) -> {
   try {
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
index b66fe72..80a7c1a 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/PingExecutor.java
@@ -30,10 +30,10 @@ public class PingExecutor extends AbstractExecutor {
   public RedisResponse executeCommand(Command command,
   ExecutionHandlerContext context) {
 List commandElems = command.getProcessedCommand();
-Object result = PING_RESPONSE;
+byte[] result = PING_RESPONSE.getBytes();
 if (commandElems.size() > 1) {
   result = commandElems.get(1);
 }
-return RedisResponse.bulkString(result);
+return RedisResponse.string(result);
   }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
index 6c06c08..9b20ee7 100644
--- a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
+++ b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
@@ -260,10 +260,13 @@ public class Coder {
 
   public static ByteBuf getSimpleStringResponse(ByteBufAllocator alloc, String 
string) {
 byte[] simpAr = stringToBytes(string);
+return getSimpleStringResponse(alloc, simpAr);
+  }
 
-ByteBuf response = alloc.buffer(simpAr.length + 20);
+  public static ByteBuf getSimpleStringResponse(ByteBufAllocator alloc, byte[] 
byteArray) {
+ByteBuf response = alloc.buffer(byteArray.length + 20);
 response.writeByte(SIMPLE_STRING_ID);
-response.writeBytes(simpAr);
+response.writeBytes(byteArray);
 response.writeBytes(CRLFar);
 return response;
   }



[geode] branch develop updated: GEODE-8459: Redis API for Geode handles errors when member disconnects (#5481)

2020-08-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new cecf003  GEODE-8459: Redis API for Geode handles errors when member 
disconnects (#5481)
cecf003 is described below

commit cecf0035be9ea02b8ff66749f61ce93c026646ca
Author: Sarah Abbey <41928668+sabbeypivo...@users.noreply.github.com>
AuthorDate: Wed Aug 26 16:16:27 2020 -0400

GEODE-8459: Redis API for Geode handles errors when member disconnects 
(#5481)
---
 .../geode/redis/internal/netty/ExecutionHandlerContext.java   | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
index 9eb06ed..e3f5546 100644
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/ExecutionHandlerContext.java
@@ -31,9 +31,11 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.handler.codec.DecoderException;
 import org.apache.logging.log4j.Logger;
 
+import org.apache.geode.ForcedDisconnectException;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.execute.FunctionException;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
+import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.logging.internal.log4j.api.LogService;
 import org.apache.geode.redis.internal.GeodeRedisServer;
 import 
org.apache.geode.redis.internal.ParameterRequirements.RedisParametersMismatchException;
@@ -167,8 +169,10 @@ public class ExecutionHandlerContext extends 
ChannelInboundHandlerAdapter {
 } else if (cause instanceof IllegalStateException
 || cause instanceof RedisParametersMismatchException) {
   response = RedisResponse.error(cause.getMessage());
-} else if (cause instanceof FunctionInvocationTargetException) {
-  // This indicates a member departed
+} else if (cause instanceof FunctionInvocationTargetException
+|| cause instanceof DistributedSystemDisconnectedException
+|| cause instanceof ForcedDisconnectException) {
+  // This indicates a member departed or got disconnected
   logger.warn(
   "Closing client connection because one of the servers doing this 
operation departed.");
   channelInactive(ctx);



[geode] branch develop updated: GEODE-8448: Update README based on user feedback (#5470)

2020-08-27 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 0c2a8a3  GEODE-8448: Update README based on user feedback (#5470)
0c2a8a3 is described below

commit 0c2a8a3f2cc7d57cc7ddfd47944aa0fecb4f6655
Author: Ray Ingles 
AuthorDate: Thu Aug 27 09:24:48 2020 -0400

GEODE-8448: Update README based on user feedback (#5470)


Co-authored-by: Ray Ingles 
---
 geode-redis/README.md | 53 ---
 1 file changed, 46 insertions(+), 7 deletions(-)

diff --git a/geode-redis/README.md b/geode-redis/README.md
index a4be1de..cdd9bc3 100644
--- a/geode-redis/README.md
+++ b/geode-redis/README.md
@@ -6,19 +6,26 @@
 [Starting a Geode Server with Redis Enabled](#starting-a-server)  
 [Adding an Additional Geode Redis Server](#adding-a-server)  
 [Shutting Down](#shutting-down)  
-[Redis Commands](#redis-commands)  
+[Redis Commands](#redis-commands)
+
 
 ## Introduction
 
 The Redis API for Geode allows an application to send Redis commands to Geode. 
This will allow users to 
 switch seamlessly from native Redis to Geode as a data store/caching solution. 
 
-The API allows Geode to listen for and interpret incoming Redis commands on a 
designated port.  The 
-current set of supported Redis commands are listed [here](#redis-commands). 
+The API allows Geode to listen for and interpret incoming Redis commands on a 
designated port.
 
 ## How To Try It
 
-We’ll build the develop branch of Apache Geode and then connect the 
[Redis-CLI](https://redis.io/topics/quickstart) to that instance.
+The Redis API for Geode is currently in early access. We’ll build the develop 
branch of Apache Geode
+and then connect the [Redis-CLI](https://redis.io/topics/quickstart) to that 
instance.
+
+**Note:** Currently Geode requires **Java 8 JDK** to build.
+
+### Supported Redis Commands
+
+Not all Redis commands are currently supported. The current set of supported 
Redis commands is listed [here](#redis-command-status).
 
 ### Building Apache Geode
 The Apache Geode source code can be found here
@@ -35,7 +42,7 @@ The Apache Geode source code can be found here
 
 3. Build the Geode application without running the test (REQUIRES JAVA 8)
 ```commandline
-$ ./gradlew build -x test
+$ ./gradlew assemble
```
 
 4. Once the build has completed, navigate to the geode-assembly directory 
which contains the Apache 
@@ -54,10 +61,15 @@ You should now see GFSH starting up with a version of 
1.14.x.-build.x
 ![screenshot of GFSH running in the terminal](gfsh.png)
 
 ### Starting a Geode Server with Redis Enabled
+**Note**: if you wish to run the Geode Redis API on the default Redis port 
(6379), make sure to stop
+any applications running on that port before starting the Geode server, 
especially any native Redis
+servers.
+
 Using GFSH enter the following commands:
 
 1. Start a locator. The locator tracks servers and server load. When a client 
requests a server 
-connection, the locator directs the client to one of the least loaded servers. 
Learn more. 
+connection, the locator directs the client to one of the least loaded servers.
+[Learn 
more](https://geode.apache.org/docs/guide/12/configuring/running/running_the_locator.html).
 
```commandline
 gfsh> start locator
 ``` 
@@ -86,7 +98,7 @@ connection, the locator directs the client to one of the 
least loaded servers. L
 If working correctly you should now be in the redis-cli and see 
`127.0.0.1:6379>`.  If you run the 
 `PING` command you should receive a response of `PONG`.
 
-### Adding an Additional Geode Redis Server 
+### Optional - Adding an Additional Geode Redis 
Server
 If you’re interested in testing Geode scalability, in GFSH run the start 
server command again BUT 
 make sure you change the `--name=` and `--redis-port=` parameters. 
 
@@ -116,6 +128,33 @@ not connected>
 ```
 ### Redis Commands
 
+The Redis API for Geode currently implements a subset of the full Redis 
command set. Some commands
+are **unsupported** (see table below). Unsupported commands are available to 
use, but have not been
+fully tested. There is no guarantee they will work exactly as expected.
+
+ Enabling Unsupported Commands
+
+If you already have Geode servers running with Redis enabled, you can execute 
the following
+command with gfsh to enable unsupported commands:
+
+```pre
+redis --enable-unsupported-commands
+```
+
+You can also enable unsupported commands when you start the Geode server by 
setting the Java property `enable-redis-unsupported-commands=true`:
+
+```pre
+start server \
+  --J=-Denable-redis-unsupported-commands=true \
+  --name= \
+  --locators= \
+  --redis-port= \
+  --redis-bind-address= \
+  --redis-password=
+```
+
+ Redis Command Status [Return to 
top](#introduction)
+
 | 

[geode] branch develop updated: GEODE-8333: Change Redis adapter threading model - fixes pubsub issues (#5488)

2020-08-31 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 27b8e47  GEODE-8333: Change Redis adapter threading model - fixes 
pubsub issues (#5488)
27b8e47 is described below

commit 27b8e47e9f6e433dc71bffc5420ebcb51f79797e
Author: Jens Deppe 
AuthorDate: Mon Aug 31 16:22:11 2020 -0700

GEODE-8333: Change Redis adapter threading model - fixes pubsub issues 
(#5488)


- Do not use Netty threads for the entire request lifecycle. Each
  instance of ExecutionHandlerContext (essentially each client
  connection) uses a command queue which is actioned by a single thread
  taken from the Geode 'waiting pool'.
- Every SUBSCRIBEed client is moved to a separate EventGroupLoop so that
  PUBLISHed messages are not sent back using the 'normal' Worker
  EventLoopGroup. This avoids a deadlock issue where PUBLISHed messages
  need to be sent using the same thread that the PUBLISH response needs
  to happen on.
- Fix issues with PubSub where switching the EventLoopGroup may fail
  (because a client has already closed the connection) thus resulting in
  hanging PUBLISHers waiting for a Subscription to be marked as
  'readyForPublish'.
- Consolidate various MockSubscriber classes
---
 .../src/test/resources/expected-pom.xml|   6 +
 .../gradle/plugins/DependencyConstraints.groovy|   1 +
 geode-redis/build.gradle   |   4 +
 .../pubsub/PubSubNativeRedisAcceptanceTest.java|   5 +-
 .../geode/redis/mocks/MockBinarySubscriber.java|   0
 .../apache/geode/redis/mocks/MockSubscriber.java   | 100 +--
 .../org/apache/geode/redis/MockSubscriber.java |  62 ---
 .../internal/executor/pubsub/PubSubDUnitTest.java  | 196 +++--
 .../geode/redis/session/RedisSessionDUnitTest.java |  45 +
 .../pubsub/LettucePubSubIntegrationTest.java   |  98 +++
 .../executor/pubsub/PubSubIntegrationTest.java | 182 ++-
 .../pubsub/SubscriptionsIntegrationTest.java   |   6 +-
 .../geode/redis/mocks/DummySubscription.java   |   6 +
 .../geode/redis/internal/GeodeRedisServer.java |   4 +-
 .../redis/internal/executor/RedisResponse.java |  12 ++
 .../executor/pubsub/PsubscribeExecutor.java|  46 +++--
 .../internal/executor/pubsub/PublishExecutor.java  |   9 +-
 .../executor/pubsub/SubscribeExecutor.java |  37 +++-
 .../apache/geode/redis/internal/netty/Command.java |  30 
 .../internal/netty/ExecutionHandlerContext.java| 175 +++---
 .../redis/internal/netty/NettyRedisServer.java |  11 +-
 .../internal/pubsub/AbstractSubscription.java  |  72 +---
 .../redis/internal/pubsub/ChannelSubscription.java |   5 +-
 .../redis/internal/pubsub/PatternSubscription.java |   5 +-
 .../apache/geode/redis/internal/pubsub/PubSub.java |   8 +-
 .../geode/redis/internal/pubsub/PubSubImpl.java|   6 +-
 .../redis/internal/pubsub/SubscribeResult.java}|  42 ++---
 .../geode/redis/internal/pubsub/Subscription.java  |   7 +
 .../geode/redis/internal/pubsub/Subscriptions.java |  23 ++-
 .../redis/internal/pubsub/PubSubImplJUnitTest.java |   9 +-
 .../internal/pubsub/SubscriptionsJUnitTest.java|  27 +--
 31 files changed, 930 insertions(+), 309 deletions(-)

diff --git a/boms/geode-all-bom/src/test/resources/expected-pom.xml 
b/boms/geode-all-bom/src/test/resources/expected-pom.xml
index 9013d57..40e1920 100644
--- a/boms/geode-all-bom/src/test/resources/expected-pom.xml
+++ b/boms/geode-all-bom/src/test/resources/expected-pom.xml
@@ -548,6 +548,12 @@
 compile
   
   
+io.lettuce
+lettuce-core
+5.2.1.RELEASE
+compile
+  
+  
 xerces
 xercesImpl
 2.12.0
diff --git 
a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
 
b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
index 860dafe..37d2c2e 100644
--- 
a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
+++ 
b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
@@ -169,6 +169,7 @@ class DependencyConstraints implements Plugin {
 api(group: 'org.testcontainers', name: 'testcontainers', version: 
'1.13.0')
 api(group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.0')
 api(group: 'redis.clients', name: 'jedis', version: '3.2.0')
+api(group: 'io.lettuce', name: 'lettuce-core', version: 
'5.2.1.RELEASE')
 api(group: 'xerces', name: 'xercesImpl', version: '2.12.0

[geode] branch develop updated: GEODE-8462: Make geode server startup fail if geode redis server has a port conflict (#5483)

2020-09-03 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 1076193  GEODE-8462: Make geode server startup fail if geode redis 
server has a port conflict (#5483)
1076193 is described below

commit 10761930ab59cd3168c1334e882c9256f03d0055
Author: John Hutchison 
AuthorDate: Thu Sep 3 09:15:15 2020 -0400

GEODE-8462: Make geode server startup fail if geode redis server has a port 
conflict (#5483)


Co-authored-by: Sarah Abbey 
Co-authored-by: john Hutchison 
Co-authored-by: Ray Ingles 
---
 .../geode/test/junit/rules/gfsh/GfshExecution.java | 32 +---
 geode-redis/build.gradle   |  4 +
 .../GeodeRedisServerStartUpAcceptanceTest.java | 96 ++
 .../key/ExpireAtNativeRedisAcceptanceTest.java |  6 +-
 .../redis/GeodeRedisServerStartupDUnitTest.java| 15 +++-
 .../redis/internal/netty/NettyRedisServer.java | 22 +++--
 6 files changed, 158 insertions(+), 17 deletions(-)

diff --git 
a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/gfsh/GfshExecution.java
 
b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/gfsh/GfshExecution.java
index 7ef3150..1225bba 100644
--- 
a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/gfsh/GfshExecution.java
+++ 
b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/gfsh/GfshExecution.java
@@ -46,10 +46,20 @@ public class GfshExecution {
   private static final String SCRIPT_EXIT_VALUE_DESCRIPTION =
   "Exit value from process started by [%s]";
 
+  private static final Predicate IS_RUNNING_SERVER_DIRECTORY =
+  directory -> stream(directory.list())
+  .anyMatch(filename -> filename.endsWith("server.pid"));
+
   private static final Predicate IS_SERVER_DIRECTORY = directory -> 
stream(directory.list())
-  .anyMatch(filename -> filename.endsWith("server.pid"));
+  .anyMatch(filename -> filename.endsWith("server.pid") || 
filename.contains("server.status"));
+
+  private static final Predicate IS_RUNNING_LOCATOR_DIRECTORY =
+  directory -> stream(directory.list())
+  .anyMatch(filename -> filename.endsWith("locator.pid"));
+
   private static final Predicate IS_LOCATOR_DIRECTORY = directory -> 
stream(directory.list())
-  .anyMatch(filename -> filename.endsWith("locator.pid"));
+  .anyMatch(
+  filename -> filename.endsWith("locator.pid") || 
filename.contains("locator.status"));
 
   private final Process process;
   private final File workingDir;
@@ -121,10 +131,10 @@ public class GfshExecution {
   }
 
   String[] getStopMemberCommands() {
-Stream stopServers = getServerDirs()
+Stream stopServers = getServerDirs(true)
 .stream()
 .map(f -> "stop server --dir=" + quoteArgument(f.toString()));
-Stream stopLocators = getLocatorDirs()
+Stream stopLocators = getLocatorDirs(true)
 .stream()
 .map(f -> "stop locator --dir=" + quoteArgument(f.toString()));
 return concat(stopServers, stopLocators)
@@ -150,17 +160,19 @@ public class GfshExecution {
 }
   }
 
-  private List getServerDirs() {
+  private List getServerDirs(boolean isRunning) {
+Predicate predicate = isRunning ? IS_RUNNING_SERVER_DIRECTORY : 
IS_SERVER_DIRECTORY;
 return findPotentialMemberDirectories()
 .stream()
-.filter(IS_SERVER_DIRECTORY)
+.filter(predicate)
 .collect(toList());
   }
 
-  private List getLocatorDirs() {
+  private List getLocatorDirs(boolean isRunning) {
+Predicate predicate = isRunning ? IS_RUNNING_LOCATOR_DIRECTORY : 
IS_LOCATOR_DIRECTORY;
 return findPotentialMemberDirectories()
 .stream()
-.filter(IS_LOCATOR_DIRECTORY)
+.filter(predicate)
 .collect(toList());
   }
 
@@ -178,8 +190,8 @@ public class GfshExecution {
   }
 
   private List findLogFiles() {
-List servers = getServerDirs();
-List locators = getLocatorDirs();
+List servers = getServerDirs(false);
+List locators = getLocatorDirs(false);
 
 return concat(servers.stream(), locators.stream())
 .flatMap(GfshExecution::findLogFiles)
diff --git a/geode-redis/build.gradle b/geode-redis/build.gradle
index 0d9a3f8..bf23fd1 100644
--- a/geode-redis/build.gradle
+++ b/geode-redis/build.gradle
@@ -92,6 +92,10 @@ configurations{
   }
 }
 
+acceptanceTest {
+  environment 'GEODE_HOME', 
"$buildDir/../../geode-assembly/build/install/apache-geode"
+}
+
 tasks.register("redisAPITest") {
   dependsOn ':geode-assembly:installDist'
   doLast {
diff --git 
a/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/GeodeRedisServe

[geode] branch develop updated (8a7b1fc -> 5d4d4a3)

2020-09-10 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 8a7b1fc  GEODE-8465: secondary HARegionQueue to sync with primary 
queue (#5496)
 add 5d4d4a3  GEODE-8393: Add sequence number to RedisString to support 
delta and APPEND (#5504)

No new revisions were added by this update.

Summary of changes:
 .../executor/CrashAndNoRepeatDUnitTest.java| 44 --
 .../codeAnalysis/sanctionedDataSerializables.txt   |  8 ++--
 .../redis/internal/data/AbstractRedisData.java |  4 +-
 .../geode/redis/internal/data/RedisString.java | 18 -
 .../redis/internal/delta/AppendDeltaInfo.java  |  9 -
 5 files changed, 56 insertions(+), 27 deletions(-)



[geode] branch develop updated (8a7b1fc -> 5d4d4a3)

2020-09-10 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 8a7b1fc  GEODE-8465: secondary HARegionQueue to sync with primary 
queue (#5496)
 add 5d4d4a3  GEODE-8393: Add sequence number to RedisString to support 
delta and APPEND (#5504)

No new revisions were added by this update.

Summary of changes:
 .../executor/CrashAndNoRepeatDUnitTest.java| 44 --
 .../codeAnalysis/sanctionedDataSerializables.txt   |  8 ++--
 .../redis/internal/data/AbstractRedisData.java |  4 +-
 .../geode/redis/internal/data/RedisString.java | 18 -
 .../redis/internal/delta/AppendDeltaInfo.java  |  9 -
 5 files changed, 56 insertions(+), 27 deletions(-)



[geode] branch develop updated (8a7b1fc -> 5d4d4a3)

2020-09-10 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 8a7b1fc  GEODE-8465: secondary HARegionQueue to sync with primary 
queue (#5496)
 add 5d4d4a3  GEODE-8393: Add sequence number to RedisString to support 
delta and APPEND (#5504)

No new revisions were added by this update.

Summary of changes:
 .../executor/CrashAndNoRepeatDUnitTest.java| 44 --
 .../codeAnalysis/sanctionedDataSerializables.txt   |  8 ++--
 .../redis/internal/data/AbstractRedisData.java |  4 +-
 .../geode/redis/internal/data/RedisString.java | 18 -
 .../redis/internal/delta/AppendDeltaInfo.java  |  9 -
 5 files changed, 56 insertions(+), 27 deletions(-)



[geode] branch develop updated (8a7b1fc -> 5d4d4a3)

2020-09-10 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 8a7b1fc  GEODE-8465: secondary HARegionQueue to sync with primary 
queue (#5496)
 add 5d4d4a3  GEODE-8393: Add sequence number to RedisString to support 
delta and APPEND (#5504)

No new revisions were added by this update.

Summary of changes:
 .../executor/CrashAndNoRepeatDUnitTest.java| 44 --
 .../codeAnalysis/sanctionedDataSerializables.txt   |  8 ++--
 .../redis/internal/data/AbstractRedisData.java |  4 +-
 .../geode/redis/internal/data/RedisString.java | 18 -
 .../redis/internal/delta/AppendDeltaInfo.java  |  9 -
 5 files changed, 56 insertions(+), 27 deletions(-)



[geode] branch develop updated (8a7b1fc -> 5d4d4a3)

2020-09-10 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 8a7b1fc  GEODE-8465: secondary HARegionQueue to sync with primary 
queue (#5496)
 add 5d4d4a3  GEODE-8393: Add sequence number to RedisString to support 
delta and APPEND (#5504)

No new revisions were added by this update.

Summary of changes:
 .../executor/CrashAndNoRepeatDUnitTest.java| 44 --
 .../codeAnalysis/sanctionedDataSerializables.txt   |  8 ++--
 .../redis/internal/data/AbstractRedisData.java |  4 +-
 .../geode/redis/internal/data/RedisString.java | 18 -
 .../redis/internal/delta/AppendDeltaInfo.java  |  9 -
 5 files changed, 56 insertions(+), 27 deletions(-)



[geode] branch develop updated: GEODE-8490: Docker containers are not properly cleaned up after native Redis acceptance tests (#5508)

2020-09-14 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new bb046ec  GEODE-8490: Docker containers are not properly cleaned up 
after native Redis acceptance tests (#5508)
bb046ec is described below

commit bb046eca6cf5f079452bf42b655ab21e435202b7
Author: Sarah Abbey <41928668+sabbeypivo...@users.noreply.github.com>
AuthorDate: Mon Sep 14 13:09:11 2020 -0400

GEODE-8490: Docker containers are not properly cleaned up after native 
Redis acceptance tests (#5508)
---
 .../test/junit/rules/IgnoreOnWindowsRule.java  |  2 +-
 geode-redis/build.gradle   |  1 +
 .../GlobPatternNativeRedisAcceptanceTest.java  | 13 +
 .../connection/AuthNativeRedisAcceptanceTest.java  | 12 ++--
 .../connection/PingNativeRedisAcceptanceTest.java  | 14 +
 .../hash/HashesNativeRedisAcceptanceTest.java  | 17 ++
 .../executor/key/DelNativeRedisAcceptanceTest.java | 16 ++
 .../key/ExistsNativeRedisAcceptanceTest.java   | 21 ++-
 .../key/ExpireAtNativeRedisAcceptanceTest.java | 20 +--
 .../key/ExpireNativeRedisAcceptanceTest.java   | 18 +-
 .../key/KeysNativeRedisAcceptanceTest.java | 16 +-
 .../key/PTTLNativeRedisAcceptanceTest.java | 13 +
 .../key/PersistNativeRedisAcceptanceTest.java  | 18 ++
 .../key/PexpireNativeRedisAcceptanceTest.java  | 16 +-
 .../key/RenameNativeRedisAcceptanceTest.java   | 17 ++
 .../executor/key/TTLNativeRedisAcceptanceTest.java | 13 +
 .../key/TypeNativeRedisAcceptanceTest.java | 13 +
 .../pubsub/PubSubNativeRedisAcceptanceTest.java| 22 ++--
 .../set/SDiffNativeRedisAcceptanceTest.java| 18 ++
 .../set/SInterNativeRedisAcceptanceTest.java   | 18 ++
 .../set/SIsMemberNativeRedisAcceptanceTest.java| 16 +-
 .../set/SMoveNativeRedisAcceptanceTest.java| 18 ++
 .../set/SPopNativeRedisAcceptanceTest.java | 17 ++
 .../set/SRemNativeRedisAcceptanceTest.java | 18 ++
 .../set/SUnionNativeRedisAcceptanceTest.java   | 17 ++
 .../set/SetsNativeRedisAcceptanceTest.java | 18 ++
 .../string/AppendNativeRedisAcceptanceTest.java| 15 ++---
 .../string/BitCountNativeRedisAcceptanceTest.java  | 12 +---
 .../string/BitOpNativeRedisAcceptanceTest.java | 13 +
 .../string/BitPosNativeRedisAcceptanceTest.java| 13 +
 .../string/DecrByNativeRedisAcceptanceTest.java| 13 +
 .../string/DecrNativeRedisAcceptanceTest.java  | 15 ++---
 .../string/GetBitNativeRedisAcceptanceTest.java| 13 +
 .../string/GetNativeRedisAcceptanceTest.java   | 13 +
 .../string/GetRangeNativeRedisAcceptanceTest.java  | 13 +
 .../string/GetSetNativeRedisAcceptanceTest.java| 15 ++---
 .../IncrByFloatNativeRedisAcceptanceTest.java  | 13 +
 .../string/IncrByNativeRedisAcceptanceTest.java| 13 +
 .../string/IncrNativeRedisAcceptanceTest.java  | 15 ++---
 .../string/MGetNativeRedisAcceptanceTest.java  | 13 +
 .../string/MSetNXNativeRedisAcceptanceTest.java| 13 +
 .../string/MSetNativeRedisAcceptanceTest.java  | 15 ++---
 .../string/PSetEXNativeRedisAcceptanceTest.java| 13 +
 .../string/SetBitNativeRedisAcceptanceTest.java| 13 +
 .../string/SetExNativeRedisAcceptanceTest.java | 13 +
 .../string/SetNXNativeRedisAcceptanceTest.java | 13 +
 .../string/SetNativeRedisAcceptanceTest.java   | 15 ++---
 .../string/SetRangeNativeRedisAcceptanceTest.java  | 13 +
 .../string/StrLenNativeRedisAcceptanceTest.java| 13 +
 .../session/NativeRedisSessionAcceptanceTest.java  | 10 +---
 ...NativeRedisSessionExpirationAcceptanceTest.java | 11 +---
 .../java/org/apache/geode/NativeRedisTestRule.java | 66 ++
 .../executor/connection/AuthIntegrationTest.java   |  3 -
 53 files changed, 242 insertions(+), 560 deletions(-)

diff --git 
a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
 
b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
index a1d12da..81a6af8 100644
--- 
a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
+++ 
b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
@@ -30,6 +30,6 @@ import org.junit.rules.RuleChain;
 public class IgnoreOnWindowsRule extends ExternalResource implements 
Serializable {
   @Override
   protected void before() throws Throwable {
-Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS);
+Assume.assumeFalse("Test ignored on Windows.", SystemUtils.IS_OS_WINDOWS);
   }
 }
diff --git a/geode-redis/build.gradle b/geode-redis/build.gradle
index bf23fd1..bd332e3 100644
--- a/geode-redis/build.gradle
+++ b/geode-redis/build.gradl

[geode] branch develop updated: GEODE-8490: Docker containers are not properly cleaned up after native Redis acceptance tests (#5508)

2020-09-14 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new bb046ec  GEODE-8490: Docker containers are not properly cleaned up 
after native Redis acceptance tests (#5508)
bb046ec is described below

commit bb046eca6cf5f079452bf42b655ab21e435202b7
Author: Sarah Abbey <41928668+sabbeypivo...@users.noreply.github.com>
AuthorDate: Mon Sep 14 13:09:11 2020 -0400

GEODE-8490: Docker containers are not properly cleaned up after native 
Redis acceptance tests (#5508)
---
 .../test/junit/rules/IgnoreOnWindowsRule.java  |  2 +-
 geode-redis/build.gradle   |  1 +
 .../GlobPatternNativeRedisAcceptanceTest.java  | 13 +
 .../connection/AuthNativeRedisAcceptanceTest.java  | 12 ++--
 .../connection/PingNativeRedisAcceptanceTest.java  | 14 +
 .../hash/HashesNativeRedisAcceptanceTest.java  | 17 ++
 .../executor/key/DelNativeRedisAcceptanceTest.java | 16 ++
 .../key/ExistsNativeRedisAcceptanceTest.java   | 21 ++-
 .../key/ExpireAtNativeRedisAcceptanceTest.java | 20 +--
 .../key/ExpireNativeRedisAcceptanceTest.java   | 18 +-
 .../key/KeysNativeRedisAcceptanceTest.java | 16 +-
 .../key/PTTLNativeRedisAcceptanceTest.java | 13 +
 .../key/PersistNativeRedisAcceptanceTest.java  | 18 ++
 .../key/PexpireNativeRedisAcceptanceTest.java  | 16 +-
 .../key/RenameNativeRedisAcceptanceTest.java   | 17 ++
 .../executor/key/TTLNativeRedisAcceptanceTest.java | 13 +
 .../key/TypeNativeRedisAcceptanceTest.java | 13 +
 .../pubsub/PubSubNativeRedisAcceptanceTest.java| 22 ++--
 .../set/SDiffNativeRedisAcceptanceTest.java| 18 ++
 .../set/SInterNativeRedisAcceptanceTest.java   | 18 ++
 .../set/SIsMemberNativeRedisAcceptanceTest.java| 16 +-
 .../set/SMoveNativeRedisAcceptanceTest.java| 18 ++
 .../set/SPopNativeRedisAcceptanceTest.java | 17 ++
 .../set/SRemNativeRedisAcceptanceTest.java | 18 ++
 .../set/SUnionNativeRedisAcceptanceTest.java   | 17 ++
 .../set/SetsNativeRedisAcceptanceTest.java | 18 ++
 .../string/AppendNativeRedisAcceptanceTest.java| 15 ++---
 .../string/BitCountNativeRedisAcceptanceTest.java  | 12 +---
 .../string/BitOpNativeRedisAcceptanceTest.java | 13 +
 .../string/BitPosNativeRedisAcceptanceTest.java| 13 +
 .../string/DecrByNativeRedisAcceptanceTest.java| 13 +
 .../string/DecrNativeRedisAcceptanceTest.java  | 15 ++---
 .../string/GetBitNativeRedisAcceptanceTest.java| 13 +
 .../string/GetNativeRedisAcceptanceTest.java   | 13 +
 .../string/GetRangeNativeRedisAcceptanceTest.java  | 13 +
 .../string/GetSetNativeRedisAcceptanceTest.java| 15 ++---
 .../IncrByFloatNativeRedisAcceptanceTest.java  | 13 +
 .../string/IncrByNativeRedisAcceptanceTest.java| 13 +
 .../string/IncrNativeRedisAcceptanceTest.java  | 15 ++---
 .../string/MGetNativeRedisAcceptanceTest.java  | 13 +
 .../string/MSetNXNativeRedisAcceptanceTest.java| 13 +
 .../string/MSetNativeRedisAcceptanceTest.java  | 15 ++---
 .../string/PSetEXNativeRedisAcceptanceTest.java| 13 +
 .../string/SetBitNativeRedisAcceptanceTest.java| 13 +
 .../string/SetExNativeRedisAcceptanceTest.java | 13 +
 .../string/SetNXNativeRedisAcceptanceTest.java | 13 +
 .../string/SetNativeRedisAcceptanceTest.java   | 15 ++---
 .../string/SetRangeNativeRedisAcceptanceTest.java  | 13 +
 .../string/StrLenNativeRedisAcceptanceTest.java| 13 +
 .../session/NativeRedisSessionAcceptanceTest.java  | 10 +---
 ...NativeRedisSessionExpirationAcceptanceTest.java | 11 +---
 .../java/org/apache/geode/NativeRedisTestRule.java | 66 ++
 .../executor/connection/AuthIntegrationTest.java   |  3 -
 53 files changed, 242 insertions(+), 560 deletions(-)

diff --git 
a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
 
b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
index a1d12da..81a6af8 100644
--- 
a/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
+++ 
b/geode-junit/src/main/java/org/apache/geode/test/junit/rules/IgnoreOnWindowsRule.java
@@ -30,6 +30,6 @@ import org.junit.rules.RuleChain;
 public class IgnoreOnWindowsRule extends ExternalResource implements 
Serializable {
   @Override
   protected void before() throws Throwable {
-Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS);
+Assume.assumeFalse("Test ignored on Windows.", SystemUtils.IS_OS_WINDOWS);
   }
 }
diff --git a/geode-redis/build.gradle b/geode-redis/build.gradle
index bf23fd1..bd332e3 100644
--- a/geode-redis/build.gradle
+++ b/geode-redis/build.gradl

[geode] branch develop updated (f2ccbc8 -> f4498c3)

2020-09-17 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from f2ccbc8  GEODE-8492: fix redis 'clients' statistic (#5510)
 add f4498c3  GEODE-8499: Redis subscriptions leak if they are not 
explicitly unsubscribed (#5518)

No new revisions were added by this update.

Summary of changes:
 .../pubsub/SubscriptionsIntegrationTest.java}  | 34 ---
 .../pubsub/SubscriptionsIntegrationTest.java   | 11 +--
 .../geode/redis/internal/GeodeRedisServer.java |  8 +++--
 .../apache/geode/redis/internal/netty/Client.java  |  8 +
 .../internal/pubsub/AbstractSubscription.java  |  2 ++
 .../geode/redis/internal/pubsub/PubSubImpl.java|  4 +++
 .../internal/pubsub/SubscriptionsJUnitTest.java| 38 +-
 7 files changed, 80 insertions(+), 25 deletions(-)
 copy 
geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/{RedisStatsIntegrationTest.java
 => executor/pubsub/SubscriptionsIntegrationTest.java} (58%)



[geode] branch develop updated (f4498c3 -> b26d04d)

2020-09-17 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from f4498c3  GEODE-8499: Redis subscriptions leak if they are not 
explicitly unsubscribed (#5518)
 add b26d04d  GEODE-8493: Redis idle clients can cause server stuck thread 
warning (#5511)

No new revisions were added by this update.

Summary of changes:
 .../java/org/apache/geode/redis/internal/GeodeRedisServer.java   | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)



[geode] branch develop updated (f4498c3 -> b26d04d)

2020-09-17 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from f4498c3  GEODE-8499: Redis subscriptions leak if they are not 
explicitly unsubscribed (#5518)
 add b26d04d  GEODE-8493: Redis idle clients can cause server stuck thread 
warning (#5511)

No new revisions were added by this update.

Summary of changes:
 .../java/org/apache/geode/redis/internal/GeodeRedisServer.java   | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)



[geode] branch develop updated (f4498c3 -> b26d04d)

2020-09-17 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from f4498c3  GEODE-8499: Redis subscriptions leak if they are not 
explicitly unsubscribed (#5518)
 add b26d04d  GEODE-8493: Redis idle clients can cause server stuck thread 
warning (#5511)

No new revisions were added by this update.

Summary of changes:
 .../java/org/apache/geode/redis/internal/GeodeRedisServer.java   | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)



[geode] branch develop updated: GEODE-8503: Limit netty threads in PubSubDUnitTest (#5522)

2020-09-17 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 794526a  GEODE-8503: Limit netty threads in PubSubDUnitTest (#5522)
794526a is described below

commit 794526a6994222133fe0f49c0e05d24782db3601
Author: Jens Deppe 
AuthorDate: Thu Sep 17 11:12:14 2020 -0700

GEODE-8503: Limit netty threads in PubSubDUnitTest (#5522)
---
 .../test/dunit/rules/RedisClusterStartupRule.java |  4 
 .../internal/executor/pubsub/PubSubDUnitTest.java | 19 +--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git 
a/geode-redis/src/commonTest/java/org/apache/geode/test/dunit/rules/RedisClusterStartupRule.java
 
b/geode-redis/src/commonTest/java/org/apache/geode/test/dunit/rules/RedisClusterStartupRule.java
index 69c648c..f4f6eab 100644
--- 
a/geode-redis/src/commonTest/java/org/apache/geode/test/dunit/rules/RedisClusterStartupRule.java
+++ 
b/geode-redis/src/commonTest/java/org/apache/geode/test/dunit/rules/RedisClusterStartupRule.java
@@ -47,6 +47,10 @@ public class RedisClusterStartupRule extends 
ClusterStartupRule {
 .withConnectionToLocator(locatorPort));
   }
 
+  public MemberVM startRedisVM(int index, 
SerializableFunction ruleOperator) {
+return startServerVM(index, x -> ruleOperator.apply(withRedis(x)));
+  }
+
   private ServerStarterRule withRedis(ServerStarterRule rule) {
 return rule.withProperty(REDIS_BIND_ADDRESS, "localhost")
 .withProperty(REDIS_PORT, "0")
diff --git 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubDUnitTest.java
 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubDUnitTest.java
index 4ea912a..1b5c38f 100644
--- 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubDUnitTest.java
+++ 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubDUnitTest.java
@@ -51,8 +51,10 @@ import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+import org.apache.geode.test.dunit.rules.SerializableFunction;
 import org.apache.geode.test.junit.rules.ExecutorServiceRule;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
+import org.apache.geode.test.junit.rules.ServerStarterRule;
 
 
 public class PubSubDUnitTest {
@@ -94,12 +96,17 @@ public class PubSubDUnitTest {
 
 locatorProperties = new Properties();
 locatorProperties.setProperty(MAX_WAIT_TIME_RECONNECT, "15000");
-
 locator = cluster.startLocatorVM(0, locatorProperties);
-server1 = cluster.startRedisVM(1, locator.getPort());
-server2 = cluster.startRedisVM(2, locator.getPort());
-server3 = cluster.startRedisVM(3, locator.getPort());
-server4 = cluster.startRedisVM(4, locator.getPort());
+
+int locatorPort = locator.getPort();
+SerializableFunction operator = x -> x
+.withSystemProperty("io.netty.eventLoopThreads", "10")
+.withConnectionToLocator(locatorPort);
+
+server1 = cluster.startRedisVM(1, operator);
+server2 = cluster.startRedisVM(2, operator);
+server3 = cluster.startRedisVM(3, operator);
+server4 = cluster.startRedisVM(4, operator);
 server5 = cluster.startServerVM(5, locator.getPort());
 
 for (VM v : Host.getHost(0).getAllVMs()) {
@@ -388,7 +395,7 @@ public class PubSubDUnitTest {
 
   @Test
   public void testPubSubWithMoreSubscribersThanNettyWorkerThreads() throws 
Exception {
-int CLIENT_COUNT = 1000;
+int CLIENT_COUNT = 100;
 String CHANNEL_NAME = "best_channel_ever";
 
 List clients = new ArrayList<>();



[geode] branch develop updated: GEODE-8505: Upgrade netty from 4.1.48 to 4.1.52 (#5523)

2020-09-17 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new ded2dda  GEODE-8505: Upgrade netty from 4.1.48 to 4.1.52 (#5523)
ded2dda is described below

commit ded2dda886565b42423f11c4906dbaf727132a37
Author: Jens Deppe 
AuthorDate: Thu Sep 17 14:45:58 2020 -0700

GEODE-8505: Upgrade netty from 4.1.48 to 4.1.52 (#5523)
---
 boms/geode-all-bom/src/test/resources/expected-pom.xml  | 2 +-
 .../groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy | 2 +-
 geode-assembly/src/integrationTest/resources/assembly_content.txt   | 2 +-
 geode-assembly/src/integrationTest/resources/dependency_classpath.txt   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/boms/geode-all-bom/src/test/resources/expected-pom.xml 
b/boms/geode-all-bom/src/test/resources/expected-pom.xml
index c7fe5af..333d0ce 100644
--- a/boms/geode-all-bom/src/test/resources/expected-pom.xml
+++ b/boms/geode-all-bom/src/test/resources/expected-pom.xml
@@ -250,7 +250,7 @@
   
 io.netty
 netty-all
-4.1.48.Final
+4.1.52.Final
 compile
   
   
diff --git 
a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
 
b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
index 56c4bf7..27d896a 100644
--- 
a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
+++ 
b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy
@@ -120,7 +120,7 @@ class DependencyConstraints implements Plugin {
 // Careful when upgrading this dependency: see GEODE-7370 and 
GEODE-8150.
 api(group: 'io.github.classgraph', name: 'classgraph', version: 
'4.8.52')
 api(group: 'io.micrometer', name: 'micrometer-core', version: 
get('micrometer.version'))
-api(group: 'io.netty', name: 'netty-all', version: '4.1.48.Final')
+api(group: 'io.netty', name: 'netty-all', version: '4.1.52.Final')
 api(group: 'io.swagger', name: 'swagger-annotations', version: 
'1.5.23')
 api(group: 'it.unimi.dsi', name: 'fastutil', version: 
get('fastutil.version'))
 api(group: 'javax.annotation', name: 'javax.annotation-api', version: 
'1.3.2')
diff --git a/geode-assembly/src/integrationTest/resources/assembly_content.txt 
b/geode-assembly/src/integrationTest/resources/assembly_content.txt
index 40c2c75..467b652 100644
--- a/geode-assembly/src/integrationTest/resources/assembly_content.txt
+++ b/geode-assembly/src/integrationTest/resources/assembly_content.txt
@@ -1054,7 +1054,7 @@ lib/micrometer-core-1.4.1.jar
 lib/mx4j-3.0.2.jar
 lib/mx4j-remote-3.0.2.jar
 lib/mx4j-tools-3.0.1.jar
-lib/netty-all-4.1.48.Final.jar
+lib/netty-all-4.1.52.Final.jar
 lib/protobuf-java-3.11.4.jar
 lib/ra.jar
 lib/rmiio-2.1.2.jar
diff --git 
a/geode-assembly/src/integrationTest/resources/dependency_classpath.txt 
b/geode-assembly/src/integrationTest/resources/dependency_classpath.txt
index 2a1e117..9d4bbd0 100644
--- a/geode-assembly/src/integrationTest/resources/dependency_classpath.txt
+++ b/geode-assembly/src/integrationTest/resources/dependency_classpath.txt
@@ -86,4 +86,4 @@ lucene-core-6.6.6.jar
 lucene-queries-6.6.6.jar
 protobuf-java-3.11.4.jar
 geo-0.7.7.jar
-netty-all-4.1.48.Final.jar
+netty-all-4.1.52.Final.jar



[geode] branch develop updated: Redis StartUp tests use ephemeral port for Geode server (#5528)

2020-09-22 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new ee99503  Redis StartUp tests use ephemeral port for Geode server 
(#5528)
ee99503 is described below

commit ee99503e7306ccfbd4a9d782a7d50cdbbe800c79
Author: Ray Ingles 
AuthorDate: Tue Sep 22 09:10:08 2020 -0400

Redis StartUp tests use ephemeral port for Geode server (#5528)

Co-authored-by: Ray Ingles 
---
 .../redis/internal/executor/GeodeRedisServerStartUpAcceptanceTest.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/GeodeRedisServerStartUpAcceptanceTest.java
 
b/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/GeodeRedisServerStartUpAcceptanceTest.java
index 5d1eca2..9e63c2d 100644
--- 
a/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/GeodeRedisServerStartUpAcceptanceTest.java
+++ 
b/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/GeodeRedisServerStartUpAcceptanceTest.java
@@ -41,6 +41,7 @@ public class GeodeRedisServerStartUpAcceptanceTest {
 
 String startServerCommand = String.join(" ",
 "start server",
+"--server-port", "0",
 "--name", "same-port-and-address-server",
 "--redis-bind-address", "localhost",
 "--redis-port", String.valueOf(port));
@@ -63,6 +64,7 @@ public class GeodeRedisServerStartUpAcceptanceTest {
 
 String startServerCommand = String.join(" ",
 "start server",
+"--server-port", "0",
 "--name", "same-port-all-addresses-server",
 "--redis-port", String.valueOf(port));
 GfshExecution execution;
@@ -82,6 +84,7 @@ public class GeodeRedisServerStartUpAcceptanceTest {
 
 String startServerCommand = String.join(" ",
 "start server",
+"--server-port", "0",
 "--name", "invalid-bind-server",
 "--redis-bind-address", "1.1.1.1");
 GfshExecution execution;



[geode] branch develop updated: GEODE-8498: make AbstractSubscription write to channel synchronously (#5550)

2020-09-25 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 22f2c52  GEODE-8498: make AbstractSubscription write to channel 
synchronously (#5550)
22f2c52 is described below

commit 22f2c5247411f646521f47f6c0f900feaa3aa65c
Author: John Hutchison 
AuthorDate: Fri Sep 25 10:26:17 2020 -0400

GEODE-8498: make AbstractSubscription write to channel synchronously (#5550)

Co-authored-by: Ray Ingles 
Co-authored-by: Darrel Schneider 
Co-authored-by: Jens Deppe 
Co-authored-by: Sarah Abbey 
---
 .../apache/geode/redis/mocks/MockSubscriber.java   | 19 ++-
 .../pubsub/LettucePubSubIntegrationTest.java   |  3 +-
 .../executor/pubsub/PubSubIntegrationTest.java | 58 ++
 .../internal/pubsub/AbstractSubscription.java  | 26 +-
 .../redis/internal/pubsub/PubSubImplJUnitTest.java |  5 ++
 5 files changed, 95 insertions(+), 16 deletions(-)

diff --git 
a/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
 
b/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
index 63362cb..26d8283 100644
--- 
a/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
+++ 
b/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
@@ -31,6 +31,7 @@ public class MockSubscriber extends JedisPubSub {
   private final CountDownLatch subscriptionLatch;
   private final CountDownLatch psubscriptionLatch;
   private final CountDownLatch unsubscriptionLatch;
+  private final CountDownLatch pUnsubscriptionLatch;
   private final List receivedMessages = 
Collections.synchronizedList(new ArrayList<>());
   private final List receivedPMessages = 
Collections.synchronizedList(new ArrayList<>());
   private final List receivedPings = Collections.synchronizedList(new 
ArrayList<>());
@@ -47,14 +48,16 @@ public class MockSubscriber extends JedisPubSub {
   }
 
   public MockSubscriber(CountDownLatch subscriptionLatch) {
-this(subscriptionLatch, new CountDownLatch(1), new CountDownLatch(1));
+this(subscriptionLatch, new CountDownLatch(1), new CountDownLatch(1), new 
CountDownLatch(1));
   }
 
   public MockSubscriber(CountDownLatch subscriptionLatch, CountDownLatch 
unsubscriptionLatch,
-  CountDownLatch psubscriptionLatch) {
+  CountDownLatch psubscriptionLatch,
+  CountDownLatch pUnsubscriptionLatch) {
 this.subscriptionLatch = subscriptionLatch;
 this.psubscriptionLatch = psubscriptionLatch;
 this.unsubscriptionLatch = unsubscriptionLatch;
+this.pUnsubscriptionLatch = pUnsubscriptionLatch;
   }
 
   @Override
@@ -176,6 +179,18 @@ public class MockSubscriber extends JedisPubSub {
   public void onPUnsubscribe(String pattern, int subscribedChannels) {
 switchThreadName(String.format("PUNSUBSCRIBE %s %d", pattern, 
subscribedChannels));
 punsubscribeInfos.add(new UnsubscribeInfo(pattern, subscribedChannels));
+pUnsubscriptionLatch.countDown();
+  }
+
+  public void awaitPunsubscribe(String pChannel) {
+
+try {
+  if (!pUnsubscriptionLatch.await(AWAIT_TIMEOUT_MILLIS, 
TimeUnit.MILLISECONDS)) {
+throw new RuntimeException("awaitPUnsubscribe timed out for pattern: " 
+ pChannel);
+  }
+} catch (InterruptedException e) {
+  throw new RuntimeException(e);
+}
   }
 
   public static class UnsubscribeInfo {
diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
index 2ecd177..d63c647 100644
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
@@ -34,7 +34,6 @@ import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import org.apache.geode.redis.GeodeRedisServerRule;
@@ -152,7 +151,6 @@ public class LettucePubSubIntegrationTest {
   }
 
   @Test
-  @Ignore("GEODE-8498")
   public void subscribePsubscribeSameClient() throws InterruptedException {
 StatefulRedisPubSubConnection subscriber = 
client.connectPubSub();
 StatefulRedisPubSubConnection publisher = 
client.connectPubSub();
@@ -354,6 +352,7 @@ public class LettucePubSubIntegrationTest {
 }
 
 long publishCount = 0;
+
 for (Future r : results) {
   publishCount += r.get();
 }
diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/exec

[geode] branch develop updated: GEODE-8498: make AbstractSubscription write to channel synchronously (#5550)

2020-09-25 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 22f2c52  GEODE-8498: make AbstractSubscription write to channel 
synchronously (#5550)
22f2c52 is described below

commit 22f2c5247411f646521f47f6c0f900feaa3aa65c
Author: John Hutchison 
AuthorDate: Fri Sep 25 10:26:17 2020 -0400

GEODE-8498: make AbstractSubscription write to channel synchronously (#5550)

Co-authored-by: Ray Ingles 
Co-authored-by: Darrel Schneider 
Co-authored-by: Jens Deppe 
Co-authored-by: Sarah Abbey 
---
 .../apache/geode/redis/mocks/MockSubscriber.java   | 19 ++-
 .../pubsub/LettucePubSubIntegrationTest.java   |  3 +-
 .../executor/pubsub/PubSubIntegrationTest.java | 58 ++
 .../internal/pubsub/AbstractSubscription.java  | 26 +-
 .../redis/internal/pubsub/PubSubImplJUnitTest.java |  5 ++
 5 files changed, 95 insertions(+), 16 deletions(-)

diff --git 
a/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
 
b/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
index 63362cb..26d8283 100644
--- 
a/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
+++ 
b/geode-redis/src/commonTest/java/org/apache/geode/redis/mocks/MockSubscriber.java
@@ -31,6 +31,7 @@ public class MockSubscriber extends JedisPubSub {
   private final CountDownLatch subscriptionLatch;
   private final CountDownLatch psubscriptionLatch;
   private final CountDownLatch unsubscriptionLatch;
+  private final CountDownLatch pUnsubscriptionLatch;
   private final List receivedMessages = 
Collections.synchronizedList(new ArrayList<>());
   private final List receivedPMessages = 
Collections.synchronizedList(new ArrayList<>());
   private final List receivedPings = Collections.synchronizedList(new 
ArrayList<>());
@@ -47,14 +48,16 @@ public class MockSubscriber extends JedisPubSub {
   }
 
   public MockSubscriber(CountDownLatch subscriptionLatch) {
-this(subscriptionLatch, new CountDownLatch(1), new CountDownLatch(1));
+this(subscriptionLatch, new CountDownLatch(1), new CountDownLatch(1), new 
CountDownLatch(1));
   }
 
   public MockSubscriber(CountDownLatch subscriptionLatch, CountDownLatch 
unsubscriptionLatch,
-  CountDownLatch psubscriptionLatch) {
+  CountDownLatch psubscriptionLatch,
+  CountDownLatch pUnsubscriptionLatch) {
 this.subscriptionLatch = subscriptionLatch;
 this.psubscriptionLatch = psubscriptionLatch;
 this.unsubscriptionLatch = unsubscriptionLatch;
+this.pUnsubscriptionLatch = pUnsubscriptionLatch;
   }
 
   @Override
@@ -176,6 +179,18 @@ public class MockSubscriber extends JedisPubSub {
   public void onPUnsubscribe(String pattern, int subscribedChannels) {
 switchThreadName(String.format("PUNSUBSCRIBE %s %d", pattern, 
subscribedChannels));
 punsubscribeInfos.add(new UnsubscribeInfo(pattern, subscribedChannels));
+pUnsubscriptionLatch.countDown();
+  }
+
+  public void awaitPunsubscribe(String pChannel) {
+
+try {
+  if (!pUnsubscriptionLatch.await(AWAIT_TIMEOUT_MILLIS, 
TimeUnit.MILLISECONDS)) {
+throw new RuntimeException("awaitPUnsubscribe timed out for pattern: " 
+ pChannel);
+  }
+} catch (InterruptedException e) {
+  throw new RuntimeException(e);
+}
   }
 
   public static class UnsubscribeInfo {
diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
index 2ecd177..d63c647 100644
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/LettucePubSubIntegrationTest.java
@@ -34,7 +34,6 @@ import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import org.apache.geode.redis.GeodeRedisServerRule;
@@ -152,7 +151,6 @@ public class LettucePubSubIntegrationTest {
   }
 
   @Test
-  @Ignore("GEODE-8498")
   public void subscribePsubscribeSameClient() throws InterruptedException {
 StatefulRedisPubSubConnection subscriber = 
client.connectPubSub();
 StatefulRedisPubSubConnection publisher = 
client.connectPubSub();
@@ -354,6 +352,7 @@ public class LettucePubSubIntegrationTest {
 }
 
 long publishCount = 0;
+
 for (Future r : results) {
   publishCount += r.get();
 }
diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/exec

[geode] branch develop updated: GEODE-8577: PubSubNativeRedisAcceptanceTest is flaky (#5593)

2020-10-05 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new b8147bb  GEODE-8577: PubSubNativeRedisAcceptanceTest is flaky (#5593)
b8147bb is described below

commit b8147bb7fdc339af36f3bcb465e7b34ae450a744
Author: Jens Deppe 
AuthorDate: Mon Oct 5 18:51:40 2020 -0700

GEODE-8577: PubSubNativeRedisAcceptanceTest is flaky (#5593)
---
 .../redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java
 
b/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java
index ce7778f..772ebb1 100644
--- 
a/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java
+++ 
b/geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java
@@ -16,9 +16,11 @@
 package org.apache.geode.redis.internal.executor.pubsub;
 
 import org.junit.ClassRule;
+import org.junit.Ignore;
 
 import org.apache.geode.NativeRedisTestRule;
 
+@Ignore("GEODE-8577")
 public class PubSubNativeRedisAcceptanceTest extends 
AbstractPubSubIntegrationTest {
   @ClassRule
   public static NativeRedisTestRule redis = new NativeRedisTestRule();



[geode] branch develop updated (9bc288a -> f8dae61)

2020-10-06 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 9bc288a  GEODE-8421: replace clean with destroy region (#5445)
 add f8dae61  GEODE-8577: Fix flaky PubSubNativeRedisAcceptanceTest (#5597)

No new revisions were added by this update.

Summary of changes:
 .../redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java | 2 --
 .../redis/internal/executor/pubsub/AbstractPubSubIntegrationTest.java   | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)



[geode] branch develop updated: GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty array (#5609)

2020-10-12 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 30782f1  GEODE-8586: Redis SPOP with count on empty set returns NIL 
instead of empty array (#5609)
30782f1 is described below

commit 30782f11f71eca5c1ddbd8a6596a88c85768ae24
Author: John Hutchison 
AuthorDate: Mon Oct 12 09:52:05 2020 -0400

GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty 
array (#5609)

Co-authored-by: john Hutchison 
---
 .../executor/set/AbstractSPopIntegrationTest.java  | 43 ++
 .../redis/internal/executor/set/SPopExecutor.java  | 15 +---
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
index b879625..3717ddf 100755
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
@@ -24,6 +24,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import redis.clients.jedis.Jedis;
+import redis.clients.jedis.Protocol;
 
 import org.apache.geode.test.dunit.rules.RedisPortSupplier;
 
@@ -171,4 +172,46 @@ public abstract class AbstractSPopIntegrationTest 
implements RedisPortSupplier {
 popped1.addAll(popped2);
 
assertThat(popped1.toArray()).containsExactlyInAnyOrder(masterSet.toArray());
   }
+
+  @Test
+  public void testSPopWithOutCount_shouldReturnNil_givenEmptySet() {
+
+Object result = jedis.sendCommand(Protocol.Command.SPOP, "noneSuch");
+
+assertThat(result).isNull();
+  }
+
+  @Test
+  public void testSPopWithCount_shouldReturnEmptyList_givenEmptySet() {
+Set result = jedis.spop("noneSuch", 2);
+
+assertThat(result).isEmpty();
+  }
+
+  @Test
+  public void testSPopWithCountOfOne_shouldReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set", "1");
+
+assertThat(actual).isInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithoutCount_shouldNotReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set");
+
+assertThat(actual).isNotInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithCountZero_shouldReturnEmptyList() {
+jedis.sadd("set", "one");
+
+Set result = jedis.spop("set", 0);
+
+assertThat(result).isEmpty();
+  }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
index 9bfbf0e..193586e 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
@@ -27,23 +27,28 @@ public class SPopExecutor extends SetExecutor {
   @Override
   public RedisResponse executeCommand(Command command,
   ExecutionHandlerContext context) {
+
 List commandElems = command.getProcessedCommand();
+boolean isCountPassed = false;
 int popCount = 1;
+
 if (commandElems.size() == 3) {
+  isCountPassed = true;
   popCount = Integer.parseInt(new String(commandElems.get(2)));
 }
 
 ByteArrayWrapper key = command.getKey();
 RedisSetCommands redisSetCommands = createRedisSetCommands(context);
 Collection popped = redisSetCommands.spop(key, popCount);
-if (popped.isEmpty()) {
+
+if (popped.isEmpty() && !isCountPassed) {
   return RedisResponse.nil();
 }
 
-if (popCount == 1) {
-  return RedisResponse.bulkString(popped.iterator().next());
-} else {
-  return RedisResponse.array(popped);
+if (!isCountPassed) {
+  return RedisResponse.string(popped.iterator().next().toString());
 }
+
+return RedisResponse.array(popped);
   }
 }



[geode] branch develop updated: GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty array (#5609)

2020-10-12 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 30782f1  GEODE-8586: Redis SPOP with count on empty set returns NIL 
instead of empty array (#5609)
30782f1 is described below

commit 30782f11f71eca5c1ddbd8a6596a88c85768ae24
Author: John Hutchison 
AuthorDate: Mon Oct 12 09:52:05 2020 -0400

GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty 
array (#5609)

Co-authored-by: john Hutchison 
---
 .../executor/set/AbstractSPopIntegrationTest.java  | 43 ++
 .../redis/internal/executor/set/SPopExecutor.java  | 15 +---
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
index b879625..3717ddf 100755
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
@@ -24,6 +24,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import redis.clients.jedis.Jedis;
+import redis.clients.jedis.Protocol;
 
 import org.apache.geode.test.dunit.rules.RedisPortSupplier;
 
@@ -171,4 +172,46 @@ public abstract class AbstractSPopIntegrationTest 
implements RedisPortSupplier {
 popped1.addAll(popped2);
 
assertThat(popped1.toArray()).containsExactlyInAnyOrder(masterSet.toArray());
   }
+
+  @Test
+  public void testSPopWithOutCount_shouldReturnNil_givenEmptySet() {
+
+Object result = jedis.sendCommand(Protocol.Command.SPOP, "noneSuch");
+
+assertThat(result).isNull();
+  }
+
+  @Test
+  public void testSPopWithCount_shouldReturnEmptyList_givenEmptySet() {
+Set result = jedis.spop("noneSuch", 2);
+
+assertThat(result).isEmpty();
+  }
+
+  @Test
+  public void testSPopWithCountOfOne_shouldReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set", "1");
+
+assertThat(actual).isInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithoutCount_shouldNotReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set");
+
+assertThat(actual).isNotInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithCountZero_shouldReturnEmptyList() {
+jedis.sadd("set", "one");
+
+Set result = jedis.spop("set", 0);
+
+assertThat(result).isEmpty();
+  }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
index 9bfbf0e..193586e 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
@@ -27,23 +27,28 @@ public class SPopExecutor extends SetExecutor {
   @Override
   public RedisResponse executeCommand(Command command,
   ExecutionHandlerContext context) {
+
 List commandElems = command.getProcessedCommand();
+boolean isCountPassed = false;
 int popCount = 1;
+
 if (commandElems.size() == 3) {
+  isCountPassed = true;
   popCount = Integer.parseInt(new String(commandElems.get(2)));
 }
 
 ByteArrayWrapper key = command.getKey();
 RedisSetCommands redisSetCommands = createRedisSetCommands(context);
 Collection popped = redisSetCommands.spop(key, popCount);
-if (popped.isEmpty()) {
+
+if (popped.isEmpty() && !isCountPassed) {
   return RedisResponse.nil();
 }
 
-if (popCount == 1) {
-  return RedisResponse.bulkString(popped.iterator().next());
-} else {
-  return RedisResponse.array(popped);
+if (!isCountPassed) {
+  return RedisResponse.string(popped.iterator().next().toString());
 }
+
+return RedisResponse.array(popped);
   }
 }



[geode] branch develop updated: GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty array (#5609)

2020-10-12 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 30782f1  GEODE-8586: Redis SPOP with count on empty set returns NIL 
instead of empty array (#5609)
30782f1 is described below

commit 30782f11f71eca5c1ddbd8a6596a88c85768ae24
Author: John Hutchison 
AuthorDate: Mon Oct 12 09:52:05 2020 -0400

GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty 
array (#5609)

Co-authored-by: john Hutchison 
---
 .../executor/set/AbstractSPopIntegrationTest.java  | 43 ++
 .../redis/internal/executor/set/SPopExecutor.java  | 15 +---
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
index b879625..3717ddf 100755
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
@@ -24,6 +24,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import redis.clients.jedis.Jedis;
+import redis.clients.jedis.Protocol;
 
 import org.apache.geode.test.dunit.rules.RedisPortSupplier;
 
@@ -171,4 +172,46 @@ public abstract class AbstractSPopIntegrationTest 
implements RedisPortSupplier {
 popped1.addAll(popped2);
 
assertThat(popped1.toArray()).containsExactlyInAnyOrder(masterSet.toArray());
   }
+
+  @Test
+  public void testSPopWithOutCount_shouldReturnNil_givenEmptySet() {
+
+Object result = jedis.sendCommand(Protocol.Command.SPOP, "noneSuch");
+
+assertThat(result).isNull();
+  }
+
+  @Test
+  public void testSPopWithCount_shouldReturnEmptyList_givenEmptySet() {
+Set result = jedis.spop("noneSuch", 2);
+
+assertThat(result).isEmpty();
+  }
+
+  @Test
+  public void testSPopWithCountOfOne_shouldReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set", "1");
+
+assertThat(actual).isInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithoutCount_shouldNotReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set");
+
+assertThat(actual).isNotInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithCountZero_shouldReturnEmptyList() {
+jedis.sadd("set", "one");
+
+Set result = jedis.spop("set", 0);
+
+assertThat(result).isEmpty();
+  }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
index 9bfbf0e..193586e 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
@@ -27,23 +27,28 @@ public class SPopExecutor extends SetExecutor {
   @Override
   public RedisResponse executeCommand(Command command,
   ExecutionHandlerContext context) {
+
 List commandElems = command.getProcessedCommand();
+boolean isCountPassed = false;
 int popCount = 1;
+
 if (commandElems.size() == 3) {
+  isCountPassed = true;
   popCount = Integer.parseInt(new String(commandElems.get(2)));
 }
 
 ByteArrayWrapper key = command.getKey();
 RedisSetCommands redisSetCommands = createRedisSetCommands(context);
 Collection popped = redisSetCommands.spop(key, popCount);
-if (popped.isEmpty()) {
+
+if (popped.isEmpty() && !isCountPassed) {
   return RedisResponse.nil();
 }
 
-if (popCount == 1) {
-  return RedisResponse.bulkString(popped.iterator().next());
-} else {
-  return RedisResponse.array(popped);
+if (!isCountPassed) {
+  return RedisResponse.string(popped.iterator().next().toString());
 }
+
+return RedisResponse.array(popped);
   }
 }



[geode] branch develop updated: GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty array (#5609)

2020-10-12 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 30782f1  GEODE-8586: Redis SPOP with count on empty set returns NIL 
instead of empty array (#5609)
30782f1 is described below

commit 30782f11f71eca5c1ddbd8a6596a88c85768ae24
Author: John Hutchison 
AuthorDate: Mon Oct 12 09:52:05 2020 -0400

GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty 
array (#5609)

Co-authored-by: john Hutchison 
---
 .../executor/set/AbstractSPopIntegrationTest.java  | 43 ++
 .../redis/internal/executor/set/SPopExecutor.java  | 15 +---
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
index b879625..3717ddf 100755
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
@@ -24,6 +24,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import redis.clients.jedis.Jedis;
+import redis.clients.jedis.Protocol;
 
 import org.apache.geode.test.dunit.rules.RedisPortSupplier;
 
@@ -171,4 +172,46 @@ public abstract class AbstractSPopIntegrationTest 
implements RedisPortSupplier {
 popped1.addAll(popped2);
 
assertThat(popped1.toArray()).containsExactlyInAnyOrder(masterSet.toArray());
   }
+
+  @Test
+  public void testSPopWithOutCount_shouldReturnNil_givenEmptySet() {
+
+Object result = jedis.sendCommand(Protocol.Command.SPOP, "noneSuch");
+
+assertThat(result).isNull();
+  }
+
+  @Test
+  public void testSPopWithCount_shouldReturnEmptyList_givenEmptySet() {
+Set result = jedis.spop("noneSuch", 2);
+
+assertThat(result).isEmpty();
+  }
+
+  @Test
+  public void testSPopWithCountOfOne_shouldReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set", "1");
+
+assertThat(actual).isInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithoutCount_shouldNotReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set");
+
+assertThat(actual).isNotInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithCountZero_shouldReturnEmptyList() {
+jedis.sadd("set", "one");
+
+Set result = jedis.spop("set", 0);
+
+assertThat(result).isEmpty();
+  }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
index 9bfbf0e..193586e 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
@@ -27,23 +27,28 @@ public class SPopExecutor extends SetExecutor {
   @Override
   public RedisResponse executeCommand(Command command,
   ExecutionHandlerContext context) {
+
 List commandElems = command.getProcessedCommand();
+boolean isCountPassed = false;
 int popCount = 1;
+
 if (commandElems.size() == 3) {
+  isCountPassed = true;
   popCount = Integer.parseInt(new String(commandElems.get(2)));
 }
 
 ByteArrayWrapper key = command.getKey();
 RedisSetCommands redisSetCommands = createRedisSetCommands(context);
 Collection popped = redisSetCommands.spop(key, popCount);
-if (popped.isEmpty()) {
+
+if (popped.isEmpty() && !isCountPassed) {
   return RedisResponse.nil();
 }
 
-if (popCount == 1) {
-  return RedisResponse.bulkString(popped.iterator().next());
-} else {
-  return RedisResponse.array(popped);
+if (!isCountPassed) {
+  return RedisResponse.string(popped.iterator().next().toString());
 }
+
+return RedisResponse.array(popped);
   }
 }



[geode] branch develop updated: GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty array (#5609)

2020-10-12 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 30782f1  GEODE-8586: Redis SPOP with count on empty set returns NIL 
instead of empty array (#5609)
30782f1 is described below

commit 30782f11f71eca5c1ddbd8a6596a88c85768ae24
Author: John Hutchison 
AuthorDate: Mon Oct 12 09:52:05 2020 -0400

GEODE-8586: Redis SPOP with count on empty set returns NIL instead of empty 
array (#5609)

Co-authored-by: john Hutchison 
---
 .../executor/set/AbstractSPopIntegrationTest.java  | 43 ++
 .../redis/internal/executor/set/SPopExecutor.java  | 15 +---
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
index b879625..3717ddf 100755
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
@@ -24,6 +24,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import redis.clients.jedis.Jedis;
+import redis.clients.jedis.Protocol;
 
 import org.apache.geode.test.dunit.rules.RedisPortSupplier;
 
@@ -171,4 +172,46 @@ public abstract class AbstractSPopIntegrationTest 
implements RedisPortSupplier {
 popped1.addAll(popped2);
 
assertThat(popped1.toArray()).containsExactlyInAnyOrder(masterSet.toArray());
   }
+
+  @Test
+  public void testSPopWithOutCount_shouldReturnNil_givenEmptySet() {
+
+Object result = jedis.sendCommand(Protocol.Command.SPOP, "noneSuch");
+
+assertThat(result).isNull();
+  }
+
+  @Test
+  public void testSPopWithCount_shouldReturnEmptyList_givenEmptySet() {
+Set result = jedis.spop("noneSuch", 2);
+
+assertThat(result).isEmpty();
+  }
+
+  @Test
+  public void testSPopWithCountOfOne_shouldReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set", "1");
+
+assertThat(actual).isInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithoutCount_shouldNotReturnList() {
+jedis.sadd("set", "one");
+
+Object actual = jedis.sendCommand(Protocol.Command.SPOP, "set");
+
+assertThat(actual).isNotInstanceOf(List.class);
+  }
+
+  @Test
+  public void testSPopWithCountZero_shouldReturnEmptyList() {
+jedis.sadd("set", "one");
+
+Set result = jedis.spop("set", 0);
+
+assertThat(result).isEmpty();
+  }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
index 9bfbf0e..193586e 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
@@ -27,23 +27,28 @@ public class SPopExecutor extends SetExecutor {
   @Override
   public RedisResponse executeCommand(Command command,
   ExecutionHandlerContext context) {
+
 List commandElems = command.getProcessedCommand();
+boolean isCountPassed = false;
 int popCount = 1;
+
 if (commandElems.size() == 3) {
+  isCountPassed = true;
   popCount = Integer.parseInt(new String(commandElems.get(2)));
 }
 
 ByteArrayWrapper key = command.getKey();
 RedisSetCommands redisSetCommands = createRedisSetCommands(context);
 Collection popped = redisSetCommands.spop(key, popCount);
-if (popped.isEmpty()) {
+
+if (popped.isEmpty() && !isCountPassed) {
   return RedisResponse.nil();
 }
 
-if (popCount == 1) {
-  return RedisResponse.bulkString(popped.iterator().next());
-} else {
-  return RedisResponse.array(popped);
+if (!isCountPassed) {
+  return RedisResponse.string(popped.iterator().next().toString());
 }
+
+return RedisResponse.array(popped);
   }
 }



[geode] branch develop updated: GEODE-8621: Redis SPOP can return incorrect string type (#5634)

2020-10-16 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new f0ee8e2  GEODE-8621: Redis SPOP can return incorrect string type 
(#5634)
f0ee8e2 is described below

commit f0ee8e2bbce379ae5e5994b886808d15f3fed72d
Author: Jens Deppe 
AuthorDate: Fri Oct 16 10:21:17 2020 -0700

GEODE-8621: Redis SPOP can return incorrect string type (#5634)

- Without a count argument, SPOP should return the result as a bulk
  string.
---
 .../executor/set/AbstractSPopIntegrationTest.java  | 25 ++
 .../redis/internal/executor/set/SPopExecutor.java  |  2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
index 3717ddf..6584731 100755
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/set/AbstractSPopIntegrationTest.java
@@ -16,7 +16,9 @@ package org.apache.geode.redis.internal.executor.set;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import java.net.Socket;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Set;
 
@@ -214,4 +216,27 @@ public abstract class AbstractSPopIntegrationTest 
implements RedisPortSupplier {
 
 assertThat(result).isEmpty();
   }
+
+  @Test
+  public void testSPopWithoutArg_shouldReturnBulkString() throws Exception {
+jedis.sadd("set", "one");
+
+try (Socket redisSocket = new Socket("localhost", getPort())) {
+  byte[] rawBytes = new byte[] {
+  '*', '2', 0x0d, 0x0a,
+  '$', '4', 0x0d, 0x0a,
+  'S', 'P', 'O', 'P', 0x0d, 0x0a,
+  '$', '3', 0x0d, 0x0a,
+  's', 'e', 't', 0x0d, 0x0a,
+  };
+
+  redisSocket.getOutputStream().write(rawBytes);
+
+  byte[] inputBuffer = new byte[1024];
+  int n = redisSocket.getInputStream().read(inputBuffer);
+  String result = new String(Arrays.copyOfRange(inputBuffer, 0, n));
+
+  assertThat(result).isEqualTo("$3\r\none\r\n");
+}
+  }
 }
diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
index 193586e..d23c310 100755
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/set/SPopExecutor.java
@@ -46,7 +46,7 @@ public class SPopExecutor extends SetExecutor {
 }
 
 if (!isCountPassed) {
-  return RedisResponse.string(popped.iterator().next().toString());
+  return RedisResponse.bulkString(popped.iterator().next().toString());
 }
 
 return RedisResponse.array(popped);



[geode] branch develop updated (4c48202 -> f0ee8e2)

2020-10-16 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 4c48202  GEODE-8612: Remove unused Redis constants (#5628)
 add f0ee8e2  GEODE-8621: Redis SPOP can return incorrect string type 
(#5634)

No new revisions were added by this update.

Summary of changes:
 .../executor/set/AbstractSPopIntegrationTest.java  | 25 ++
 .../redis/internal/executor/set/SPopExecutor.java  |  2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)



[geode] branch develop updated (7a0fd2e -> b76eba7)

2020-10-21 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 7a0fd2e  GEODE-8627: Redis not unsubscribing and punsubscribing 
correctly when no channel/pattern provided (#5639)
 add b76eba7  GEODE-8629: Redis TTL should round up the returned value 
(#5640)

No new revisions were added by this update.

Summary of changes:
 .../internal/executor/key/AbstractTTLIntegrationTest.java | 15 ++-
 .../geode/redis/internal/executor/key/TTLExecutor.java|  3 ++-
 2 files changed, 16 insertions(+), 2 deletions(-)



[geode] branch develop updated (7a0fd2e -> b76eba7)

2020-10-21 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 7a0fd2e  GEODE-8627: Redis not unsubscribing and punsubscribing 
correctly when no channel/pattern provided (#5639)
 add b76eba7  GEODE-8629: Redis TTL should round up the returned value 
(#5640)

No new revisions were added by this update.

Summary of changes:
 .../internal/executor/key/AbstractTTLIntegrationTest.java | 15 ++-
 .../geode/redis/internal/executor/key/TTLExecutor.java|  3 ++-
 2 files changed, 16 insertions(+), 2 deletions(-)



[geode] branch develop updated (b76eba7 -> d436e8d)

2020-10-21 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from b76eba7  GEODE-8629: Redis TTL should round up the returned value 
(#5640)
 add d436e8d  GEODE-8622: Redis INCRBYFLOAT error messages are consistent 
with native Redis (#5636)

No new revisions were added by this update.

Summary of changes:
 .../string/AbstractIncrByFloatIntegrationTest.java | 110 ++---
 .../geode/redis/internal/RedisConstants.java   |   3 +
 .../geode/redis/internal/data/RedisString.java |   9 +-
 .../executor/string/IncrByFloatExecutor.java   |  19 ++--
 4 files changed, 113 insertions(+), 28 deletions(-)



[geode] branch develop updated (7a0fd2e -> b76eba7)

2020-10-21 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 7a0fd2e  GEODE-8627: Redis not unsubscribing and punsubscribing 
correctly when no channel/pattern provided (#5639)
 add b76eba7  GEODE-8629: Redis TTL should round up the returned value 
(#5640)

No new revisions were added by this update.

Summary of changes:
 .../internal/executor/key/AbstractTTLIntegrationTest.java | 15 ++-
 .../geode/redis/internal/executor/key/TTLExecutor.java|  3 ++-
 2 files changed, 16 insertions(+), 2 deletions(-)



[geode] branch develop updated (b76eba7 -> d436e8d)

2020-10-21 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from b76eba7  GEODE-8629: Redis TTL should round up the returned value 
(#5640)
 add d436e8d  GEODE-8622: Redis INCRBYFLOAT error messages are consistent 
with native Redis (#5636)

No new revisions were added by this update.

Summary of changes:
 .../string/AbstractIncrByFloatIntegrationTest.java | 110 ++---
 .../geode/redis/internal/RedisConstants.java   |   3 +
 .../geode/redis/internal/data/RedisString.java |   9 +-
 .../executor/string/IncrByFloatExecutor.java   |  19 ++--
 4 files changed, 113 insertions(+), 28 deletions(-)



[geode] branch develop updated (b76eba7 -> d436e8d)

2020-10-21 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from b76eba7  GEODE-8629: Redis TTL should round up the returned value 
(#5640)
 add d436e8d  GEODE-8622: Redis INCRBYFLOAT error messages are consistent 
with native Redis (#5636)

No new revisions were added by this update.

Summary of changes:
 .../string/AbstractIncrByFloatIntegrationTest.java | 110 ++---
 .../geode/redis/internal/RedisConstants.java   |   3 +
 .../geode/redis/internal/data/RedisString.java |   9 +-
 .../executor/string/IncrByFloatExecutor.java   |  19 ++--
 4 files changed, 113 insertions(+), 28 deletions(-)



[geode] branch develop updated: GEODE-8633: Add concurrency tests for Redis HDEL (#5647)

2020-10-21 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 99f51c3  GEODE-8633: Add concurrency tests for Redis HDEL (#5647)
99f51c3 is described below

commit 99f51c37211e657ee3bd17b4fec3eeadf2537974
Author: Jens Deppe 
AuthorDate: Wed Oct 21 19:33:24 2020 -0700

GEODE-8633: Add concurrency tests for Redis HDEL (#5647)

- Also add the ability for ConcurrentLoopingThreads to be run
  asynchronously.
---
 .../geode/redis/ConcurrentLoopingThreads.java  |  39 -
 .../internal/executor/hash/HdelDUnitTest.java  | 184 +
 2 files changed, 216 insertions(+), 7 deletions(-)

diff --git 
a/geode-redis/src/commonTest/java/org/apache/geode/redis/ConcurrentLoopingThreads.java
 
b/geode-redis/src/commonTest/java/org/apache/geode/redis/ConcurrentLoopingThreads.java
index a480b6d..bc321f1 100644
--- 
a/geode-redis/src/commonTest/java/org/apache/geode/redis/ConcurrentLoopingThreads.java
+++ 
b/geode-redis/src/commonTest/java/org/apache/geode/redis/ConcurrentLoopingThreads.java
@@ -19,12 +19,18 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.BrokenBarrierException;
 import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
 
 public class ConcurrentLoopingThreads {
   private final int iterationCount;
   private final Consumer[] functions;
+  private ExecutorService executorService = Executors.newCachedThreadPool();
+  private List> loopingFutures;
 
   @SafeVarargs
   public ConcurrentLoopingThreads(int iterationCount,
@@ -33,22 +39,41 @@ public class ConcurrentLoopingThreads {
 this.functions = functions;
   }
 
-  public void run() {
+  /**
+   * Start the operations asynchronously. Use {@link #await()} to wait for 
completion.
+   */
+  public ConcurrentLoopingThreads start() {
 CyclicBarrier latch = new CyclicBarrier(functions.length);
-List loopingThreadStream = Arrays
+
+loopingFutures = Arrays
 .stream(functions)
-.map((r) -> new LoopingThread(r, iterationCount, latch))
-.peek(Thread::start)
+.map(r -> new LoopingThread(r, iterationCount, latch))
+.map(t -> executorService.submit(t))
 .collect(Collectors.toList());
 
-loopingThreadStream.forEach(loopingThread -> {
+return this;
+  }
+
+  /**
+   * Wait for all operations to complete. Will propagate the first exception 
thrown by any of the
+   * operations.
+   */
+  public void await() {
+loopingFutures.forEach(loopingThread -> {
   try {
-loopingThread.join();
-  } catch (InterruptedException e) {
+loopingThread.get();
+  } catch (InterruptedException | ExecutionException e) {
 throw new RuntimeException(e);
   }
 });
+  }
 
+  /**
+   * Start operations and only return once all are complete.
+   */
+  public void run() {
+start();
+await();
   }
 
   private static class LoopingRunnable implements Runnable {
diff --git 
a/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/hash/HdelDUnitTest.java
 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/hash/HdelDUnitTest.java
new file mode 100644
index 000..72945e1
--- /dev/null
+++ 
b/geode-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/hash/HdelDUnitTest.java
@@ -0,0 +1,184 @@
+/*
+ * 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.redis.internal.executor.hash;
+
+import static org.apache.geode.distributed.ConfigurationProperties.REDIS_PORT;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import io.lettuce.core.ClientOptions;
+import io.lettuce.core.RedisClient;
+import i

[geode] branch develop updated: GEODE-8636: Remove hard-coded value from String in NettyRedisServer (#5621)

2020-10-22 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 08e4e9a  GEODE-8636: Remove hard-coded value from String in 
NettyRedisServer (#5621)
08e4e9a is described below

commit 08e4e9acedf0aa157c79ff06feda364b443359e2
Author: John Hutchison 
AuthorDate: Thu Oct 22 10:45:17 2020 -0400

GEODE-8636: Remove hard-coded value from String in NettyRedisServer (#5621)

Authored-by: john Hutchison 
---
 .../redis/internal/netty/NettyRedisServer.java | 25 +-
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/NettyRedisServer.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/NettyRedisServer.java
index adea25f..f93de64 100644
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/NettyRedisServer.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/netty/NettyRedisServer.java
@@ -98,12 +98,16 @@ public class NettyRedisServer {
 this.shutdownInvoker = shutdownInvoker;
 this.redisStats = redisStats;
 this.backgroundExecutor = backgroundExecutor;
+
 if (port < RANDOM_PORT_INDICATOR) {
-  throw new IllegalArgumentException("Redis port cannot be less than 0");
+  throw new IllegalArgumentException(
+  "Redis port cannot be less than " + RANDOM_PORT_INDICATOR);
 }
+
 selectorGroup = createEventLoopGroup("Selector", true, 1);
 workerGroup = createEventLoopGroup("Worker", true, 0);
 subscriberGroup = createEventLoopGroup("Subscriber", true, 0);
+
 try {
   this.bindAddress = getBindAddress(requestedAddress);
   serverChannel = createChannel(port);
@@ -116,15 +120,16 @@ public class NettyRedisServer {
   }
 
   private Channel createChannel(int port) {
-ServerBootstrap serverBootstrap = new ServerBootstrap();
-
-serverBootstrap.group(selectorGroup, 
workerGroup).channel(NioServerSocketChannel.class)
-.childHandler(createChannelInitializer())
-.option(ChannelOption.SO_REUSEADDR, true)
-.option(ChannelOption.SO_RCVBUF, getBufferSize())
-.childOption(ChannelOption.SO_KEEPALIVE, true)
-.childOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
CONNECT_TIMEOUT_MILLIS)
-.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
+ServerBootstrap serverBootstrap =
+new ServerBootstrap()
+.group(selectorGroup, workerGroup)
+.channel(NioServerSocketChannel.class)
+.childHandler(createChannelInitializer())
+.option(ChannelOption.SO_REUSEADDR, true)
+.option(ChannelOption.SO_RCVBUF, getBufferSize())
+.childOption(ChannelOption.SO_KEEPALIVE, true)
+.childOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
CONNECT_TIMEOUT_MILLIS)
+.childOption(ChannelOption.ALLOCATOR, 
PooledByteBufAllocator.DEFAULT);
 
 return createBoundChannel(serverBootstrap, port);
   }



[geode] branch develop updated (0fdfc1a -> 8bfe58f)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 0fdfc1a  GEODE-8067: Improve manifest module resolution (#5660)
 add 8bfe58f  GEODE-8603: Potentially expand classes identified for CI 
stressing to include subclasses (#5601)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 +++
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 196 +
 .../geode/test/util/WhatExtendsJUnitTest.java  |  91 ++
 geode-junit/src/test/resources/expected-pom.xml|   5 +
 7 files changed, 349 insertions(+), 30 deletions(-)
 create mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 create mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated (0fdfc1a -> 8bfe58f)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 0fdfc1a  GEODE-8067: Improve manifest module resolution (#5660)
 add 8bfe58f  GEODE-8603: Potentially expand classes identified for CI 
stressing to include subclasses (#5601)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 +++
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 196 +
 .../geode/test/util/WhatExtendsJUnitTest.java  |  91 ++
 geode-junit/src/test/resources/expected-pom.xml|   5 +
 7 files changed, 349 insertions(+), 30 deletions(-)
 create mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 create mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated (0fdfc1a -> 8bfe58f)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 0fdfc1a  GEODE-8067: Improve manifest module resolution (#5660)
 add 8bfe58f  GEODE-8603: Potentially expand classes identified for CI 
stressing to include subclasses (#5601)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 +++
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 196 +
 .../geode/test/util/WhatExtendsJUnitTest.java  |  91 ++
 geode-junit/src/test/resources/expected-pom.xml|   5 +
 7 files changed, 349 insertions(+), 30 deletions(-)
 create mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 create mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated: GEODE-8654: Remove debug logging from AbstractPubSubIntegrationTest (#5668)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new e3efe55  GEODE-8654: Remove debug logging from 
AbstractPubSubIntegrationTest (#5668)
e3efe55 is described below

commit e3efe552bae5b07188caff4d0d8738931f4134e7
Author: Jens Deppe 
AuthorDate: Mon Oct 26 06:55:20 2020 -0700

GEODE-8654: Remove debug logging from AbstractPubSubIntegrationTest (#5668)

- When this is present, it causes OOM errors when run under
  StressNewTest.
---
 .../internal/executor/pubsub/AbstractPubSubIntegrationTest.java   | 8 
 1 file changed, 8 deletions(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/AbstractPubSubIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/AbstractPubSubIntegrationTest.java
index 4947f60..6e5bf5e 100644
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/AbstractPubSubIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/pubsub/AbstractPubSubIntegrationTest.java
@@ -32,9 +32,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.config.Configurator;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
@@ -42,7 +39,6 @@ import org.junit.Test;
 import redis.clients.jedis.Jedis;
 import redis.clients.jedis.Protocol;
 
-import org.apache.geode.logging.internal.log4j.api.FastLogger;
 import org.apache.geode.logging.internal.log4j.api.LogService;
 import org.apache.geode.redis.mocks.MockBinarySubscriber;
 import org.apache.geode.redis.mocks.MockSubscriber;
@@ -829,10 +825,6 @@ public abstract class AbstractPubSubIntegrationTest 
implements RedisPortSupplier
   @Test
   public void concurrentSubscribers_andPublishers_doesNotHang()
   throws InterruptedException, ExecutionException {
-Logger logger = LogService.getLogger("org.apache.geode.redis");
-Configurator.setAllLevels(logger.getName(), Level.getLevel("DEBUG"));
-FastLogger.setDelegating(true);
-
 AtomicBoolean running = new AtomicBoolean(true);
 
 Future makeSubscribersFuture1 =



[geode] branch develop updated (8bfe58f -> e3efe55)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 8bfe58f  GEODE-8603: Potentially expand classes identified for CI 
stressing to include subclasses (#5601)
 add e3efe55  GEODE-8654: Remove debug logging from 
AbstractPubSubIntegrationTest (#5668)

No new revisions were added by this update.

Summary of changes:
 .../internal/executor/pubsub/AbstractPubSubIntegrationTest.java   | 8 
 1 file changed, 8 deletions(-)



[geode] branch develop updated: GEODE-8630: Add Redis UNLINK command as synonym to DEL (#5641)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new bece588  GEODE-8630: Add Redis UNLINK command as synonym to DEL (#5641)
bece588 is described below

commit bece58843398b58007fd3464b1d7b7d03bf92839
Author: Jens Deppe 
AuthorDate: Mon Oct 26 06:56:50 2020 -0700

GEODE-8630: Add Redis UNLINK command as synonym to DEL (#5641)

- This does not implement async deletes
---
 .../tools_modules/redis_api_for_geode.html.md.erb  |  4 +-
 geode-redis/README.md  | 12 --
 .../key/UnlinkNativeRedisAcceptanceTest.java   | 32 +++
 .../executor/key/AbstractDelIntegrationTest.java   |  9 ++---
 ...est.java => AbstractUnlinkIntegrationTest.java} | 45 ++
 .../executor/key/UnlinkIntegrationTest.java| 32 +++
 .../geode/redis/internal/RedisCommandType.java |  2 +-
 .../redis/internal/SupportedCommandsJUnitTest.java |  2 +-
 8 files changed, 100 insertions(+), 38 deletions(-)

diff --git a/geode-docs/tools_modules/redis_api_for_geode.html.md.erb 
b/geode-docs/tools_modules/redis_api_for_geode.html.md.erb
index bf71440..6daa22f 100644
--- a/geode-docs/tools_modules/redis_api_for_geode.html.md.erb
+++ b/geode-docs/tools_modules/redis_api_for_geode.html.md.erb
@@ -80,7 +80,7 @@ exactly as expected.
 
 -   **Connection**: ECHO
 -   **Hashes**: HDEL, HEXISTS, HGET, HINCRBY, HINCRBYFLOAT, HKEYS, HLEN, 
HMGET, HSCAN, HSETNX, HVALS
--   **Keys**: SCAN
+-   **Keys**: SCAN, UNLINK
 -   **Server**: DBSIZE, FLUSHALL (no async option), FLUSHDB (no async option), 
SHUTDOWN, TIME
 -   **Sets**: SCARD, SDIFF, SDIFFSTORE, SINTER, SINTERSTORE, SISMEMBER, SMOVE, 
SPOP, SRANDMEMBER,
   SSCAN, SUNION, SUNIONSTORE
@@ -139,4 +139,4 @@ attempting to connect to another server.
 The Redis client is responsible for knowing the addresses of all servers.
 
 In the case of a connection failure, an invoked command may or may not 
complete.
-The Redis client is responsible for deciding if the command should be retried.
\ No newline at end of file
+The Redis client is responsible for deciding if the command should be retried.
diff --git a/geode-redis/README.md b/geode-redis/README.md
index 87d7413..da17516 100644
--- a/geode-redis/README.md
+++ b/geode-redis/README.md
@@ -185,7 +185,7 @@ start server \
 | SUBSCRIBE| INCRBYFLOAT   
| CLIENT LIST   |
 | TTL  | MGET  
| CLIENT PAUSE  |
 | TYPE | MSET  
| CLIENT REPLY  |
-| UNSUBSCRIBE  | MSETNX
| CLIENT SETNAME|
+| UNSUBSCRIBE  | MSETNX
| CLIENT SETNAME|
 |  | PSETEX
| CLIENT TRACKING   |
 |  | SCAN  
| CLIENT UNBLOCK|
 |  | SCARD 
| CLUSTER ADDSLOTS  |
@@ -207,7 +207,7 @@ start server \
 |  | SUNION
| CLUSTER RESET |
 |  | SUNIONSTORE   
| CLUSTER SAVECONFIG|
 |  | TIME  
| CLUSTER SET-CONFIG-EPOCH  |
-|  |   
| CLUSTER SETSLOT   |
+|  | UNLINK [1]
| CLUSTER SETSLOT   |
 |  |   
| CLUSTER SLAVES|
 |  |   
| CLUSTER SLOTS |
 |  |   
| COMMAND   |
@@ -296,8 +296,7 @@ start server \
 |  |   
| SWAPDB|
 |  |   
| SYNC  |
 |  |   
| TOUCH |
-|  |   
| UNL

[geode] branch develop updated (3187a61 -> 77ff68c)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 3187a61  GEODE-7696: Add comment to GMSHealthMonitor explaining when 
IllegalStateException may be thrown (#5607)
 add 77ff68c  Revert "GEODE-8603: Potentially expand classes identified for 
CI stressing to include subclasses (#5601)" (#5671)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 ---
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 196 -
 .../geode/test/util/WhatExtendsJUnitTest.java  |  91 --
 geode-junit/src/test/resources/expected-pom.xml|   5 -
 7 files changed, 30 insertions(+), 349 deletions(-)
 delete mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 delete mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated (3187a61 -> 77ff68c)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 3187a61  GEODE-7696: Add comment to GMSHealthMonitor explaining when 
IllegalStateException may be thrown (#5607)
 add 77ff68c  Revert "GEODE-8603: Potentially expand classes identified for 
CI stressing to include subclasses (#5601)" (#5671)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 ---
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 196 -
 .../geode/test/util/WhatExtendsJUnitTest.java  |  91 --
 geode-junit/src/test/resources/expected-pom.xml|   5 -
 7 files changed, 30 insertions(+), 349 deletions(-)
 delete mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 delete mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated (3187a61 -> 77ff68c)

2020-10-26 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 3187a61  GEODE-7696: Add comment to GMSHealthMonitor explaining when 
IllegalStateException may be thrown (#5607)
 add 77ff68c  Revert "GEODE-8603: Potentially expand classes identified for 
CI stressing to include subclasses (#5601)" (#5671)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 ---
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 196 -
 .../geode/test/util/WhatExtendsJUnitTest.java  |  91 --
 geode-junit/src/test/resources/expected-pom.xml|   5 -
 7 files changed, 30 insertions(+), 349 deletions(-)
 delete mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 delete mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated (38ed638 -> 4039a36)

2020-10-27 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 38ed638  GEODE-8071: Prevent Test Flakiness (#5676)
 add 4039a36  GEODE-8603: Potentially expand classes identified for CI 
stressing to include subclasses (#5601) (#5674)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 +++
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 197 +
 .../geode/test/util/WhatExtendsJUnitTest.java  |  99 +++
 geode-junit/src/test/resources/expected-pom.xml|   5 +
 7 files changed, 358 insertions(+), 30 deletions(-)
 create mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 create mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated (38ed638 -> 4039a36)

2020-10-27 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


from 38ed638  GEODE-8071: Prevent Test Flakiness (#5676)
 add 4039a36  GEODE-8603: Potentially expand classes identified for CI 
stressing to include subclasses (#5601) (#5674)

No new revisions were added by this update.

Summary of changes:
 build.gradle   |  29 +++
 ci/pipelines/shared/jinja.variables.yml|   2 +-
 ci/scripts/repeat-new-tests.sh |  54 +++---
 geode-junit/build.gradle   |   2 +-
 .../geode/test/util/StressNewTestHelper.java   | 197 +
 .../geode/test/util/WhatExtendsJUnitTest.java  |  99 +++
 geode-junit/src/test/resources/expected-pom.xml|   5 +
 7 files changed, 358 insertions(+), 30 deletions(-)
 create mode 100644 
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java
 create mode 100644 
geode-junit/src/test/java/org/apache/geode/test/util/WhatExtendsJUnitTest.java



[geode] branch develop updated: GEODE-8609: Create a dunit suspect file per VM (#5625)

2020-10-28 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 84ac086  GEODE-8609: Create a dunit suspect file per VM (#5625)
84ac086 is described below

commit 84ac0863ed4d08bb02c1a96982c89f8627994184
Author: Jens Deppe 
AuthorDate: Wed Oct 28 06:55:00 2020 -0700

GEODE-8609: Create a dunit suspect file per VM (#5625)

- Create a new `dunit_suspect` log for each VM. The logs will now
  be named `dunit_suspect-vm.log`. The locator VM and the test
  runner VM will have logs named `dunit_suspect-locator.log` and
  `dunit_suspect-local.log` respectively.
- Leaving in the bad regexp which will be addressed by a subsequent Jira
---
 .../apache/geode/cache30/ReconnectDUnitTest.java   |   3 +-
 .../ClusterDistributionManagerDUnitTest.java   |   2 +-
 .../tier/sockets/RedundancyLevelTestBase.java  |   2 +-
 .../internal/security/MultiGfshDUnitTest.java  |  11 +-
 .../sockets/ClientServerMiscDUnitTestBase.java |   6 +-
 .../cli/commands/QueryCommandDUnitTestBase.java|  25 +---
 .../apache/geode/test/dunit/IgnoredException.java  |   3 +
 .../geode/test/dunit/internal/DUnitLauncher.java   | 166 ++---
 .../test/dunit/internal/StandAloneDUnitEnv.java|   2 +-
 .../apache/geode/test/greplogs/LogConsumer.java|  32 ++--
 .../geode/test/greplogs/LogConsumerTest.java   |  24 +--
 .../AlterRuntimeCommandDistributedTest.java|  59 +++-
 12 files changed, 180 insertions(+), 155 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java
index d8dbd26..2bfb534 100755
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java
@@ -134,6 +134,7 @@ public class ReconnectDUnitTest extends JUnit4CacheTestCase 
{
 
   @Override
   public final void postSetUp() throws Exception {
+IgnoredException.addIgnoredException("ForcedDisconnectException||Possible 
loss of quorum");
 locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
 final int locPort = locatorPort;
 Host.getHost(0).getVM(locatorVMNumber).invoke(new 
SerializableRunnable("start locator") {
@@ -148,8 +149,6 @@ public class ReconnectDUnitTest extends JUnit4CacheTestCase 
{
   system = (InternalDistributedSystem) locator.getDistributedSystem();
   cache = ((InternalLocator) locator).getCache();
   ReconnectDUnitTest.savedSystem = locator.getDistributedSystem();
-  IgnoredException.addIgnoredException(
-  "org.apache.geode.ForcedDisconnectException||Possible loss of 
quorum");
   // 
MembershipManagerHelper.getMembershipManager(InternalDistributedSystem.getConnectedInstance()).setDebugJGroups(true);
 } catch (IOException e) {
   Assert.fail("unable to start locator", e);
diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java
index 30ceb66..3e3ab70 100644
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java
@@ -293,10 +293,10 @@ public class ClusterDistributionManagerDUnitTest extends 
CacheTestCase {
 assertThat(getCache().isClosed()).isFalse();
 Region region = regionFactory.create("testRegion");
 
+addIgnoredException("elapsed while waiting for replies");
 vm1.invoke("Connect to distributed system", () -> {
   config.setProperty(NAME, "sleeper");
   getSystem(config);
-  addIgnoredException("elapsed while waiting for replies");
 
   RegionFactory regionFactory2 = 
getCache().createRegionFactory();
   regionFactory2.setScope(Scope.DISTRIBUTED_ACK);
diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
index 70952dd..4b2f1fd 100755
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
@@ -107,7 +107,7 @@ public class RedundancyLevelTestBa

geode git commit: GEODE-3071: Provide capability to parallelize distributedTests

2017-06-14 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3071 [created] 588c3ed8a


GEODE-3071: Provide capability to parallelize distributedTests

Herewith the ability to leverage Gradle's parallel test execution
capability to run dunits in parallel. This is combined with launching
tests in Docker containers to provide process, network and filesystem
isolation. Depending on the size of your system, this can speed up
running the distributedTest task 2-5 times.

The capability is enabled by launching gradle with '-PparallelDunit'

Tunables, enabled as gradle parametrs (-P option) are:

- dunitDockerImage: The docker image which will be used to launch
  tests. The image must have the JAVA_HOME environment variable set. The
  image must be pulled locally before starting the tests.
- dunitParallelForks: The number of parallel docker containers to be
  launched.
- dunitDockerUser: The docker user which will run the tests. Because of
  the way that the containers map the build directory into them, the
  test artifacts, will be written with this user id. By default this is
  'root'.


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

Branch: refs/heads/feature/GEODE-3071
Commit: 588c3ed8af4b9a1b46737c2faebafa589a396e12
Parents: a4d790c
Author: Jens Deppe 
Authored: Wed Jun 14 08:03:22 2017 -0700
Committer: Jens Deppe 
Committed: Wed Jun 14 08:03:22 2017 -0700

--
 build.gradle |  2 ++
 gradle.properties|  7 
 gradle/docker.gradle | 83 +++
 3 files changed, 92 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/588c3ed8/build.gradle
--
diff --git a/build.gradle b/build.gradle
index ec6b920..57372b3 100755
--- a/build.gradle
+++ b/build.gradle
@@ -26,6 +26,7 @@ buildscript {
 classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1'
 classpath "com.diffplug.gradle.spotless:spotless:2.2.0"
 classpath "me.champeau.gradle:jmh-gradle-plugin:0.3.1"
+classpath "com.pedjak.gradle.plugins:dockerized-test:0.4.2"
   }
 }
 
@@ -82,6 +83,7 @@ apply from: "${scriptDir}/code-analysis.gradle"
 apply from: "${scriptDir}/sonar.gradle"
 apply from: "${scriptDir}/ide.gradle"
 apply from: "${scriptDir}/rat.gradle"
+apply from: "${scriptDir}/docker.gradle"
 
 subprojects {
   // Make sure clean task for rootProject runs last

http://git-wip-us.apache.org/repos/asf/geode/blob/588c3ed8/gradle.properties
--
diff --git a/gradle.properties b/gradle.properties
index ca79a38..9462295 100755
--- a/gradle.properties
+++ b/gradle.properties
@@ -49,3 +49,10 @@ buildRoot=
 
 # We want signing to be on by default. Signing requires GPG to be set up.
 nexusSignArchives = true
+
+# Control how many concurrent dunit (using docker) tests will be run
+dunitParallelForks = 8
+# This is the name of the Docker image for running parallel dunits
+dunitDockerImage = openjdk:8
+# Docker user for parallel dunit tests
+dunitDockerUser = root

http://git-wip-us.apache.org/repos/asf/geode/blob/588c3ed8/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
new file mode 100644
index 000..7a74c5d
--- /dev/null
+++ b/gradle/docker.gradle
@@ -0,0 +1,83 @@
+/*
+ * Configuration for running (dunit) tests in parallel in Docker containers.
+ * The container used must hava JAVA_HOME set in it's environment and must
+ * have 'java' defined on the path. For example, the relevant Dockerfile
+ * content could be:
+ * 
+ *   ENV JAVA_HOME=/opt/jdk1.8.0_u101
+ *   ENV PATH=$PATH:$JAVA_HOME/bin
+ *
+ * In addition, the container must have docker installed.
+ *
+ * The plugin can be activated with the Gradle property 'parallelDunit'.
+ * Additional properties that can be set are:
+ *
+ *  dunitDockerImage   - The docker image used for running parallel dunits. The
+ *   default image is 'openjdk:8'. The image is required to
+ *   have 'JAVA_HOME' set as an environment variable.
+ *  dunitParallelForks - The number of parallel containers that will be
+ *   launched. The default is 8.
+ *  dunitDockerUser- The user used within the docker container to run 
tests.
+ *   The default is 'root'.
+ */
+
+def dockerConfig = {
+  maxParallelForks = dunitParallelForks.toInteger()
+
+  docker {
+// base image for creating docker containers that execute the tests
+image = dunitDockerImage
+
+// volumes mounted to the con

geode git commit: Remove debug println

2017-06-15 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3071 588c3ed8a -> ee88cd282


Remove debug println


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

Branch: refs/heads/feature/GEODE-3071
Commit: ee88cd282be5fbe43a2d89cc3c1d4f548ba2e183
Parents: 588c3ed
Author: Jens Deppe 
Authored: Thu Jun 15 08:01:46 2017 -0700
Committer: Jens Deppe 
Committed: Thu Jun 15 08:01:46 2017 -0700

--
 gradle/docker.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/ee88cd28/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index 7a74c5d..5c2ef77 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -65,7 +65,7 @@ def dockerConfig = {
 
   args[3] = args[3] + matcher[0][1]
   def workdir = new File(args[3])
-  println "dockerize: making ${workdir}"
+  // println "dockerize: making ${workdir}"
   workdir.mkdirs()
   // println args
 



geode git commit: GEODE_3071: Add Apache license header

2017-06-16 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3071 ee88cd282 -> b26fa518c


GEODE_3071: Add Apache license header


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

Branch: refs/heads/feature/GEODE-3071
Commit: b26fa518c8ab04f60697a5b61c36a1222a68b515
Parents: ee88cd2
Author: Jens Deppe 
Authored: Fri Jun 16 08:05:32 2017 -0700
Committer: Jens Deppe 
Committed: Fri Jun 16 08:05:32 2017 -0700

--
 gradle/docker.gradle | 17 +
 1 file changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/b26fa518/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index 5c2ef77..b67c073 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -1,4 +1,21 @@
 /*
+ * 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.
+ */
+
+/*
  * Configuration for running (dunit) tests in parallel in Docker containers.
  * The container used must hava JAVA_HOME set in it's environment and must
  * have 'java' defined on the path. For example, the relevant Dockerfile



geode git commit: GEODE-3071: Pull config of docker volumes into top level script so that they can be overridden

2017-06-19 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3071 b26fa518c -> 07e8986e3


GEODE-3071: Pull config of docker volumes into top level script so that they 
can be overridden


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

Branch: refs/heads/feature/GEODE-3071
Commit: 07e8986e3deb722c0beea380eac00a18c86844aa
Parents: b26fa51
Author: Jens Deppe 
Authored: Mon Jun 19 07:42:57 2017 -0700
Committer: Jens Deppe 
Committed: Mon Jun 19 07:48:27 2017 -0700

--
 build.gradle | 5 +
 gradle/docker.gradle | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/07e8986e/build.gradle
--
diff --git a/build.gradle b/build.gradle
index 57372b3..4feb879 100755
--- a/build.gradle
+++ b/build.gradle
@@ -74,6 +74,11 @@ if (name == 'geode') {
   ext.scriptDir = 'gradle'
 }
 
+if (project.hasProperty('parallelDunit')) {
+  def pwd = System.getenv('PWD')
+  ext.dunitDockerVolumes = ["${pwd}":pwd]
+}
+
 apply from: "${scriptDir}/utilities.gradle"
 apply from: "${scriptDir}/java.gradle"
 apply from: "${scriptDir}/dependency-resolution.gradle"

http://git-wip-us.apache.org/repos/asf/geode/blob/07e8986e/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index b67c073..7971974 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -47,11 +47,11 @@ def dockerConfig = {
 
 // volumes mounted to the containers
 // in a form: host_dir : container_dir
-def pwd = System.getenv('PWD')
 def gradleHome = System.getenv('GRADLE_USER_HOME') ?: 
"${System.getenv('HOME')}/.gradle"
 volumes = ["${gradleHome}":gradleHome]
 
-volumes << ["${pwd}":pwd]
+// Add volumes configured by top-level build script
+volumes << project.dunitDockerVolumes
 
 // specify the user for starting Gradle test worker within the container.
 user = dunitDockerUser



[20/24] geode git commit: GEODE-2301 Doc note to deprecate Geode JTA trans mgr

2017-06-19 Thread jensdeppe
GEODE-2301 Doc note to deprecate Geode JTA trans mgr

This closes #581


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

Branch: refs/heads/feature/GEODE-3071
Commit: 42350f1ac3a5cac92f60284863a9d704097b5288
Parents: 5546a87
Author: Karen Miller 
Authored: Thu Jun 15 10:39:44 2017 -0700
Committer: Karen Miller 
Committed: Fri Jun 16 09:42:35 2017 -0700

--
 geode-docs/developing/transactions/JTA_transactions.html.md.erb | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/42350f1a/geode-docs/developing/transactions/JTA_transactions.html.md.erb
--
diff --git a/geode-docs/developing/transactions/JTA_transactions.html.md.erb 
b/geode-docs/developing/transactions/JTA_transactions.html.md.erb
index 3164dce..ffb6082 100644
--- a/geode-docs/developing/transactions/JTA_transactions.html.md.erb
+++ b/geode-docs/developing/transactions/JTA_transactions.html.md.erb
@@ -190,6 +190,7 @@ See [JCA Resource Adapter 
Example](jca_adapter_example.html#concept_swv_z2p_wk)
 ## Using Geode as the 
JTA Transaction Manager
 
 You can also use Geode as the JTA transaction manager.
+As of Geode 1.2, Geode's JTA transaction manager is deprecated.
 
 Geode ships with its own implementation of a JTA transaction manager. However, 
note that this implementation is not XA-compliant; therefore, it does not 
persist any state, which could lead to an inconsistent state after recovering a 
crashed member.
 



[04/24] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.

2017-06-19 Thread jensdeppe
http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
index 2758429..0829495 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java
@@ -75,6 +75,13 @@ import java.text.MessageFormat;
  */
 public class CliStrings {
 
+  public static final String GROUP = "group";
+  public static final String GROUPS = "groups";
+  public static final String MEMBER = "member";
+  public static final String MEMBERS = "members";
+  public static final String JAR = "jar";
+  public static final String JARS = "jars";
+
   private static final String LOG_LEVEL_VALUES =
   "Possible values for log-level include: ALL, TRACE, DEBUG, INFO, WARN, 
ERROR, FATAL, OFF.";
 
@@ -301,7 +308,6 @@ public class CliStrings {
   "Alter a region with the given path and configuration.";
   public static final String ALTER_REGION__REGION = "name";
   public static final String ALTER_REGION__REGION__HELP = "Name/Path of the 
region to be altered.";
-  public static final String ALTER_REGION__GROUP = "group";
   public static final String ALTER_REGION__GROUP__HELP =
   "Group(s) of members on which the region will be altered.";
   public static final String ALTER_REGION__ENTRYEXPIRATIONIDLETIME = 
"entry-idle-time-expiration";
@@ -384,10 +390,9 @@ public class CliStrings {
   public static final String ALTER_RUNTIME_CONFIG = "alter runtime";
   public static final String ALTER_RUNTIME_CONFIG__HELP =
   "Alter a subset of member or members configuration properties while 
running.";
-  public static final String ALTER_RUNTIME_CONFIG__MEMBER = "member";
   public static final String ALTER_RUNTIME_CONFIG__MEMBER__HELP =
   "Name/Id of the member in whose configuration will be altered.";
-  public static final String ALTER_RUNTIME_CONFIG__GROUP = "group";
+
   public static final String ALTER_RUNTIME_CONFIG__GROUP__HELP =
   "Group of members whose configuration will be altered.";
   public static final String ALTER_RUNTIME_CONFIG__ARCHIVE__FILE__SIZE__LIMIT =
@@ -481,7 +486,6 @@ public class CliStrings {
   public static final String COMPACT_DISK_STORE__NAME = "name";
   public static final String COMPACT_DISK_STORE__NAME__HELP =
   "Name of the disk store to be compacted.";
-  public static final String COMPACT_DISK_STORE__GROUP = "group";
   public static final String COMPACT_DISK_STORE__GROUP__HELP =
   "Group(s) of members that will perform disk compaction. If no group is 
specified the disk store will be compacted by all members.";
   public static final String COMPACT_DISK_STORE__DISKSTORE_0_DOESNOT_EXIST =
@@ -657,7 +661,6 @@ public class CliStrings {
   public static final String 
CREATE_ASYNC_EVENT_QUEUE__LISTENER_PARAM_AND_VALUE = "listener-param";
   public static final String 
CREATE_ASYNC_EVENT_QUEUE__LISTENER_PARAM_AND_VALUE__HELP =
   "Parameter name for the AsyncEventListener.  Optionally, parameter names 
may be followed by # and a value for the parameter.  Example: 
--listener-param=loadAll --listener-param=maxRead#1024";
-  public static final String CREATE_ASYNC_EVENT_QUEUE__GROUP = "group";
   public static final String CREATE_ASYNC_EVENT_QUEUE__GROUP__HELP =
   "Group(s) of members on which queue will be created. If no group is 
specified the queue will be created on all members.";
   public static final String 
CREATE_ASYNC_EVENT_QUEUE__ERROR_WHILE_CREATING_REASON_0 =
@@ -701,7 +704,6 @@ public class CliStrings {
   public static final String CREATE_DISK_STORE__DIRECTORY_AND_SIZE = "dir";
   public static final String CREATE_DISK_STORE__DIRECTORY_AND_SIZE__HELP =
   "Directories where the disk store files will be written, the directories 
will be created if they don't exist.  Optionally, directory names may be 
followed by # and the maximum number of megabytes that the disk store can use 
in the directory.  Example: --dir=/data/ds1 --dir=/data/ds2#5000";
-  public static final String CREATE_DISK_STORE__GROUP = "group";
   public static final String CREATE_DISK_STORE__GROUP__HELP =
   "Group(s) of members on which the disk store will be created. If no 
group is specified the disk store will be created on all members.";
   public static final String CREATE_DISK_STORE__DISK_USAGE_WARNING_PCT =
@@ -727,13 +729,11 @@ public class CliStrings {
   public static final String CREATE_INDEX__REGION = "region";
   public static final String CREATE_INDEX__REGION__HELP =
   "Name/Path of the region which corresponds to the \"from\" clause in a 
query.";
-  public static final String CREATE_INDEX__MEMBER = "m

[08/24] geode git commit: GEODE-2622: Fix GMSMembershipManagerJUnitTest use of Mockito 2.7.11

2017-06-19 Thread jensdeppe
GEODE-2622: Fix GMSMembershipManagerJUnitTest use of Mockito 2.7.11

- Fix 4 test failures in GMSMembershipManagerJUnitTest

This closes #573


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

Branch: refs/heads/feature/GEODE-3071
Commit: 740a4ef991229d6d9c27adf20740c27415b2fedc
Parents: 90900ac
Author: Srikanth Manvi 
Authored: Sun Jun 11 00:40:57 2017 -0400
Committer: Kirk Lund 
Committed: Wed Jun 14 11:06:32 2017 -0700

--
 .../membership/gms/mgr/GMSMembershipManagerJUnitTest.java| 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/740a4ef9/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
index 2692650..29f192f 100644
--- 
a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
@@ -303,7 +303,7 @@ public class GMSMembershipManagerJUnitTest {
 Set failures = 
manager.directChannelSend(recipients, m, null);
 assertTrue(failures == null);
 verify(dc).send(isA(GMSMembershipManager.class), 
isA(mockMembers.getClass()),
-isA(DistributionMessage.class), anyInt(), anyInt());
+isA(DistributionMessage.class), anyLong(), anyLong());
   }
 
   @Test
@@ -318,7 +318,7 @@ public class GMSMembershipManagerJUnitTest {
 ConnectExceptions exception = new ConnectExceptions();
 exception.addFailure(recipients[0], new Exception("testing"));
 when(dc.send(any(GMSMembershipManager.class), any(mockMembers.getClass()),
-any(DistributionMessage.class), anyInt(), 
anyInt())).thenThrow(exception);
+any(DistributionMessage.class), anyLong(), 
anyLong())).thenThrow(exception);
 failures = manager.directChannelSend(recipients, m, null);
 assertTrue(failures != null);
 assertEquals(1, failures.size());
@@ -352,7 +352,7 @@ public class GMSMembershipManagerJUnitTest {
 Set failures = manager.directChannelSend(null, 
m, null);
 assertTrue(failures == null);
 verify(dc).send(isA(GMSMembershipManager.class), 
isA(mockMembers.getClass()),
-isA(DistributionMessage.class), anyInt(), anyInt());
+isA(DistributionMessage.class), anyLong(), anyLong());
   }
 
   @Test
@@ -367,7 +367,7 @@ public class GMSMembershipManagerJUnitTest {
 ConnectExceptions exception = new ConnectExceptions();
 exception.addFailure(recipients[0], new Exception("testing"));
 when(dc.send(any(GMSMembershipManager.class), any(mockMembers.getClass()),
-any(DistributionMessage.class), anyInt(), 
anyInt())).thenThrow(exception);
+any(DistributionMessage.class), anyLong(), 
anyLong())).thenThrow(exception);
 Assertions.assertThatThrownBy(() -> {
   manager.directChannelSend(recipients, m, null);
 }).isInstanceOf(DistributedSystemDisconnectedException.class);



[06/24] geode git commit: GEODE-3062: create new SecurityService after receiving cluster config

2017-06-19 Thread jensdeppe
GEODE-3062: create new SecurityService after receiving cluster config


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

Branch: refs/heads/feature/GEODE-3071
Commit: cecad6c37d59369a29237f7d940f297804633aa1
Parents: a643327
Author: Kirk Lund 
Authored: Fri Jun 9 15:23:53 2017 -0700
Committer: Kirk Lund 
Committed: Wed Jun 14 10:34:28 2017 -0700

--
 .../internal/InternalDistributedSystem.java |  4 +++
 .../cache/ClusterConfigurationLoader.java   |  7 ++--
 .../geode/internal/cache/GemFireCacheImpl.java  | 35 +---
 .../ClusterConfigWithSecurityDUnitTest.java | 31 +
 4 files changed, 55 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/cecad6c3/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index 22edb6f..f406393 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -516,6 +516,10 @@ public class InternalDistributedSystem extends 
DistributedSystem
 return this.securityService;
   }
 
+  public void setSecurityService(SecurityService securityService) {
+this.securityService = securityService;
+  }
+
   /**
* Registers a listener to the system
* 

http://git-wip-us.apache.org/repos/asf/geode/blob/cecad6c3/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
index 4f4881f..92cfd96 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
@@ -152,13 +152,12 @@ public class ClusterConfigurationLoader {
 
   /***
* Apply the gemfire properties cluster configuration on this member
-   *
-   * @param cache Cache created for this member
+   * 
* @param response {@link ConfigurationResponse} containing the requested 
{@link Configuration}
* @param config this member's config
*/
-  public static void applyClusterPropertiesConfiguration(Cache cache,
-  ConfigurationResponse response, DistributionConfig config) {
+  public static void applyClusterPropertiesConfiguration(ConfigurationResponse 
response,
+  DistributionConfig config) {
 if (response == null || response.getRequestedConfiguration().isEmpty()) {
   return;
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/cecad6c3/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index 40df0c7..c503c40 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -77,6 +77,7 @@ import javax.transaction.TransactionManager;
 import com.sun.jna.Native;
 import com.sun.jna.Platform;
 import org.apache.commons.lang.StringUtils;
+import org.apache.geode.internal.security.SecurityServiceFactory;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelCriterion;
@@ -126,7 +127,6 @@ import org.apache.geode.cache.client.PoolFactory;
 import org.apache.geode.cache.client.PoolManager;
 import org.apache.geode.cache.client.internal.ClientMetadataService;
 import org.apache.geode.cache.client.internal.ClientRegionFactoryImpl;
-import org.apache.geode.cache.client.internal.ConnectionImpl;
 import org.apache.geode.cache.client.internal.InternalClientCache;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.control.ResourceManager;
@@ -213,7 +213,6 @@ import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.offheap.MemoryAllocator;
 import 
org.apache.geode.internal.process.ClusterConfigurationNotAvailableException;
 import org.apache.geod

[23/24] geode git commit: GEODE-2854: GEODE REST API Docs Missing Authentication This closes #583

2017-06-19 Thread jensdeppe
GEODE-2854: GEODE REST API Docs Missing Authentication
This closes #583


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

Branch: refs/heads/feature/GEODE-3071
Commit: 78f08e8a224cf99ff9981acacbf88452911f9069
Parents: dbc3197
Author: Dave Barnes 
Authored: Thu Jun 15 13:43:41 2017 -0700
Committer: Dave Barnes 
Committed: Fri Jun 16 15:47:05 2017 -0700

--
 .../source/subnavs/geode-subnav.erb |   8 +-
 geode-docs/rest_apps/setup_config.html.md.erb   | 269 ---
 2 files changed, 176 insertions(+), 101 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/78f08e8a/geode-book/master_middleman/source/subnavs/geode-subnav.erb
--
diff --git a/geode-book/master_middleman/source/subnavs/geode-subnav.erb 
b/geode-book/master_middleman/source/subnavs/geode-subnav.erb
index aa0faf4..37c0b83 100644
--- a/geode-book/master_middleman/source/subnavs/geode-subnav.erb
+++ b/geode-book/master_middleman/source/subnavs/geode-subnav.erb
@@ -1576,8 +1576,14 @@ limitations under the License.
 
 Prerequisites and Limitations 
for Writing REST Applications
 
-
+
 Setup and Configuration
+
+Enabling
 the REST API
+Starting
 the REST API Service
+Implementing
 Authentication
+Programmatic
 Startup
+
 
 
 Using the Swagger UI to 
Browse REST APIs

http://git-wip-us.apache.org/repos/asf/geode/blob/78f08e8a/geode-docs/rest_apps/setup_config.html.md.erb
--
diff --git a/geode-docs/rest_apps/setup_config.html.md.erb 
b/geode-docs/rest_apps/setup_config.html.md.erb
index 566b1a2..c557f4f 100644
--- a/geode-docs/rest_apps/setup_config.html.md.erb
+++ b/geode-docs/rest_apps/setup_config.html.md.erb
@@ -19,7 +19,10 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 -->
 
-The Apache Geode developer REST interface runs as an embedded HTTP or HTTPS 
service (Jetty server) within a Geode data node.
+The Apache Geode Developer REST interface runs as an embedded HTTP or HTTPS 
service (Jetty server) within one
+or more Geode servers.
+
+# REST API Libraries
 
 All Geode REST interface classes and required JAR files are distributed as a 
WAR file with the Geode product distribution. You can find the file in the 
following location:
 
@@ -29,162 +32,228 @@ All Geode REST interface classes and required JAR files 
are distributed as a WAR
 
 where _install-dir_ is the server installation directory and _n.n.n_ is a 
version number.
 
-To enable the developer REST API service in Apache Geode, set the 
`start-dev-rest-api` Geode property to `true` when starting a data node using 
either `gfsh` or the ServerLauncher API. Setting this property to true on a 
data node will start up an embedded Jetty server and deploy the REST developer 
API WAR file.
+# Enabling the 
REST API
+
+The REST API service for application development runs only on servers; you 
cannot run the service on a locator.
 
-**Note:**
-The REST API service for application development runs only on servers; you 
cannot use locators to host the developer Geode REST API services.
+To enable the Developer REST API service on a given server, set the 
`start-dev-rest-api` property
+to `true` for the server, using either the `gfsh start server` command or the 
ServerLauncher API.
+This starts an embedded Jetty server and deploys the Developer REST API WAR 
file on that server.
 
-You can have multiple REST enabled data nodes in a single distributed system. 
Each data node should
-have a separate host name and unique end point. To ensure that the data node 
is reachable on a
-machine with multiple NIC addresses, you can use `http-service-bind-address` 
to bind an address to
-the REST API service (as well as the other embedded web services such as 
Pulse).
+## Enabling the REST API on Multiple Servers
 
-You can also configure the Developer REST API service to run over
-HTTPS by enabling ssl for the `http` component in `gemfire.properties`
-or `gfsecurity.properties` or on server startup:
-See [SSL](../managing/security/ssl_overview.html) for details on configuring 
SSL parameters.
-These SSL parameters apply to all HTTP services hosted on the configured 
server, which can include the following:
+You can

[09/24] geode git commit: GEODE-2558: Upgrade mockito to 2.7.11 and powermock to 1.7.0RC2

2017-06-19 Thread jensdeppe
GEODE-2558: Upgrade mockito to 2.7.11 and powermock to 1.7.0RC2

* mockito-core.version = 2.7.11
* powermock.version = 1.7.0RC2
* fix compilation errors
* there are several test failures in geode-core and geode-lucene

geode-core test failures:

* GMSMembershipManagerJUnitTest.testDirectChannelSend
* GMSMembershipManagerJUnitTest.testDirectChannelSendAllRecipients
* 
GMSMembershipManagerJUnitTest.testDirectChannelSendFailureDueToForcedDisconnect
* GMSMembershipManagerJUnitTest.testDirectChannelSendFailureToOneRecipient
* Put61Test.integratedSecurityShouldSucceedIfAuthorized
* Put61Test.noSecurityShouldSucceed
* Put61Test.oldSecurityShouldSucceedIfAuthorized
* Put65Test.integratedSecurityShouldSucceedIfAuthorized
* Put65Test.noSecurityShouldSucceed
* Put65Test.oldSecurityShouldSucceedIfAuthorized
* PutTest.integratedSecurityShouldSucceedIfAuthorized
* PutTest.noSecurityShouldSucceed
* PutTest.oldSecurityShouldSucceedIfAuthorized
* FastLoggerJUnitTest.delegateIsDebugEnabledWhenIsDelegating
* FastLoggerJUnitTest.delegateIsDebugEnabledWhenIsDelegating
* FastLoggerJUnitTest.delegateIsDebugEnabledWhenIsDelegating
* OffHeapRegionEntryHelperJUnitTest.releaseEntryShouldSetValueToRemovePhase2
* 
OffHeapRegionEntryHelperJUnitTest.releaseEntryShouldSetValueToRemovePhase2AndSetsAsyncToFalseForDiskEntry
* 
OffHeapRegionEntryHelperJUnitTest.setValueShouldChangeTheRegionEntryAddressToNewAddressAndDoesNothingIfOldAddressIsATokenAddress
* 
OffHeapRegionEntryHelperJUnitTest.setValueShouldChangeTheRegionEntryAddressToNewAddressAndDoesNothingIfOldAddressIsAnEncodedAddress
* 
OffHeapRegionEntryHelperJUnitTest.setValueShouldChangeTheRegionEntryAddressToNewAddressAndReleaseOldValueIfItsOnOffHeap
* StatisticsImplTest.invokeSuppliersShouldLogErrorOnlyOnce
* ConnectionJUnitTest.testSuspicionRaised

geode-lucene test failures:

* StringQueryProviderJUnitTest.usesCustomAnalyzer
* RegionDirectoryJUnitTest.testFsyncDoesntCreateNewFiles
* RegionDirectoryJUnitTest.testPendingDeletions


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

Branch: refs/heads/feature/GEODE-3071
Commit: 90900ac5292fea85cec513653e489dfdadafd311
Parents: cecad6c
Author: Kirk Lund 
Authored: Fri Feb 24 21:10:50 2017 -0800
Committer: Kirk Lund 
Committed: Wed Jun 14 11:06:32 2017 -0700

--
 geode-core/build.gradle |  4 
 .../query/internal/index/HashIndexSetJUnitTest.java |  2 +-
 .../gms/messenger/JGroupsMessengerJUnitTest.java|  6 +++---
 .../partitioned/DeposePrimaryBucketMessageTest.java |  1 -
 .../cache/partitioned/FetchEntryMessageTest.java|  1 -
 .../partitioned/FetchPartitionDetailsMessageTest.java   |  1 -
 .../cache/partitioned/MoveBucketMessageTest.java|  1 -
 .../cache/partitioned/RemoveBucketMessageTest.java  |  1 -
 .../cache/tier/sockets/command/ContainsKey66Test.java   |  2 +-
 .../cache/tier/sockets/command/CreateRegionTest.java|  2 +-
 .../cache/tier/sockets/command/Destroy65Test.java   |  2 +-
 .../cache/tier/sockets/command/DestroyRegionTest.java   |  2 +-
 .../cache/tier/sockets/command/DestroyTest.java |  2 +-
 .../tier/sockets/command/ExecuteFunction65Test.java |  2 +-
 .../tier/sockets/command/ExecuteFunction66Test.java |  2 +-
 .../cache/tier/sockets/command/ExecuteFunctionTest.java |  2 +-
 .../internal/cache/tier/sockets/command/Get70Test.java  |  2 +-
 .../cache/tier/sockets/command/GetAll651Test.java   |  2 +-
 .../cache/tier/sockets/command/GetAll70Test.java|  2 +-
 .../internal/cache/tier/sockets/command/GetAllTest.java |  2 +-
 .../tier/sockets/command/GetAllWithCallbackTest.java|  2 +-
 .../cache/tier/sockets/command/InvalidateTest.java  |  2 +-
 .../internal/cache/tier/sockets/command/KeySetTest.java |  2 +-
 .../internal/cache/tier/sockets/command/Put61Test.java  |  2 +-
 .../internal/cache/tier/sockets/command/Put65Test.java  |  2 +-
 .../internal/cache/tier/sockets/command/PutTest.java|  2 +-
 .../tier/sockets/command/RegisterInterest61Test.java|  2 +-
 .../sockets/command/RegisterInterestList61Test.java |  2 +-
 .../sockets/command/RegisterInterestList66Test.java |  2 +-
 .../tier/sockets/command/RegisterInterestListTest.java  |  2 +-
 .../tier/sockets/command/RegisterInterestTest.java  |  2 +-
 .../cache/tier/sockets/command/RemoveAllTest.java   |  2 +-
 .../cache/tier/sockets/command/RequestTest.java |  2 +-
 .../tier/sockets/command/UnregisterInterestTest.java|  2 +-
 .../internal/cache/wan/serial/DestroyMessageTest.java   |  1 -
 .../cache/xmlcache/DefaultEntityResolver2Test.java  |  1 -
 .../internal/CompositeBuilderViaFromTest.java   |  1 -
 .../internal/CompositeBuilderViaProxyTest.java 

[19/24] geode git commit: GEODE-2632: consolidate different types of SecurityService

2017-06-19 Thread jensdeppe
GEODE-2632: consolidate different types of SecurityService

* combine EnabledSecurityService and CustomSecurityService into 
IntegratedSecurityService
* combine DisabledSecurityService and LegacySecurityService
* combine ConfigInitializer and RealmInitializer
* provide default impelementations of SecurityService
* consolidate SecurityService creation.


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

Branch: refs/heads/feature/GEODE-3071
Commit: 5546a8732203baec09fd3922a8e4cb86e5048492
Parents: dd90c71
Author: Jinmei Liao 
Authored: Fri Jun 9 12:29:10 2017 -0700
Committer: Jinmei Liao 
Committed: Thu Jun 15 11:32:30 2017 -0700

--
 .../internal/InternalDistributedSystem.java |  62 +--
 .../geode/internal/cache/GemFireCacheImpl.java  |   2 -
 .../internal/security/CallbackInstantiator.java |  28 ++
 .../security/CustomSecurityService.java | 346 
 .../security/DisabledSecurityService.java   | 221 ---
 .../security/EnabledSecurityService.java| 393 ---
 .../security/IntegratedSecurityService.java | 374 ++
 .../security/LegacySecurityService.java | 186 +
 .../internal/security/SecurityService.java  |  99 +++--
 .../security/SecurityServiceFactory.java| 188 +++--
 .../internal/security/SecurityServiceType.java  |  28 --
 .../security/shiro/ConfigInitializer.java   |  43 --
 .../security/shiro/CustomAuthRealm.java |  19 +-
 .../security/shiro/RealmInitializer.java|  54 ---
 .../security/shiro/SecurityManagerProvider.java |  83 
 .../membership/MembershipJUnitTest.java |   3 -
 .../security/DisabledSecurityServiceTest.java   | 164 
 .../security/EnabledSecurityServiceTest.java| 184 -
 .../internal/security/FakePostProcessor.java| 103 -
 .../internal/security/FakeSecurityManager.java  | 103 -
 ...ntegratedSecurityServiceConstructorTest.java |  93 +
 .../security/IntegratedSecurityServiceTest.java | 166 
 .../security/LegacySecurityServiceTest.java |  58 +++
 ...urityServiceFactoryShiroIntegrationTest.java |  38 +-
 .../security/SecurityServiceFactoryTest.java| 314 ++-
 .../internal/security/SecurityServiceTest.java  |  21 +-
 .../shiro/ConfigInitializerIntegrationTest.java |  91 -
 ...tyServiceWithCustomRealmIntegrationTest.java |   2 +-
 ...urityServiceWithShiroIniIntegrationTest.java |   2 +-
 .../CacheFactoryWithSecurityObjectTest.java |  68 +++-
 ...SecurityManagerLifecycleDistributedTest.java |   4 +-
 .../apache/geode/tools/pulse/tests/Server.java  |  19 +-
 .../tools/pulse/tests/rules/ServerRule.java |   6 +-
 33 files changed, 1161 insertions(+), 2404 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/5546a873/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index 22edb6f..85f9146 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -15,35 +15,8 @@
 
 package org.apache.geode.distributed.internal;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.lang.reflect.Array;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.StringTokenizer;
-import java.util.TreeSet;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.geode.cache.CacheXmlException;
-import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.internal.security.SecurityServiceFactory;
-import org.apache.geode.security.PostProcessor;
-import org.apache.logging.log4j.Logger;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PO

[05/24] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.

2017-06-19 Thread jensdeppe
GEODE-2818: add alias to any command's options that involves "group", "member", 
"jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.

* this closes #560


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

Branch: refs/heads/feature/GEODE-3071
Commit: db8e1df392bcdbaabb44263e6c699756eda14850
Parents: a4d790c
Author: YehEmily 
Authored: Mon Jun 5 13:03:39 2017 -0700
Committer: Jinmei Liao 
Committed: Wed Jun 14 08:59:51 2017 -0700

--
 ...erConfigurationServiceEndToEndDUnitTest.java |   8 +-
 .../internal/cli/commands/ConfigCommands.java   |  20 ++-
 .../CreateAlterDestroyRegionCommands.java   |  24 ++--
 .../internal/cli/commands/DataCommands.java |   4 +-
 .../internal/cli/commands/DeployCommands.java   |  11 +-
 .../cli/commands/DiskStoreCommands.java |  12 +-
 .../cli/commands/DurableClientCommands.java |  22 +--
 .../cli/commands/ExportLogsCommand.java |   4 +-
 .../internal/cli/commands/FunctionCommands.java |  20 +--
 .../internal/cli/commands/IndexCommands.java|  14 +-
 .../cli/commands/LauncherLifecycleCommands.java |   4 +-
 .../internal/cli/commands/MemberCommands.java   |   4 +-
 .../cli/commands/MiscellaneousCommands.java |  34 +++--
 .../internal/cli/commands/QueueCommands.java|   2 +-
 .../internal/cli/commands/RegionCommands.java   |   6 +-
 .../internal/cli/commands/WanCommands.java  | 116 +++
 .../internal/cli/i18n/CliStrings.java   |  99 ++---
 .../controllers/ConfigCommandsController.java   |  24 ++--
 .../web/controllers/DataCommandsController.java |   4 +-
 .../controllers/DeployCommandsController.java   |  26 ++--
 .../DiskStoreCommandsController.java|  22 ++-
 .../DurableClientCommandsController.java|  50 +++
 .../web/controllers/ExportLogController.java|  10 +-
 .../controllers/FunctionCommandsController.java |  32 ++---
 .../controllers/IndexCommandsController.java|  36 ++---
 .../controllers/MemberCommandsController.java   |   6 +-
 .../MiscellaneousCommandsController.java|  36 +++--
 .../controllers/QueueCommandsController.java|   6 +-
 .../controllers/RegionCommandsController.java   |  20 ++-
 .../web/controllers/WanCommandsController.java  | 143 +++
 .../cli/commands/ConfigCommandsDUnitTest.java   |   4 +-
 ...eateAlterDestroyRegionCommandsDUnitTest.java |  26 ++--
 .../commands/DiskStoreCommandsDUnitTest.java|  16 +--
 .../commands/GemfireDataCommandsDUnitTest.java  |  60 
 .../cli/commands/IndexCommandsDUnitTest.java|  16 +--
 .../ListAndDescribeRegionDUnitTest.java |   8 +-
 .../cli/commands/MemberCommandsDUnitTest.java   |   2 +-
 .../MiscellaneousCommandsDUnitTest.java |  17 ++-
 .../cli/commands/QueueCommandsDUnitTest.java|   6 +-
 .../cli/commands/ShowMetricsDUnitTest.java  |   6 +-
 .../cli/commands/ShowStackTraceDUnitTest.java   |   8 +-
 .../cli/shell/GfshMultilineCommandTest.java |   7 +-
 .../ClusterConfigDistributionDUnitTest.java |   2 +-
 .../WanCommandsControllerJUnitTest.java |  14 +-
 .../LuceneClusterConfigurationDUnitTest.java|   4 +-
 ...mandCreateDestroyGatewaySenderDUnitTest.java |  56 
 ...anCommandCreateGatewayReceiverDUnitTest.java |  57 
 ...WanCommandGatewayReceiverStartDUnitTest.java |  39 +++--
 .../WanCommandGatewayReceiverStopDUnitTest.java |  39 +++--
 .../WanCommandGatewaySenderStartDUnitTest.java  |  40 +++---
 .../WanCommandGatewaySenderStopDUnitTest.java   |  34 ++---
 .../wan/wancommand/WanCommandListDUnitTest.java |  32 ++---
 .../WanCommandPauseResumeDUnitTest.java |  68 -
 .../wancommand/WanCommandStatusDUnitTest.java   |  56 
 .../ClusterConfigurationDUnitTest.java  |  10 +-
 ...nfigurationIndexWithFromClauseDUnitTest.java |   4 +-
 56 files changed, 630 insertions(+), 820 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
index 791f2ce..415ac3e 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/management/int

[24/24] geode git commit: Merge branch 'develop' into feature/GEODE-3071

2017-06-19 Thread jensdeppe
Merge branch 'develop' into feature/GEODE-3071


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

Branch: refs/heads/feature/GEODE-3071
Commit: dba7dcd3042ae7cf9776822bb4e69f47291fc296
Parents: 07e8986 78f08e8
Author: Jens Deppe 
Authored: Mon Jun 19 08:23:24 2017 -0700
Committer: Jens Deppe 
Committed: Mon Jun 19 08:23:24 2017 -0700

--
 .../cli/commands/StatusLocatorRealGfshTest.java |  50 +++
 ...erConfigurationServiceEndToEndDUnitTest.java |   8 +-
 .../geode/test/dunit/rules/gfsh/GfshRule.java   | 116 ++
 .../geode/test/dunit/rules/gfsh/GfshScript.java | 124 ++
 .../source/subnavs/geode-subnav.erb |   8 +-
 geode-core/build.gradle |   4 -
 .../internal/InternalDistributedSystem.java |  62 +--
 .../apache/geode/internal/cache/EventID.java|   2 +-
 .../geode/internal/cache/GemFireCacheImpl.java  |   2 -
 .../geode/internal/jta/GlobalTransaction.java   |   4 +
 .../geode/internal/jta/TransactionImpl.java |   3 +
 .../internal/jta/TransactionManagerImpl.java|  15 +
 .../geode/internal/jta/UserTransactionImpl.java |   4 +
 .../org/apache/geode/internal/jta/XidImpl.java  |   4 +
 .../internal/security/CallbackInstantiator.java |  28 ++
 .../security/CustomSecurityService.java | 346 
 .../security/DisabledSecurityService.java   | 221 ---
 .../security/EnabledSecurityService.java| 393 ---
 .../security/IntegratedSecurityService.java | 374 ++
 .../security/LegacySecurityService.java | 186 +
 .../internal/security/SecurityService.java  |  99 +++--
 .../security/SecurityServiceFactory.java| 188 +++--
 .../internal/security/SecurityServiceType.java  |  28 --
 .../security/shiro/ConfigInitializer.java   |  43 --
 .../security/shiro/CustomAuthRealm.java |  19 +-
 .../security/shiro/RealmInitializer.java|  54 ---
 .../security/shiro/SecurityManagerProvider.java |  83 
 .../internal/cli/commands/ConfigCommands.java   |  17 +-
 .../CreateAlterDestroyRegionCommands.java   |  24 +-
 .../internal/cli/commands/DataCommands.java |   4 +-
 .../internal/cli/commands/DeployCommands.java   |  57 +--
 .../cli/commands/DiskStoreCommands.java |  12 +-
 .../cli/commands/DurableClientCommands.java |  22 +-
 .../cli/commands/ExportLogsCommand.java |   4 +-
 .../internal/cli/commands/FunctionCommands.java |  20 +-
 .../internal/cli/commands/IndexCommands.java|  14 +-
 .../cli/commands/LauncherLifecycleCommands.java |   4 +-
 .../internal/cli/commands/MemberCommands.java   |   4 +-
 .../cli/commands/MiscellaneousCommands.java |  34 +-
 .../internal/cli/commands/QueueCommands.java|   2 +-
 .../internal/cli/commands/RegionCommands.java   |   6 +-
 .../internal/cli/commands/WanCommands.java  | 116 +++---
 .../internal/cli/functions/DeployFunction.java  |   3 -
 .../cli/functions/UndeployFunction.java |   9 +-
 .../internal/cli/i18n/CliStrings.java   |  99 +
 .../controllers/ConfigCommandsController.java   |  24 +-
 .../web/controllers/DataCommandsController.java |   4 +-
 .../controllers/DeployCommandsController.java   |  26 +-
 .../DiskStoreCommandsController.java|  22 +-
 .../DurableClientCommandsController.java|  50 +--
 .../web/controllers/ExportLogController.java|  10 +-
 .../controllers/FunctionCommandsController.java |  32 +-
 .../controllers/IndexCommandsController.java|  36 +-
 .../controllers/MemberCommandsController.java   |   6 +-
 .../MiscellaneousCommandsController.java|  36 +-
 .../controllers/QueueCommandsController.java|   6 +-
 .../controllers/RegionCommandsController.java   |  20 +-
 .../web/controllers/WanCommandsController.java  | 143 +++
 .../internal/index/HashIndexSetJUnitTest.java   |   2 +-
 .../membership/MembershipJUnitTest.java |   3 -
 .../messenger/JGroupsMessengerJUnitTest.java|   6 +-
 .../gms/mgr/GMSMembershipManagerJUnitTest.java  |   8 +-
 .../DeposePrimaryBucketMessageTest.java |   1 -
 .../partitioned/FetchEntryMessageTest.java  |   1 -
 .../FetchPartitionDetailsMessageTest.java   |   1 -
 .../partitioned/MoveBucketMessageTest.java  |   1 -
 .../partitioned/RemoveBucketMessageTest.java|   1 -
 .../sockets/ClientServerMiscBCDUnitTest.java|  42 ++
 .../tier/sockets/ClientServerMiscDUnitTest.java |   4 +-
 .../tier/sockets/command/ContainsKey66Test.java |   2 +-
 .../tier/sockets/command/CreateRegionTest.java  |   2 +-
 .../tier/sockets/command/Destroy65Test.java |   2 +-
 .../tier/sockets/command/DestroyRegionTest.java |   2 +-
 .../cache/tier/sockets/command/DestroyTest.java |   2 +-
 ..

[12/24] geode git commit: GEODE-2626: fix FastLoggerJUnitTest use of Mockito 2.7.11

2017-06-19 Thread jensdeppe
GEODE-2626: fix FastLoggerJUnitTest use of Mockito 2.7.11


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

Branch: refs/heads/feature/GEODE-3071
Commit: e3a1ae07c4837a5df5b1874490b9ec96f4c16ac8
Parents: c41d788
Author: Kirk Lund 
Authored: Tue Jun 13 11:00:07 2017 -0700
Committer: Kirk Lund 
Committed: Wed Jun 14 11:06:33 2017 -0700

--
 .../apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/e3a1ae07/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java
index e162087..891ac3c 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java
@@ -16,7 +16,6 @@ package org.apache.geode.internal.logging.log4j;
 
 import static org.hamcrest.CoreMatchers.*;
 import static org.junit.Assert.*;
-import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.*;
 
 import org.apache.logging.log4j.Level;
@@ -97,7 +96,7 @@ public class FastLoggerJUnitTest {
 
 assertThat(fastLogger.isDebugEnabled(), is(true));
 assertThat(fastLogger.isDebugEnabled(this.mockedMarker), is(true));
-verify(this.mockedLogger, times(1)).isEnabled(eq(Level.DEBUG), 
any(Marker.class),
+verify(this.mockedLogger, times(1)).isEnabled(eq(Level.DEBUG), 
isNull(Marker.class),
 isNull(String.class));
 verify(this.mockedLogger, times(1)).isEnabled(eq(Level.DEBUG), 
eq(this.mockedMarker),
 isNull(Object.class), isNull(Throwable.class));



[15/24] geode git commit: Revert "GEODE-3062: create new SecurityService after receiving cluster config"

2017-06-19 Thread jensdeppe
Revert "GEODE-3062: create new SecurityService after receiving cluster config"

This reverts commit cecad6c37d59369a29237f7d940f297804633aa1.


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

Branch: refs/heads/feature/GEODE-3071
Commit: a79d2cc1621bd8c36531519df5e1edbb0faabf96
Parents: 7bc3111
Author: Kirk Lund 
Authored: Wed Jun 14 15:41:49 2017 -0700
Committer: Kirk Lund 
Committed: Wed Jun 14 15:41:49 2017 -0700

--
 .../internal/InternalDistributedSystem.java |  4 ---
 .../cache/ClusterConfigurationLoader.java   |  7 ++--
 .../geode/internal/cache/GemFireCacheImpl.java  | 35 +++-
 .../ClusterConfigWithSecurityDUnitTest.java | 31 -
 4 files changed, 22 insertions(+), 55 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/a79d2cc1/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index f406393..22edb6f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -516,10 +516,6 @@ public class InternalDistributedSystem extends 
DistributedSystem
 return this.securityService;
   }
 
-  public void setSecurityService(SecurityService securityService) {
-this.securityService = securityService;
-  }
-
   /**
* Registers a listener to the system
* 

http://git-wip-us.apache.org/repos/asf/geode/blob/a79d2cc1/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
index 92cfd96..4f4881f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java
@@ -152,12 +152,13 @@ public class ClusterConfigurationLoader {
 
   /***
* Apply the gemfire properties cluster configuration on this member
-   * 
+   *
+   * @param cache Cache created for this member
* @param response {@link ConfigurationResponse} containing the requested 
{@link Configuration}
* @param config this member's config
*/
-  public static void applyClusterPropertiesConfiguration(ConfigurationResponse 
response,
-  DistributionConfig config) {
+  public static void applyClusterPropertiesConfiguration(Cache cache,
+  ConfigurationResponse response, DistributionConfig config) {
 if (response == null || response.getRequestedConfiguration().isEmpty()) {
   return;
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/a79d2cc1/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index c503c40..40df0c7 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -77,7 +77,6 @@ import javax.transaction.TransactionManager;
 import com.sun.jna.Native;
 import com.sun.jna.Platform;
 import org.apache.commons.lang.StringUtils;
-import org.apache.geode.internal.security.SecurityServiceFactory;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelCriterion;
@@ -127,6 +126,7 @@ import org.apache.geode.cache.client.PoolFactory;
 import org.apache.geode.cache.client.PoolManager;
 import org.apache.geode.cache.client.internal.ClientMetadataService;
 import org.apache.geode.cache.client.internal.ClientRegionFactoryImpl;
+import org.apache.geode.cache.client.internal.ConnectionImpl;
 import org.apache.geode.cache.client.internal.InternalClientCache;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.control.ResourceManager;
@@ -213,6 +213,7 @@ import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.offheap.MemoryAllocator;
 import 
org.apache.geode.internal.p

[14/24] geode git commit: GEODE-3070: Fix gemfire.jar to be geode-dependencies.jar

2017-06-19 Thread jensdeppe
GEODE-3070: Fix gemfire.jar to be geode-dependencies.jar

Updated a few other errors found along the way, including
the name of the RAR file for JTA transactions, and outdated
output of sample gfsh commands in the gfsh tutorial.  Also
added a final step that shuts down the cluster in the tutorial.

This closes #579


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

Branch: refs/heads/feature/GEODE-3071
Commit: 7bc31116bdefcab96f68bdb37699b32d8c2dc10c
Parents: d9869ff
Author: Karen Miller 
Authored: Tue Jun 13 15:55:56 2017 -0700
Committer: Karen Miller 
Committed: Wed Jun 14 13:38:27 2017 -0700

--
 .../transactions/JTA_transactions.html.md.erb   | 21 +++--
 .../tools_modules/gfsh/tour_of_gfsh.html.md.erb | 86 +---
 2 files changed, 68 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/7bc31116/geode-docs/developing/transactions/JTA_transactions.html.md.erb
--
diff --git a/geode-docs/developing/transactions/JTA_transactions.html.md.erb 
b/geode-docs/developing/transactions/JTA_transactions.html.md.erb
index e218684..3164dce 100644
--- a/geode-docs/developing/transactions/JTA_transactions.html.md.erb
+++ b/geode-docs/developing/transactions/JTA_transactions.html.md.erb
@@ -122,8 +122,9 @@ To accomplish this, the application server container must 
use a JCA Resource Ada
 
 # How to Run JTA Transactions with Geode as a "Last Resource"
 
-1.  Locate the `$GEMFIRE/lib/gemfire-jca.rar` file in your Geode installation. 
-2.  Add your container-specific XML file to the `gemfire-jca.rar` file. 
+1.  Locate the version-specific `geode-jca` RAR file within 
+the `lib` directory of your Geode installation. 
+2.  Add your container-specific XML file to the `geode-jca` RAR file. 
 
 Create a container-specific resource adapter XML file named 
-ra.xml. For example, an XML file for a WebLogic resource 
adapter XML file might look something like this:
 
@@ -144,17 +145,21 @@ To accomplish this, the application server container must 
use a JCA Resource Ada
 META-INF/weblogic-ra.xml
 ```
 
-Navigate to the directory above the `META-INF` folder and execute the 
following command:
+Navigate to the directory above the `META-INF` folder and execute the 
following command, with appropriate substitutions for 
+path and file names:
 
 ``` pre
-$ jar -uf /lib/gemfire-jca.rar 
META-INF/weblogic-ra.xml
+$ jar -uf /path/to/lib/geode-jca-X-X-X.rar META-INF/weblogic-ra.xml
 ```
 
 
-3.  Make sure that `$GEMFIRE/lib/gemfire.jar` is accessible in the CLASSPATH 
of the JTA transaction coordinator container.
-4.  Deploy `gemfire-jca.rar` file on the JTA transaction coordinator container 
. When deploying the file, you specify the JNDI name and so on. 
+3.  Make sure that the `geode-dependencies.jar` is accessible in 
+the CLASSPATH of the JTA transaction coordinator container.
+4.  Deploy the version-specific `geode-jca` RAR file on 
+the JTA transaction coordinator container.
+When deploying the file, you specify the JNDI name and so on. 
 5.  Configure Geode for any necessary transactional behavior. Enable 
`copy-on-read` and specify a transaction listener, if you need one. See 
[Setting Global Copy on 
Read](working_with_transactions.html#concept_vx2_gs4_5k) and [Configuring 
Transaction Plug-In Event 
Handlers](working_with_transactions.html#concept_ocw_vf1_wk) for details.
-6.  Get an initial context through `com.gemstone.cache.Cache.getJNDIContext`. 
For example:
+6.  Get an initial context through 
`org.apache.geode.cache.GemFireCache.getJNDIContext`. For example:
 
 ``` pre
 Context ctx = cache.getJNDIContext();
@@ -215,7 +220,7 @@ To run a global transaction, perform the following steps:
 3.  Configure Geode for any necessary transactional behavior. Enable 
`copy-on-read` for your cache and specify a transaction listener, if you need 
one. See [Setting Global Copy on 
Read](working_with_transactions.html#concept_vx2_gs4_5k) and [Configuring 
Transaction Plug-In Event 
Handlers](working_with_transactions.html#concept_ocw_vf1_wk) for details. 
 4.  Make sure that JTA transactions are not disabled in the `cache.xml` file 
or the application code. 
 5.  Initialize the Geode cache. 
-6.  Get an initial context through 
`org.apache.geode.cache.Cache.getJNDIContext`. For example: 
+6.  Get an initial context through 
`org.apache.geode.cache.GemFireCache.getJNDIContext`. For example: 
 
 ``` pre
 Context ctx = cache.getJNDIContext();

http://git-wip-us.apache.org/repos/asf/geode/blob/7bc31116/geode-docs/tools_modules/gfsh/tour_of_gfsh

[10/24] geode git commit: GEODE-2558: Upgrade Powermock version to fix failing tests

2017-06-19 Thread jensdeppe
GEODE-2558: Upgrade Powermock version to fix failing tests


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

Branch: refs/heads/feature/GEODE-3071
Commit: b616e80d1f9583eead82917f95ba5d9da4eb4f05
Parents: 0d43e3d
Author: Jared Stewart 
Authored: Wed Jun 14 10:14:55 2017 -0700
Committer: Kirk Lund 
Committed: Wed Jun 14 11:06:33 2017 -0700

--
 .../cache/tier/sockets/command/Put61Test.java   | 28 -
 .../cache/tier/sockets/command/Put65Test.java   | 26 
 .../cache/tier/sockets/command/PutTest.java | 32 +---
 .../internal/statistics/StatisticsImplTest.java |  6 ++--
 gradle/dependency-versions.properties   |  4 +--
 5 files changed, 46 insertions(+), 50 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/b616e80d/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java
index fb3a9dd..bd99e6c 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java
@@ -14,29 +14,22 @@
  */
 package org.apache.geode.internal.cache.tier.sockets.command;
 
-import static org.assertj.core.api.Assertions.*;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.mockito.ArgumentCaptor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import org.apache.geode.CancelCriterion;
 import org.apache.geode.cache.operations.PutOperationContext;
 import org.apache.geode.internal.Version;
-import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.tier.CachedRegionHelper;
 import org.apache.geode.internal.cache.tier.sockets.CacheServerStats;
-import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.cache.tier.sockets.Message;
 import org.apache.geode.internal.cache.tier.sockets.Part;
 import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
@@ -44,6 +37,13 @@ import org.apache.geode.internal.security.AuthorizeRequest;
 import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.security.NotAuthorizedException;
 import org.apache.geode.test.junit.categories.UnitTest;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.ArgumentCaptor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
 
 @Category(UnitTest.class)
 public class Put61Test {
@@ -107,7 +107,7 @@ public class Put61Test {
 
 when(this.deltaPart.getObject()).thenReturn(true);
 
-when(this.eventPart.getSerializedForm()).thenReturn(this.EVENT);
+when(this.eventPart.getSerializedForm()).thenReturn(EVENT);
 
 when(this.valuePart.getSerializedForm()).thenReturn(VALUE);
 when(this.valuePart.isObject()).thenReturn(true);
@@ -132,7 +132,7 @@ public class Put61Test {
 when(this.serverConnection.getClientVersion()).thenReturn(Version.CURRENT);
 
 when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), eq(VALUE), 
eq(true), eq(CALLBACK_ARG),
-any(ClientProxyMembershipID.class), eq(true), 
any(EntryEventImpl.class))).thenReturn(true);
+any(), eq(true), any())).thenReturn(true);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/geode/blob/b616e80d/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java
index 81f17cb..8d52b88 1006

[02/24] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.

2017-06-19 Thread jensdeppe
http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
index 63cf594..bdccabe 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
@@ -51,14 +51,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest 
extends WANCommandTestBase
   public void testCreateGatewayReceiverWithDefault() {
 
 VM puneLocator = Host.getLocator();
-int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort());
+int punePort = puneLocator.invoke(() -> getLocatorPort());
 
 Properties props = getDistributedSystemProperties();
 props.setProperty(MCAST_PORT, "0");
 props.setProperty(LOCATORS, "localhost[" + punePort + "]");
 setUpJmxManagerOnVm0ThenConnect(props);
 
-Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, 
punePort));
+Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort));
 
 vm3.invoke(() -> createCache(punePort));
 vm4.invoke(() -> createCache(punePort));
@@ -104,14 +104,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest 
extends WANCommandTestBase
   public void testCreateGatewayReceiver() {
 
 VM puneLocator = Host.getLocator();
-int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort());
+int punePort = puneLocator.invoke(() -> getLocatorPort());
 
 Properties props = getDistributedSystemProperties();
 props.setProperty(MCAST_PORT, "0");
 props.setProperty(LOCATORS, "localhost[" + punePort + "]");
 setUpJmxManagerOnVm0ThenConnect(props);
 
-Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, 
punePort));
+Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort));
 
 vm3.invoke(() -> createCache(punePort));
 vm4.invoke(() -> createCache(punePort));
@@ -157,14 +157,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest 
extends WANCommandTestBase
   public void testCreateGatewayReceiverWithGatewayTransportFilter() {
 
 VM puneLocator = Host.getLocator();
-int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort());
+int punePort = puneLocator.invoke(() -> getLocatorPort());
 
 Properties props = getDistributedSystemProperties();
 props.setProperty(MCAST_PORT, "0");
 props.setProperty(LOCATORS, "localhost[" + punePort + "]");
 setUpJmxManagerOnVm0ThenConnect(props);
 
-Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, 
punePort));
+Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort));
 
 vm3.invoke(() -> createCache(punePort));
 vm4.invoke(() -> createCache(punePort));
@@ -215,14 +215,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest 
extends WANCommandTestBase
   public void testCreateGatewayReceiverWithMultipleGatewayTransportFilters() {
 
 VM puneLocator = Host.getLocator();
-int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort());
+int punePort = puneLocator.invoke(() -> getLocatorPort());
 
 Properties props = getDistributedSystemProperties();
 props.setProperty(MCAST_PORT, "0");
 props.setProperty(LOCATORS, "localhost[" + punePort + "]");
 setUpJmxManagerOnVm0ThenConnect(props);
 
-Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, 
punePort));
+Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort));
 
 vm3.invoke(() -> createCache(punePort));
 vm4.invoke(() -> createCache(punePort));
@@ -273,14 +273,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest 
extends WANCommandTestBase
   public void testCreateGatewayReceiver_Error() {
 
 VM puneLocator = Host.getLocator();
-int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort());
+int punePort = puneLocator.invoke(() -> getLocatorPort());
 
 Properties props = getDistributedSystemProperties();
 props.setProperty(MCAST_PORT, "0");
 props.setProperty(LOCATORS, "localhost[" + punePort + "]");
 setUpJmxManagerOnVm0ThenConnect(props);
 
-Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, 
punePort));
+Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort));
 
 vm3.invoke(() -> createCache(punePort));
 vm4.invoke(() -> createCache(punePort));
@@ -319,20 +319,20 @@ public class WanCommandCreateGatewayReceiverDUnitTest 
extends WANCommandTestBase
   public vo

[13/24] geode git commit: GEODE-3060: Introduce JUnit rule for testing the fully-assembled GFSH

2017-06-19 Thread jensdeppe
GEODE-3060: Introduce JUnit rule for testing the fully-assembled GFSH


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

Branch: refs/heads/feature/GEODE-3071
Commit: d9869ffd5b317c9e577f3ee2107a8d4bf46a166d
Parents: b616e80
Author: Jared Stewart 
Authored: Wed Jun 7 20:44:56 2017 -0700
Committer: Jared Stewart 
Committed: Wed Jun 14 11:18:36 2017 -0700

--
 .../cli/commands/StatusLocatorRealGfshTest.java |  50 
 .../geode/test/dunit/rules/gfsh/GfshRule.java   | 116 +
 .../geode/test/dunit/rules/gfsh/GfshScript.java | 124 +++
 3 files changed, 290 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/d9869ffd/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java
new file mode 100644
index 000..82ee240
--- /dev/null
+++ 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java
@@ -0,0 +1,50 @@
+/*
+ * 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.commands;
+
+import org.apache.geode.test.dunit.rules.gfsh.GfshRule;
+import org.apache.geode.test.dunit.rules.gfsh.GfshScript;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+@Category(DistributedTest.class)
+public class StatusLocatorRealGfshTest {
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+
+  @Test
+  public void statusLocatorSucceedsWhenConnected() throws Exception {
+gfshRule.execute(GfshScript.of("start locator 
--name=locator1").awaitAtMost(1, TimeUnit.MINUTES)
+.expectExitCode(0));
+
+gfshRule.execute(GfshScript.of("connect", "status locator --name=locator1")
+.awaitAtMost(1, TimeUnit.MINUTES).expectExitCode(0));
+  }
+
+  @Test
+  public void statusLocatorFailsWhenNotConnected() throws Exception {
+gfshRule.execute(GfshScript.of("start locator 
--name=locator1").awaitAtMost(1, TimeUnit.MINUTES)
+.expectExitCode(0));
+
+gfshRule.execute(GfshScript.of("status locator --name=locator1")
+.awaitAtMost(1, TimeUnit.MINUTES).expectExitCode(1));
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/d9869ffd/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java
--
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java
 
b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java
new file mode 100644
index 000..8109377
--- /dev/null
+++ 
b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java
@@ -0,0 +1,116 @@
+/*
+ * 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, ei

[03/24] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.

2017-06-19 Thread jensdeppe
http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java
index 4fd4b96..6a01c3e 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java
@@ -46,19 +46,16 @@ public class WanCommandsController extends 
AbstractCommandsController {
   @RequestMapping(method = RequestMethod.GET, value = "/gateways")
   @ResponseBody
   public String listGateways(
-  @RequestParam(value = CliStrings.LIST_GATEWAY__GROUP, required = false) 
final String[] groups,
-  @RequestParam(value = CliStrings.LIST_GATEWAY__MEMBER,
-  required = false) final String[] members) {
+  @RequestParam(value = CliStrings.GROUP, required = false) final String[] 
groups,
+  @RequestParam(value = CliStrings.MEMBER, required = false) final 
String[] members) {
 CommandStringBuilder command = new 
CommandStringBuilder(CliStrings.LIST_GATEWAY);
 
 if (hasValue(groups)) {
-  command.addOption(CliStrings.LIST_GATEWAY__GROUP,
-  StringUtils.join(groups, StringUtils.COMMA_DELIMITER));
+  command.addOption(CliStrings.GROUP, StringUtils.join(groups, 
StringUtils.COMMA_DELIMITER));
 }
 
 if (hasValue(members)) {
-  command.addOption(CliStrings.LIST_GATEWAY__MEMBER,
-  StringUtils.join(members, StringUtils.COMMA_DELIMITER));
+  command.addOption(CliStrings.MEMBER, StringUtils.join(members, 
StringUtils.COMMA_DELIMITER));
 }
 
 return processCommand(command.toString());
@@ -67,12 +64,10 @@ public class WanCommandsController extends 
AbstractCommandsController {
   @RequestMapping(method = RequestMethod.POST, value = "/gateways/receivers")
   @ResponseBody
   public String createGatewayReceiver(
-  @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__GROUP,
-  required = false) final String[] groups,
+  @RequestParam(value = CliStrings.GROUP, required = false) final String[] 
groups,
   @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART,
   required = false) final Boolean manualStart,
-  @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__MEMBER,
-  required = false) final String[] members,
+  @RequestParam(value = CliStrings.MEMBER, required = false) final 
String[] members,
   @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT,
   required = false) final Integer startPort,
   @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT,
@@ -88,8 +83,7 @@ public class WanCommandsController extends 
AbstractCommandsController {
 CommandStringBuilder command = new 
CommandStringBuilder(CliStrings.CREATE_GATEWAYRECEIVER);
 
 if (hasValue(groups)) {
-  command.addOption(CliStrings.CREATE_GATEWAYRECEIVER__GROUP,
-  StringUtils.join(groups, StringUtils.COMMA_DELIMITER));
+  command.addOption(CliStrings.GROUP, StringUtils.join(groups, 
StringUtils.COMMA_DELIMITER));
 }
 
 if (hasValue(manualStart)) {
@@ -98,8 +92,7 @@ public class WanCommandsController extends 
AbstractCommandsController {
 }
 
 if (hasValue(members)) {
-  command.addOption(CliStrings.CREATE_GATEWAYRECEIVER__MEMBER,
-  StringUtils.join(members, StringUtils.COMMA_DELIMITER));
+  command.addOption(CliStrings.MEMBER, StringUtils.join(members, 
StringUtils.COMMA_DELIMITER));
 }
 
 if (hasValue(startPort)) {
@@ -137,10 +130,8 @@ public class WanCommandsController extends 
AbstractCommandsController {
   public String createGatewaySender(
   @RequestParam(CliStrings.CREATE_GATEWAYSENDER__ID) final String 
gatewaySenderId,
   
@RequestParam(CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID) final 
Integer remoteDistributedSystemId,
-  @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__GROUP,
-  required = false) final String[] groups,
-  @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__MEMBER,
-  required = false) final String[] members,
+  @RequestParam(value = CliStrings.GROUP, required = false) final String[] 
groups,
+  @RequestParam(value = CliStrings.MEMBER, required = false) final 
String[] members,
   @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__PARALLEL,
   required = false) final Boolean parallel,
   @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__MANUALSTART,
@@ -180,13 +171,11 @@ public class WanCommandsController extends 
AbstractCommandsController {
 String.valueOf(remoteDistributedS

[07/24] geode git commit: GEODE-2628: fix StatisticsImplTest use of Mockito 2.7.11

2017-06-19 Thread jensdeppe
GEODE-2628: fix StatisticsImplTest use of Mockito 2.7.11


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

Branch: refs/heads/feature/GEODE-3071
Commit: c41d788b0a27993cb609c27b42bfd33303a1e7e3
Parents: 740a4ef
Author: Kirk Lund 
Authored: Tue Jun 13 10:57:54 2017 -0700
Committer: Kirk Lund 
Committed: Wed Jun 14 11:06:32 2017 -0700

--
 .../internal/statistics/StatisticsImplTest.java | 63 
 1 file changed, 37 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/c41d788b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java
index ea8d285..2747252 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java
@@ -22,6 +22,7 @@ import java.util.function.IntSupplier;
 import java.util.function.LongSupplier;
 
 import org.apache.logging.log4j.Logger;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -35,27 +36,38 @@ import org.apache.geode.test.junit.categories.UnitTest;
  */
 @Category(UnitTest.class)
 public class StatisticsImplTest {
-  @Rule
-  public ExpectedException thrown = ExpectedException.none();
 
+  private Logger originalLogger;
   private StatisticsImpl stats;
 
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
   @Before
   public void createStats() {
-final StatisticsTypeImpl type = mock(StatisticsTypeImpl.class);
+originalLogger = StatisticsImpl.logger;
+
+StatisticsTypeImpl type = mock(StatisticsTypeImpl.class);
 when(type.getIntStatCount()).thenReturn(5);
 when(type.getDoubleStatCount()).thenReturn(5);
 when(type.getLongStatCount()).thenReturn(5);
-final String textId = "";
-final long numbericId = 0;
-final long uniqueId = 0;
-final int osStatFlags = 0;
-final boolean atomicIncrements = false;
-final StatisticsManager system = mock(StatisticsManager.class);
+
+String textId = "";
+long numbericId = 0;
+long uniqueId = 0;
+int osStatFlags = 0;
+boolean atomicIncrements = false;
+StatisticsManager system = mock(StatisticsManager.class);
+
 stats = new LocalStatisticsImpl(type, textId, numbericId, uniqueId, 
atomicIncrements,
 osStatFlags, system);
   }
 
+  @After
+  public void tearDown() {
+StatisticsImpl.logger = originalLogger;
+  }
+
   @Test
   public void invokeIntSuppliersShouldUpdateStats() {
 IntSupplier supplier1 = mock(IntSupplier.class);
@@ -108,23 +120,22 @@ public class StatisticsImplTest {
 
   @Test
   public void invokeSuppliersShouldLogErrorOnlyOnce() {
-final Logger originalLogger = StatisticsImpl.logger;
-try {
-  final Logger logger = mock(Logger.class);
-  StatisticsImpl.logger = logger;
-  IntSupplier supplier1 = mock(IntSupplier.class);
-  when(supplier1.getAsInt()).thenThrow(NullPointerException.class);
-  stats.setIntSupplier(4, supplier1);
-  assertEquals(1, stats.invokeSuppliers());
-  verify(logger, times(1)).warn(anyString(), anyString(), anyInt(),
-  isA(NullPointerException.class));
-  assertEquals(1, stats.invokeSuppliers());
-  // Make sure the logger isn't invoked again
-  verify(logger, times(1)).warn(anyString(), anyString(), anyInt(),
-  isA(NullPointerException.class));
-} finally {
-  StatisticsImpl.logger = originalLogger;
-}
+Logger logger = mock(Logger.class);
+StatisticsImpl.logger = logger;
+IntSupplier supplier1 = mock(IntSupplier.class);
+when(supplier1.getAsInt()).thenThrow(NullPointerException.class);
+stats.setIntSupplier(4, supplier1);
+assertEquals(1, stats.invokeSuppliers());
+
+// String message, Object p0, Object p1, Object p2
+verify(logger, times(1)).warn(anyString(), isNull(), anyInt(),
+isA(NullPointerException.class));
+
+assertEquals(1, stats.invokeSuppliers());
+
+// Make sure the logger isn't invoked again
+verify(logger, times(1)).warn(anyString(), isNull(), anyInt(),
+isA(NullPointerException.class));
   }
 
   @Test



[16/24] geode git commit: GEODE-2301: Deprecate JTA transaction manager from Geode

2017-06-19 Thread jensdeppe
GEODE-2301: Deprecate JTA transaction manager from Geode

Geode JTA transaction manager is deprecated and a warning message is logged if 
it is being used.


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

Branch: refs/heads/feature/GEODE-3071
Commit: a21c97111a288ac0a0986bb30545f1aacbec5880
Parents: a79d2cc
Author: eshu 
Authored: Thu Jun 15 08:42:49 2017 -0700
Committer: eshu 
Committed: Thu Jun 15 08:44:36 2017 -0700

--
 .../apache/geode/internal/jta/GlobalTransaction.java |  4 
 .../apache/geode/internal/jta/TransactionImpl.java   |  3 +++
 .../geode/internal/jta/TransactionManagerImpl.java   | 15 +++
 .../geode/internal/jta/UserTransactionImpl.java  |  4 
 .../java/org/apache/geode/internal/jta/XidImpl.java  |  4 
 5 files changed, 30 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java 
b/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
index 03eeb20..d6f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java
@@ -21,6 +21,9 @@ package org.apache.geode.internal.jta;
  * 
  * 
  * @since GemFire 4.0
+ * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction 
manager to manage JTA
+ * transactions.
  */
 import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -32,6 +35,7 @@ import 
org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 
+@Deprecated
 public class GlobalTransaction {
 
   public static boolean DISABLE_TRANSACTION_TIMEOUT_SETTING = false;

http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
index a5e80b6..3279abe 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionImpl.java
@@ -17,6 +17,8 @@ package org.apache.geode.internal.jta;
 /**
  * TransactionImpl implements the JTA Transaction interface.
  * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction 
manager to manage JTA
+ * transactions.
  */
 import javax.transaction.xa.*;
 import javax.transaction.*;
@@ -26,6 +28,7 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
 
 import java.util.*;
 
+@Deprecated
 public class TransactionImpl implements Transaction {
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/a21c9711/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
index 15ab1f8..b7a60b8 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/jta/TransactionManagerImpl.java
@@ -20,6 +20,8 @@ package org.apache.geode.internal.jta;
  * 
  * 
  * @since GemFire 4.1.1
+ * 
+ * @deprecated as of Geode 1.2.0 user should use a third party JTA transaction 
manager instead.
  */
 import java.io.Serializable;
 import java.util.Collections;
@@ -31,6 +33,7 @@ import java.util.Map;
 import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.transaction.HeuristicMixedException;
 import javax.transaction.HeuristicRollbackException;
@@ -42,14 +45,19 @@ import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.CancelException;
 import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apac

[01/24] geode git commit: GEODE-2818: add aliases to the undeploy command

2017-06-19 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3071 07e8986e3 -> dba7dcd30


GEODE-2818: add aliases to the undeploy command

* this closes #560


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

Branch: refs/heads/feature/GEODE-3071
Commit: a6433273251528d2cda3b5f1e6dc4dad4360275f
Parents: db8e1df
Author: Jinmei Liao 
Authored: Wed Jun 7 16:10:56 2017 -0700
Committer: Jinmei Liao 
Committed: Wed Jun 14 08:59:51 2017 -0700

--
 .../internal/cli/commands/ConfigCommands.java   |  7 +--
 .../internal/cli/commands/DeployCommands.java   | 50 +++-
 .../internal/cli/functions/DeployFunction.java  |  3 --
 .../cli/functions/UndeployFunction.java |  9 ++--
 .../cli/GfshParserAutoCompletionTest.java   |  6 +--
 .../cli/commands/DeployCommandsDUnitTest.java   | 36 +-
 6 files changed, 74 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/a6433273/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
index 19c72c3..a8afa7d 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java
@@ -81,9 +81,10 @@ public class ConfigCommands implements GfshCommand {
   @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result describeConfig(
   @CliOption(key = CliStrings.MEMBER, optionContext = 
ConverterHint.ALL_MEMBER_IDNAME,
-  help = CliStrings.DESCRIBE_CONFIG__MEMBER__HELP, mandatory = true)
-
-  String memberNameOrId, @CliOption(key = 
CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS, help = 
CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS__HELP, unspecifiedDefaultValue = 
"true", specifiedDefaultValue = "true") boolean hideDefaults) {
+  help = CliStrings.DESCRIBE_CONFIG__MEMBER__HELP, mandatory = true) 
String memberNameOrId,
+  @CliOption(key = CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS,
+  help = CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS__HELP, 
unspecifiedDefaultValue = "true",
+  specifiedDefaultValue = "true") boolean hideDefaults) {
 
 Result result = null;
 try {

http://git-wip-us.apache.org/repos/asf/geode/blob/a6433273/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
index 43a748e..9b79e1d 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java
@@ -15,6 +15,8 @@
 package org.apache.geode.management.internal.cli.commands;
 
 import static org.apache.commons.io.FileUtils.ONE_MB;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
 
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.execute.ResultCollector;
@@ -66,7 +68,7 @@ public class DeployCommands implements GfshCommand {
* Deploy one or more JAR files to members of a group or all members.
* 
* @param groups Group(s) to deploy the JAR to or null for all members
-   * @param jar JAR file to deploy
+   * @param jars JAR file to deploy
* @param dir Directory of JAR files to deploy
* @return The result of the attempt to deploy
*/
@@ -77,7 +79,8 @@ public class DeployCommands implements GfshCommand {
   public Result deploy(
   @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, help = 
CliStrings.DEPLOY__GROUP__HELP,
   optionContext = ConverterHint.MEMBERGROUP) String[] groups,
-  @CliOption(key = {CliStrings.JAR}, help = CliStrings.DEPLOY__JAR__HELP) 
String jar,
+  @CliOption(key = {CliStrings.JAR, CliStrings.JARS},
+  help = CliStrings.DEPLOY__JAR__HELP) String[] jars,
   @CliOption(key = {CliStrings.DEPLOY__DIR}, help = 
CliStrings.DEPLOY__DIR__HELP) String dir) {
 try {
 
@@ -157,8 +160,8 @@ public class DeployCommands implements GfshCommand {
   @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}

[21/24] geode git commit: GEODE-3072: Ignore dunit test

2017-06-19 Thread jensdeppe
GEODE-3072: Ignore dunit test


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

Branch: refs/heads/feature/GEODE-3071
Commit: 4bf80a6a9236f98070ce63a1d77dce3732c35b4f
Parents: 42350f1
Author: Barry Oglesby 
Authored: Fri Jun 16 14:10:27 2017 -0700
Committer: Barry Oglesby 
Committed: Fri Jun 16 14:10:27 2017 -0700

--
 .../internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/4bf80a6a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
index c732662..fa68781 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
@@ -31,6 +31,7 @@ import 
org.apache.geode.test.junit.categories.ClientServerTest;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import 
org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
 import org.awaitility.Awaitility;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
@@ -95,7 +96,8 @@ public class ClientServerMiscBCDUnitTest extends 
ClientServerMiscDUnitTest {
 });
   }
 
-  @Test
+  //@Test
+  @Ignore
   public void testDistributedMemberBytesWithCurrentServerAndOldClient() throws 
Exception {
 // Start current version server
 int serverPort = initServerCache(true);



[17/24] geode git commit: GEODE-3072: Changed getMembershipId to use the client version

2017-06-19 Thread jensdeppe
GEODE-3072: Changed getMembershipId to use the client version


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

Branch: refs/heads/feature/GEODE-3071
Commit: dd90c71d036d9d28b8c593ab8cbae57357a64b03
Parents: a21c971
Author: Barry Oglesby 
Authored: Tue Jun 13 18:18:19 2017 -0700
Committer: Barry Oglesby 
Committed: Thu Jun 15 09:19:36 2017 -0700

--
 .../apache/geode/internal/cache/EventID.java|  2 +-
 .../sockets/ClientServerMiscBCDUnitTest.java| 40 
 .../tier/sockets/ClientServerMiscDUnitTest.java |  4 +-
 3 files changed, 43 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/dd90c71d/geode-core/src/main/java/org/apache/geode/internal/cache/EventID.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/EventID.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/EventID.java
index 71acdc9..4d2ddc1 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/EventID.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/EventID.java
@@ -164,7 +164,7 @@ public class EventID implements DataSerializableFixedID, 
Serializable, Externali
*/
   public static byte[] getMembershipId(ClientProxyMembershipID client) {
 try {
-  HeapDataOutputStream hdos = new HeapDataOutputStream(256, 
Version.CURRENT);
+  HeapDataOutputStream hdos = new HeapDataOutputStream(256, 
client.getClientVersion());
   ((InternalDistributedMember) 
client.getDistributedMember()).writeEssentialData(hdos);
   return hdos.toByteArray();
 } catch (IOException ioe) {

http://git-wip-us.apache.org/repos/asf/geode/blob/dd90c71d/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
index d51c196..c732662 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
@@ -14,10 +14,13 @@
  */
 package org.apache.geode.internal.cache.tier.sockets;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.client.Pool;
+import org.apache.geode.internal.cache.EventID;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.NetworkUtils;
@@ -33,8 +36,10 @@ import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 @Category({DistributedTest.class, ClientServerTest.class, 
BackwardCompatibilityTest.class})
@@ -90,4 +95,39 @@ public class ClientServerMiscBCDUnitTest extends 
ClientServerMiscDUnitTest {
 });
   }
 
+  @Test
+  public void testDistributedMemberBytesWithCurrentServerAndOldClient() throws 
Exception {
+// Start current version server
+int serverPort = initServerCache(true);
+
+// Start old version client and do puts
+VM client = Host.getHost(0).getVM(testVersion, 1);
+String hostname = NetworkUtils.getServerHostName(Host.getHost(0));
+client.invoke("create client cache", () -> {
+  createClientCache(hostname, serverPort);
+  populateCache();
+});
+
+// Get client member id byte array on client
+byte[] clientMembershipIdBytesOnClient =
+client.invoke(() -> getClientMembershipIdBytesOnClient());
+
+// Get client member id byte array on server
+byte[] clientMembershipIdBytesOnServer =
+server1.invoke(() -> getClientMembershipIdBytesOnServer());
+
+// Verify member id bytes on client and server are equal
+assertTrue(Arrays.equals(clientMembershipIdBytesOnClient, 
clientMembershipIdBytesOnServer));
+  }
+
+  private byte[] getClientMembershipIdBytesOnClient() {
+return EventID.getMembershipId(getCache().getDistributedSystem());
+  }
+
+  private byte[] getClientMembershipIdBytesOnServer() {
+Set cpmIds = 
ClientHealthMonitor.getInstance().getClientHeartbeats().keySet();
+asser

[11/24] geode git commit: GEODE-2629: fix ConnectionJUnitTest use of Mockito 2.7.11

2017-06-19 Thread jensdeppe
GEODE-2629: fix ConnectionJUnitTest use of Mockito 2.7.11


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

Branch: refs/heads/feature/GEODE-3071
Commit: 0d43e3d86acbe0ee136046be8ef00f90ff0c0242
Parents: e3a1ae0
Author: Kirk Lund 
Authored: Tue Jun 13 11:05:54 2017 -0700
Committer: Kirk Lund 
Committed: Wed Jun 14 11:06:33 2017 -0700

--
 .../internal/cache/tier/sockets/command/PutTest.java  | 10 +++---
 .../apache/geode/internal/tcp/ConnectionJUnitTest.java|  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/0d43e3d8/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java
index 2578e00..2b22f13 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java
@@ -20,6 +20,7 @@ import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.*;
 
+import org.apache.geode.internal.cache.EventIDHolder;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -104,7 +105,7 @@ public class PutTest {
 
 when(this.callbackArgsPart.getObject()).thenReturn(CALLBACK_ARG);
 
-when(this.eventPart.getSerializedForm()).thenReturn(this.EVENT);
+when(this.eventPart.getSerializedForm()).thenReturn(EVENT);
 
 when(this.valuePart.getSerializedForm()).thenReturn(VALUE);
 when(this.valuePart.isObject()).thenReturn(true);
@@ -127,8 +128,11 @@ public class PutTest {
 
when(this.serverConnection.getErrorResponseMessage()).thenReturn(this.errorResponseMessage);
 when(this.serverConnection.getClientVersion()).thenReturn(Version.CURRENT);
 
-when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), eq(null), 
eq(true), eq(CALLBACK_ARG),
-any(ClientProxyMembershipID.class), eq(true), 
any(EntryEventImpl.class))).thenReturn(true);
+when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), isNull(), 
eq(true), eq(CALLBACK_ARG),
+isA(ClientProxyMembershipID.class), eq(true), 
isA(EntryEventImpl.class))).thenReturn(true);
+
+// here's the actual call made by tests of basicBridgePut...
+// region.basicBridgePut(key, value, null, isObject, callbackArg, 
serverConnection.getProxyID(), true, new EventIDHolder(eventId));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/geode/blob/0d43e3d8/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java
index 193240d..aeeb60f 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java
@@ -80,6 +80,6 @@ public class ConnectionJUnitTest {
 Connection conn = new Connection(table, socket);
 conn.setSharedUnorderedForTest();
 conn.run();
-verify(membership).suspectMember(any(InternalDistributedMember.class), 
any(String.class));
+verify(membership).suspectMember(isNull(InternalDistributedMember.class), 
any(String.class));
   }
 }



[18/24] geode git commit: GEODE-2632: consolidate different types of SecurityService

2017-06-19 Thread jensdeppe
http://git-wip-us.apache.org/repos/asf/geode/blob/5546a873/geode-core/src/main/java/org/apache/geode/internal/security/shiro/SecurityManagerProvider.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/security/shiro/SecurityManagerProvider.java
 
b/geode-core/src/main/java/org/apache/geode/internal/security/shiro/SecurityManagerProvider.java
new file mode 100644
index 000..ad8e66e
--- /dev/null
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/security/shiro/SecurityManagerProvider.java
@@ -0,0 +1,83 @@
+/*
+ * 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.internal.security.shiro;
+
+import org.apache.logging.log4j.Logger;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.config.Ini;
+import org.apache.shiro.config.IniSecurityManagerFactory;
+import org.apache.shiro.mgt.DefaultSecurityManager;
+import org.apache.shiro.realm.Realm;
+import org.apache.shiro.session.mgt.DefaultSessionManager;
+import org.apache.shiro.session.mgt.SessionManager;
+
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.security.SecurityManager;
+
+public class SecurityManagerProvider {
+  private static Logger logger = 
LogService.getLogger(LogService.SECURITY_LOGGER_NAME);
+
+  private org.apache.shiro.mgt.SecurityManager shiroManager;
+  private SecurityManager securityManager;
+
+  public SecurityManagerProvider() {
+shiroManager = SecurityUtils.getSecurityManager();
+  }
+
+  public SecurityManagerProvider(String shiroConfig) {
+this.securityManager = null;
+
+IniSecurityManagerFactory factory = new 
IniSecurityManagerFactory("classpath:" + shiroConfig);
+// we will need to make sure that shiro uses a case sensitive permission 
resolver
+Ini.Section main = factory.getIni().addSection("main");
+main.put("geodePermissionResolver", 
GeodePermissionResolver.class.getName());
+if (!main.containsKey("iniRealm.permissionResolver")) {
+  main.put("iniRealm.permissionResolver", "$geodePermissionResolver");
+}
+shiroManager = factory.getInstance();
+  }
+
+
+  public SecurityManagerProvider(SecurityManager securityManager) {
+this.securityManager = securityManager;
+
+Realm realm = new CustomAuthRealm(securityManager);
+shiroManager = new DefaultSecurityManager(realm);
+increaseShiroGlobalSessionTimeout((DefaultSecurityManager) shiroManager);
+  }
+
+  private void increaseShiroGlobalSessionTimeout(final DefaultSecurityManager 
shiroManager) {
+SessionManager sessionManager = shiroManager.getSessionManager();
+if (DefaultSessionManager.class.isInstance(sessionManager)) {
+  DefaultSessionManager defaultSessionManager = (DefaultSessionManager) 
sessionManager;
+  defaultSessionManager.setGlobalSessionTimeout(Long.MAX_VALUE);
+  long value = defaultSessionManager.getGlobalSessionTimeout();
+  if (value != Long.MAX_VALUE) {
+logger.error("Unable to set Shiro Global Session Timeout. Current 
value is '{}'.", value);
+  }
+} else {
+  logger.error("Unable to set Shiro Global Session Timeout. Current 
SessionManager is '{}'.",
+  sessionManager == null ? "null" : sessionManager.getClass());
+}
+  }
+
+  public org.apache.shiro.mgt.SecurityManager getShiroSecurityManager() {
+return shiroManager;
+  }
+
+  public SecurityManager getSecurityManager() {
+return securityManager;
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/5546a873/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
index a0c3cf3..b0e20d9 100755
--- 
a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
@@ -58,9 +58,6 @@ import 
org.apache.geode.internal.admin.re

[22/24] geode git commit: GEODE-3072: Ignore dunit test

2017-06-19 Thread jensdeppe
GEODE-3072: Ignore dunit test


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

Branch: refs/heads/feature/GEODE-3071
Commit: dbc3197f3645f6beab058ad1bfe82e12860617c6
Parents: 4bf80a6
Author: Barry Oglesby 
Authored: Fri Jun 16 14:17:23 2017 -0700
Committer: Barry Oglesby 
Committed: Fri Jun 16 14:17:23 2017 -0700

--
 .../internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/dbc3197f/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
index fa68781..5fb8fa2 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java
@@ -96,7 +96,7 @@ public class ClientServerMiscBCDUnitTest extends 
ClientServerMiscDUnitTest {
 });
   }
 
-  //@Test
+  // @Test
   @Ignore
   public void testDistributedMemberBytesWithCurrentServerAndOldClient() throws 
Exception {
 // Start current version server



[2/6] geode git commit: Remove debug println

2017-06-19 Thread jensdeppe
Remove debug println


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

Branch: refs/heads/develop
Commit: ee88cd282be5fbe43a2d89cc3c1d4f548ba2e183
Parents: 588c3ed
Author: Jens Deppe 
Authored: Thu Jun 15 08:01:46 2017 -0700
Committer: Jens Deppe 
Committed: Thu Jun 15 08:01:46 2017 -0700

--
 gradle/docker.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/ee88cd28/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index 7a74c5d..5c2ef77 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -65,7 +65,7 @@ def dockerConfig = {
 
   args[3] = args[3] + matcher[0][1]
   def workdir = new File(args[3])
-  println "dockerize: making ${workdir}"
+  // println "dockerize: making ${workdir}"
   workdir.mkdirs()
   // println args
 



[5/6] geode git commit: Merge branch 'develop' into feature/GEODE-3071

2017-06-19 Thread jensdeppe
Merge branch 'develop' into feature/GEODE-3071


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

Branch: refs/heads/develop
Commit: dba7dcd3042ae7cf9776822bb4e69f47291fc296
Parents: 07e8986 78f08e8
Author: Jens Deppe 
Authored: Mon Jun 19 08:23:24 2017 -0700
Committer: Jens Deppe 
Committed: Mon Jun 19 08:23:24 2017 -0700

--
 .../cli/commands/StatusLocatorRealGfshTest.java |  50 +++
 ...erConfigurationServiceEndToEndDUnitTest.java |   8 +-
 .../geode/test/dunit/rules/gfsh/GfshRule.java   | 116 ++
 .../geode/test/dunit/rules/gfsh/GfshScript.java | 124 ++
 .../source/subnavs/geode-subnav.erb |   8 +-
 geode-core/build.gradle |   4 -
 .../internal/InternalDistributedSystem.java |  62 +--
 .../apache/geode/internal/cache/EventID.java|   2 +-
 .../geode/internal/cache/GemFireCacheImpl.java  |   2 -
 .../geode/internal/jta/GlobalTransaction.java   |   4 +
 .../geode/internal/jta/TransactionImpl.java |   3 +
 .../internal/jta/TransactionManagerImpl.java|  15 +
 .../geode/internal/jta/UserTransactionImpl.java |   4 +
 .../org/apache/geode/internal/jta/XidImpl.java  |   4 +
 .../internal/security/CallbackInstantiator.java |  28 ++
 .../security/CustomSecurityService.java | 346 
 .../security/DisabledSecurityService.java   | 221 ---
 .../security/EnabledSecurityService.java| 393 ---
 .../security/IntegratedSecurityService.java | 374 ++
 .../security/LegacySecurityService.java | 186 +
 .../internal/security/SecurityService.java  |  99 +++--
 .../security/SecurityServiceFactory.java| 188 +++--
 .../internal/security/SecurityServiceType.java  |  28 --
 .../security/shiro/ConfigInitializer.java   |  43 --
 .../security/shiro/CustomAuthRealm.java |  19 +-
 .../security/shiro/RealmInitializer.java|  54 ---
 .../security/shiro/SecurityManagerProvider.java |  83 
 .../internal/cli/commands/ConfigCommands.java   |  17 +-
 .../CreateAlterDestroyRegionCommands.java   |  24 +-
 .../internal/cli/commands/DataCommands.java |   4 +-
 .../internal/cli/commands/DeployCommands.java   |  57 +--
 .../cli/commands/DiskStoreCommands.java |  12 +-
 .../cli/commands/DurableClientCommands.java |  22 +-
 .../cli/commands/ExportLogsCommand.java |   4 +-
 .../internal/cli/commands/FunctionCommands.java |  20 +-
 .../internal/cli/commands/IndexCommands.java|  14 +-
 .../cli/commands/LauncherLifecycleCommands.java |   4 +-
 .../internal/cli/commands/MemberCommands.java   |   4 +-
 .../cli/commands/MiscellaneousCommands.java |  34 +-
 .../internal/cli/commands/QueueCommands.java|   2 +-
 .../internal/cli/commands/RegionCommands.java   |   6 +-
 .../internal/cli/commands/WanCommands.java  | 116 +++---
 .../internal/cli/functions/DeployFunction.java  |   3 -
 .../cli/functions/UndeployFunction.java |   9 +-
 .../internal/cli/i18n/CliStrings.java   |  99 +
 .../controllers/ConfigCommandsController.java   |  24 +-
 .../web/controllers/DataCommandsController.java |   4 +-
 .../controllers/DeployCommandsController.java   |  26 +-
 .../DiskStoreCommandsController.java|  22 +-
 .../DurableClientCommandsController.java|  50 +--
 .../web/controllers/ExportLogController.java|  10 +-
 .../controllers/FunctionCommandsController.java |  32 +-
 .../controllers/IndexCommandsController.java|  36 +-
 .../controllers/MemberCommandsController.java   |   6 +-
 .../MiscellaneousCommandsController.java|  36 +-
 .../controllers/QueueCommandsController.java|   6 +-
 .../controllers/RegionCommandsController.java   |  20 +-
 .../web/controllers/WanCommandsController.java  | 143 +++
 .../internal/index/HashIndexSetJUnitTest.java   |   2 +-
 .../membership/MembershipJUnitTest.java |   3 -
 .../messenger/JGroupsMessengerJUnitTest.java|   6 +-
 .../gms/mgr/GMSMembershipManagerJUnitTest.java  |   8 +-
 .../DeposePrimaryBucketMessageTest.java |   1 -
 .../partitioned/FetchEntryMessageTest.java  |   1 -
 .../FetchPartitionDetailsMessageTest.java   |   1 -
 .../partitioned/MoveBucketMessageTest.java  |   1 -
 .../partitioned/RemoveBucketMessageTest.java|   1 -
 .../sockets/ClientServerMiscBCDUnitTest.java|  42 ++
 .../tier/sockets/ClientServerMiscDUnitTest.java |   4 +-
 .../tier/sockets/command/ContainsKey66Test.java |   2 +-
 .../tier/sockets/command/CreateRegionTest.java  |   2 +-
 .../tier/sockets/command/Destroy65Test.java |   2 +-
 .../tier/sockets/command/DestroyRegionTest.java |   2 +-
 .../cache/tier/sockets/command/DestroyTest.java |   2 +-
 .../sockets/c

[6/6] geode git commit: Merge branch 'feature/GEODE-3071' into develop

2017-06-19 Thread jensdeppe
Merge branch 'feature/GEODE-3071' into develop


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

Branch: refs/heads/develop
Commit: 80667f30ef66d52987235374f3c95f6a39e0cd78
Parents: 8db7862 dba7dcd
Author: Jens Deppe 
Authored: Mon Jun 19 14:22:22 2017 -0700
Committer: Jens Deppe 
Committed: Mon Jun 19 14:22:22 2017 -0700

--
 build.gradle |   7 
 gradle.properties|   7 
 gradle/docker.gradle | 100 ++
 3 files changed, 114 insertions(+)
--




[1/6] geode git commit: GEODE-3071: Provide capability to parallelize distributedTests

2017-06-19 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/develop 8db786275 -> 80667f30e


GEODE-3071: Provide capability to parallelize distributedTests

Herewith the ability to leverage Gradle's parallel test execution
capability to run dunits in parallel. This is combined with launching
tests in Docker containers to provide process, network and filesystem
isolation. Depending on the size of your system, this can speed up
running the distributedTest task 2-5 times.

The capability is enabled by launching gradle with '-PparallelDunit'

Tunables, enabled as gradle parametrs (-P option) are:

- dunitDockerImage: The docker image which will be used to launch
  tests. The image must have the JAVA_HOME environment variable set. The
  image must be pulled locally before starting the tests.
- dunitParallelForks: The number of parallel docker containers to be
  launched.
- dunitDockerUser: The docker user which will run the tests. Because of
  the way that the containers map the build directory into them, the
  test artifacts, will be written with this user id. By default this is
  'root'.


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

Branch: refs/heads/develop
Commit: 588c3ed8af4b9a1b46737c2faebafa589a396e12
Parents: a4d790c
Author: Jens Deppe 
Authored: Wed Jun 14 08:03:22 2017 -0700
Committer: Jens Deppe 
Committed: Wed Jun 14 08:03:22 2017 -0700

--
 build.gradle |  2 ++
 gradle.properties|  7 
 gradle/docker.gradle | 83 +++
 3 files changed, 92 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/588c3ed8/build.gradle
--
diff --git a/build.gradle b/build.gradle
index ec6b920..57372b3 100755
--- a/build.gradle
+++ b/build.gradle
@@ -26,6 +26,7 @@ buildscript {
 classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1'
 classpath "com.diffplug.gradle.spotless:spotless:2.2.0"
 classpath "me.champeau.gradle:jmh-gradle-plugin:0.3.1"
+classpath "com.pedjak.gradle.plugins:dockerized-test:0.4.2"
   }
 }
 
@@ -82,6 +83,7 @@ apply from: "${scriptDir}/code-analysis.gradle"
 apply from: "${scriptDir}/sonar.gradle"
 apply from: "${scriptDir}/ide.gradle"
 apply from: "${scriptDir}/rat.gradle"
+apply from: "${scriptDir}/docker.gradle"
 
 subprojects {
   // Make sure clean task for rootProject runs last

http://git-wip-us.apache.org/repos/asf/geode/blob/588c3ed8/gradle.properties
--
diff --git a/gradle.properties b/gradle.properties
index ca79a38..9462295 100755
--- a/gradle.properties
+++ b/gradle.properties
@@ -49,3 +49,10 @@ buildRoot=
 
 # We want signing to be on by default. Signing requires GPG to be set up.
 nexusSignArchives = true
+
+# Control how many concurrent dunit (using docker) tests will be run
+dunitParallelForks = 8
+# This is the name of the Docker image for running parallel dunits
+dunitDockerImage = openjdk:8
+# Docker user for parallel dunit tests
+dunitDockerUser = root

http://git-wip-us.apache.org/repos/asf/geode/blob/588c3ed8/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
new file mode 100644
index 000..7a74c5d
--- /dev/null
+++ b/gradle/docker.gradle
@@ -0,0 +1,83 @@
+/*
+ * Configuration for running (dunit) tests in parallel in Docker containers.
+ * The container used must hava JAVA_HOME set in it's environment and must
+ * have 'java' defined on the path. For example, the relevant Dockerfile
+ * content could be:
+ * 
+ *   ENV JAVA_HOME=/opt/jdk1.8.0_u101
+ *   ENV PATH=$PATH:$JAVA_HOME/bin
+ *
+ * In addition, the container must have docker installed.
+ *
+ * The plugin can be activated with the Gradle property 'parallelDunit'.
+ * Additional properties that can be set are:
+ *
+ *  dunitDockerImage   - The docker image used for running parallel dunits. The
+ *   default image is 'openjdk:8'. The image is required to
+ *   have 'JAVA_HOME' set as an environment variable.
+ *  dunitParallelForks - The number of parallel containers that will be
+ *   launched. The default is 8.
+ *  dunitDockerUser- The user used within the docker container to run 
tests.
+ *   The default is 'root'.
+ */
+
+def dockerConfig = {
+  maxParallelForks = dunitParallelForks.toInteger()
+
+  docker {
+// base image for creating docker containers that execute the tests
+image = dunitDockerImage
+
+// volumes mounted to the containers
+// in 

[3/6] geode git commit: GEODE_3071: Add Apache license header

2017-06-19 Thread jensdeppe
GEODE_3071: Add Apache license header


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

Branch: refs/heads/develop
Commit: b26fa518c8ab04f60697a5b61c36a1222a68b515
Parents: ee88cd2
Author: Jens Deppe 
Authored: Fri Jun 16 08:05:32 2017 -0700
Committer: Jens Deppe 
Committed: Fri Jun 16 08:05:32 2017 -0700

--
 gradle/docker.gradle | 17 +
 1 file changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/b26fa518/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index 5c2ef77..b67c073 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -1,4 +1,21 @@
 /*
+ * 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.
+ */
+
+/*
  * Configuration for running (dunit) tests in parallel in Docker containers.
  * The container used must hava JAVA_HOME set in it's environment and must
  * have 'java' defined on the path. For example, the relevant Dockerfile



[4/6] geode git commit: GEODE-3071: Pull config of docker volumes into top level script so that they can be overridden

2017-06-19 Thread jensdeppe
GEODE-3071: Pull config of docker volumes into top level script so that they 
can be overridden


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

Branch: refs/heads/develop
Commit: 07e8986e3deb722c0beea380eac00a18c86844aa
Parents: b26fa51
Author: Jens Deppe 
Authored: Mon Jun 19 07:42:57 2017 -0700
Committer: Jens Deppe 
Committed: Mon Jun 19 07:48:27 2017 -0700

--
 build.gradle | 5 +
 gradle/docker.gradle | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/07e8986e/build.gradle
--
diff --git a/build.gradle b/build.gradle
index 57372b3..4feb879 100755
--- a/build.gradle
+++ b/build.gradle
@@ -74,6 +74,11 @@ if (name == 'geode') {
   ext.scriptDir = 'gradle'
 }
 
+if (project.hasProperty('parallelDunit')) {
+  def pwd = System.getenv('PWD')
+  ext.dunitDockerVolumes = ["${pwd}":pwd]
+}
+
 apply from: "${scriptDir}/utilities.gradle"
 apply from: "${scriptDir}/java.gradle"
 apply from: "${scriptDir}/dependency-resolution.gradle"

http://git-wip-us.apache.org/repos/asf/geode/blob/07e8986e/gradle/docker.gradle
--
diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index b67c073..7971974 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -47,11 +47,11 @@ def dockerConfig = {
 
 // volumes mounted to the containers
 // in a form: host_dir : container_dir
-def pwd = System.getenv('PWD')
 def gradleHome = System.getenv('GRADLE_USER_HOME') ?: 
"${System.getenv('HOME')}/.gradle"
 volumes = ["${gradleHome}":gradleHome]
 
-volumes << ["${pwd}":pwd]
+// Add volumes configured by top-level build script
+volumes << project.dunitDockerVolumes
 
 // specify the user for starting Gradle test worker within the container.
 user = dunitDockerUser



geode git commit: GEODE-3109: Publish modules distribution artifacts to maven

2017-06-23 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3109 [created] adab0c469


GEODE-3109: Publish modules distribution artifacts to maven

- Although the build will create local artifacts like
  Apache_Geode_Modules-1.3.0-SNAPSHOT-tcServer.zip, the published artifacts
  will be at co-ordinates:
  org.apache.geode:geode-modules-assembly:zip:tcServer:1.3.0-SNAPSHOT

Signed-off-by: Dick Cavender 


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

Branch: refs/heads/feature/GEODE-3109
Commit: adab0c469053e9dad92c151a558fb383c5d00de7
Parents: 5039e62
Author: Jens Deppe 
Authored: Fri Jun 23 08:32:13 2017 -0700
Committer: Dick Cavender 
Committed: Fri Jun 23 08:32:13 2017 -0700

--
 extensions/geode-modules-assembly/build.gradle  | 28 +++-
 .../geode-modules-session-internal/build.gradle |  4 ++-
 extensions/geode-modules-session/build.gradle   |  2 ++
 extensions/geode-modules-tomcat7/build.gradle   |  2 ++
 extensions/geode-modules-tomcat8/build.gradle   |  2 ++
 extensions/geode-modules/build.gradle   |  2 ++
 6 files changed, 33 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/adab0c46/extensions/geode-modules-assembly/build.gradle
--
diff --git a/extensions/geode-modules-assembly/build.gradle 
b/extensions/geode-modules-assembly/build.gradle
index 5604e12..ecb67a7 100644
--- a/extensions/geode-modules-assembly/build.gradle
+++ b/extensions/geode-modules-assembly/build.gradle
@@ -27,14 +27,13 @@ dependencies {
   slf4jDeps 'org.slf4j:slf4j-jdk14:' + project.'slf4j-api.version'
 }
 
-jar.enabled = false
+jar.enabled = true
 extraArchive {
   sources = false
   javadoc = false
   tests = false
 }
 
-disableMavenPublishing()
 disableSigning()
 
 def getJarArtifact(module) {
@@ -43,8 +42,11 @@ def getJarArtifact(module) {
   }.collect { it.file }
 }
 
+def moduleBaseName = "${productName.replace(' ', '_')}_Modules"
+
 def configureTcServerAssembly = {
-  archiveName = "Apache_Geode_Modules-${version}-tcServer.zip"
+  baseName = moduleBaseName
+  classifier = "tcServer"
 
   // All client-server files
   into('geode-cs/lib') {
@@ -116,7 +118,8 @@ def configureTcServerAssembly = {
 }
 
 def configureTcServer30Assembly = {
-  archiveName = "Apache_Geode_Modules-${version}-tcServer30.zip"
+  baseName = moduleBaseName
+  classifier = "tcServer30"
 
   into('geode-cs-tomcat-8/conf') {
 from('release/tcserver/geode-cs-tomcat-8') {
@@ -132,7 +135,8 @@ def configureTcServer30Assembly = {
 }
 
 task distTomcat(type: Zip, dependsOn: ':extensions/geode-modules:assemble') {
-  archiveName = "Apache_Geode_Modules-${version}-Tomcat.zip"
+  baseName = moduleBaseName
+  classifier = "Tomcat"
 
   // All client-server files
   into('lib') {
@@ -155,7 +159,8 @@ task distTomcat(type: Zip, dependsOn: 
':extensions/geode-modules:assemble') {
 }
 
 task distAppServer(type: Zip, dependsOn: 
':extensions/geode-modules-session:assemble') {
-  archiveName = "Apache_Geode_Modules-${version}-AppServer.zip"
+  baseName = moduleBaseName
+  classifier = "AppServer"
 
   into('lib') {
 from getJarArtifact(':extensions/geode-modules-session')
@@ -202,3 +207,14 @@ dependencies {
 task dist(type: Task, dependsOn: ['distTcServer', 'distTcServer30', 
'distTomcat', 'distAppServer'])
 
 build.dependsOn dist
+
+install.dependsOn dist
+uploadArchives.dependsOn dist
+
+artifacts {
+  archives distTcServer
+  archives distTcServer30
+  archives distAppServer
+  archives distTomcat
+}
+

http://git-wip-us.apache.org/repos/asf/geode/blob/adab0c46/extensions/geode-modules-session-internal/build.gradle
--
diff --git a/extensions/geode-modules-session-internal/build.gradle 
b/extensions/geode-modules-session-internal/build.gradle
index 61c954b..39c6e55 100644
--- a/extensions/geode-modules-session-internal/build.gradle
+++ b/extensions/geode-modules-session-internal/build.gradle
@@ -22,4 +22,6 @@ dependencies {
 
 jar {
   baseName = 'geode-modules-session-internal'
-}
\ No newline at end of file
+}
+
+disableMavenPublishing()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/geode/blob/adab0c46/extensions/geode-modules-session/build.gradle
--
diff --git a/extensions/geode-modules-session/build.gradle 
b/extensions/geode-modules-session/build.gradle
index 3063772..0469070 100644
--- a/extensions/geode-modules-session/build.gradle
+++ b/extensions/geode-modules-session/build.gradle
@@ -40,3 +40,5 @@ jar {
   }
   baseName = '

[01/51] [abbrv] geode git commit: GEODE-2995: Implementing review feedback

2017-07-10 Thread jensdeppe
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3109 adab0c469 -> 12f90ee88


http://git-wip-us.apache.org/repos/asf/geode/blob/31f4de06/geode-protobuf/src/test/java/org/apache/geode/protocol/serializer/ProtobufProtocolSerializerJUnitTest.java
--
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/protocol/serializer/ProtobufProtocolSerializerJUnitTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/protocol/serializer/ProtobufProtocolSerializerJUnitTest.java
new file mode 100644
index 000..95244d2
--- /dev/null
+++ 
b/geode-protobuf/src/test/java/org/apache/geode/protocol/serializer/ProtobufProtocolSerializerJUnitTest.java
@@ -0,0 +1,81 @@
+/*
+ * 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.protocol.serializer;
+
+import org.apache.geode.client.protocol.MessageUtil;
+import org.apache.geode.protocol.exception.InvalidProtocolMessageException;
+import 
org.apache.geode.protocol.protobuf.serializer.ProtobufProtocolSerializer;
+import org.apache.geode.protocol.protobuf.ClientProtocol;
+import org.apache.geode.test.junit.categories.UnitTest;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ServiceLoader;
+
+@Category(UnitTest.class)
+public class ProtobufProtocolSerializerJUnitTest {
+  private ProtocolSerializer protocolSerializer;
+
+  @Before
+  public void startup() {
+ServiceLoader serviceLoader = 
ServiceLoader.load(ProtocolSerializer.class);
+for (ProtocolSerializer protocolSerializer : serviceLoader) {
+  if (protocolSerializer instanceof ProtobufProtocolSerializer) {
+this.protocolSerializer = protocolSerializer;
+  }
+}
+  }
+
+  @Test
+  public void testDeserializeByteArrayToMessage()
+  throws IOException, InvalidProtocolMessageException {
+ClientProtocol.Message expectedRequestMessage = 
MessageUtil.createGetRequestMessage();
+
+ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+
+expectedRequestMessage.writeDelimitedTo(byteArrayOutputStream);
+InputStream inputStream = new 
ByteArrayInputStream(byteArrayOutputStream.toByteArray());
+
+ClientProtocol.Message actualMessage = 
protocolSerializer.deserialize(inputStream);
+Assert.assertEquals(expectedRequestMessage, actualMessage);
+  }
+
+  @Test(expected = InvalidProtocolMessageException.class)
+  public void testDeserializeInvalidByteThrowsException()
+throws IOException, InvalidProtocolMessageException {
+ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+byteArrayOutputStream.write("Some incorrect byte array".getBytes());
+InputStream inputStream = new 
ByteArrayInputStream(byteArrayOutputStream.toByteArray());
+protocolSerializer.deserialize(inputStream);
+  }
+
+  @Test
+  public void testSerializeMessageToByteArray() throws IOException {
+ClientProtocol.Message message = MessageUtil.createGetRequestMessage();
+ByteArrayOutputStream expectedByteArrayOutputStream = new 
ByteArrayOutputStream();
+message.writeDelimitedTo(expectedByteArrayOutputStream);
+byte[] expectedByteArray = expectedByteArrayOutputStream.toByteArray();
+
+ByteArrayOutputStream actualByteArrayOutputStream = new 
ByteArrayOutputStream();
+protocolSerializer.serialize(message, actualByteArrayOutputStream);
+Assert.assertArrayEquals(expectedByteArray, 
actualByteArrayOutputStream.toByteArray());
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/31f4de06/geode-protobuf/src/test/java/org/apache/geode/serialization/ProtobufSerializationServiceImplTest.java
--
diff --git 
a/geode-protobuf/src/test/java/org/apache/geode/serialization/ProtobufSerializationServiceImplTest.java
 
b/geode-protobuf/src/test/java/org/apache/geode/serialization/ProtobufSerializationServiceImplTest.java
index a4c0a14..ef841c3 100644
--- 
a/geode-protobuf/src/test/java/org/apache/ge

[46/51] [abbrv] geode git commit: GEODE-3153 applied spotless

2017-07-10 Thread jensdeppe
GEODE-3153 applied spotless


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

Branch: refs/heads/feature/GEODE-3109
Commit: 1537847e6090de7facd70b80eba0e4de397491ac
Parents: b4ebcba
Author: Hitesh Khamesra 
Authored: Fri Jul 7 16:40:06 2017 -0700
Committer: Hitesh Khamesra 
Committed: Fri Jul 7 16:40:06 2017 -0700

--
 .../geode/internal/cache/ha/EventIdOptimizationJUnitTest.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/1537847e/geode-core/src/test/java/org/apache/geode/internal/cache/ha/EventIdOptimizationJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/EventIdOptimizationJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/EventIdOptimizationJUnitTest.java
index 451dc20..523f0d2 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/EventIdOptimizationJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/EventIdOptimizationJUnitTest.java
@@ -194,7 +194,7 @@ public class EventIdOptimizationJUnitTest {
 eventID2.fromData(dataInputStream);
 
 assertEquals(distributedMember, 
eventID2.getDistributedMember(Version.GFE_90));
-
+
 assertEquals(memberBytes.length + 17, eventID2.getMembershipID().length);
   }
 



[22/51] [abbrv] geode git commit: GEODE-3146 Remove doc reference to GemFire 8.2

2017-07-10 Thread jensdeppe
GEODE-3146 Remove doc reference to GemFire 8.2

This closes #610


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

Branch: refs/heads/feature/GEODE-3109
Commit: 422778608f149637bd6ac6dfd5517c1078cca00c
Parents: 38ad304
Author: Karen Miller 
Authored: Wed Jun 28 11:28:01 2017 -0700
Committer: Karen Miller 
Committed: Wed Jun 28 15:34:24 2017 -0700

--
 .../set_join_redundancy_recovery.html.md.erb| 35 ++--
 1 file changed, 25 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/42277860/geode-docs/developing/partitioned_regions/set_join_redundancy_recovery.html.md.erb
--
diff --git 
a/geode-docs/developing/partitioned_regions/set_join_redundancy_recovery.html.md.erb
 
b/geode-docs/developing/partitioned_regions/set_join_redundancy_recovery.html.md.erb
index 6461f0e..cc3f1a7 100644
--- 
a/geode-docs/developing/partitioned_regions/set_join_redundancy_recovery.html.md.erb
+++ 
b/geode-docs/developing/partitioned_regions/set_join_redundancy_recovery.html.md.erb
@@ -19,23 +19,38 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 -->
 
-Configure whether and how redundancy is recovered in a partition region after 
a member joins.
+This section covers configuring whether and how redundancy is
+recovered in a partitioned region, after a member joins.
 
 
 Use the partition attribute `startup-recovery-delay` to specify member join 
redundancy recovery.
 
-| startup-recovery-delay partition attribute | Effect following a member join  


 |
+| value of `startup-recovery-delay`| Effect following a member 
join

   |
 
||--|
-| -1 | No automatic recovery of 
redundancy after a new member comes online. If you use this and the default 
`recovery-delay` setting, you can only recover redundancy by kicking off 
rebalancing through a cacheserver or API call. |
-| long greater than or equal to **0**| Number of milliseconds to wait 
after a member joins before before recovering redundancy. The default is 0 
(zero), which causes immediate redundancy recovery whenever a new partitioned 
region host joins.   |
-
-Setting this to a value higher than the default of 0 allows multiple new 
members to join before redundancy recovery kicks in. With the multiple members 
present during recovery, the system will spread redundancy recovery among them. 
With no delay, if multiple members are started in close succession, the system 
may choose only the first member started for most or all of the redundancy 
recovery.
-
-**Note:**
-Satisfying redundancy is not the same as adding capacity. If redundancy is 
satisfied, new members do not take buckets until you invoke a rebalance.
+| -1 | No automatic recovery of 
redundancy after a new member comes online. With this value and the default 
`recovery-delay` setting, redundancy recovery is only achieved by a rebalance 
operation. |
+| long >= 0 | Number of milliseconds to wait after a member joins before 
recovering redundancy. The default is 0 (zero), which causes immediate 
redundancy recovery whenever a member that hosts the partitioned region joins. |
+
+Setting `startup-recovery-delay` to a value higher than the 
+default of 0 allows multiple new members to join before 
+redundancy recovery begins.
+With the multiple members present during recovery,
+the system will spread redundancy recovery among them.
+With no delay, if multiple members are started in close succession,
+the system may choose only the first member started for most or all
+of the redundancy recovery.
 
 **Note:**
-With parallel recovery introduced in version 8.2, redundancy may be recovered 
more quickly than in previous versions. For this reason, it is even more 
important to configure `startup-recovery-delay` to an appropriate value if you 
intend to restart multiple

[38/51] [abbrv] geode git commit: GEODE-3150: Increasing test timeout for testDiskConflictWithCoLocation

2017-07-10 Thread jensdeppe
GEODE-3150: Increasing test timeout for testDiskConflictWithCoLocation

This test was timing out on slower machines.


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

Branch: refs/heads/feature/GEODE-3109
Commit: 1e3cc132b4747ce494494b4a335ced7ba518c5dc
Parents: 3433b3e
Author: Dan Smith 
Authored: Mon Jul 3 15:09:04 2017 -0700
Committer: Dan Smith 
Committed: Mon Jul 3 15:09:04 2017 -0700

--
 .../cache/partitioned/PersistentPartitionedRegionDUnitTest.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/1e3cc132/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
index e1c9e8a..098a14c 100644
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
@@ -2117,7 +2117,7 @@ public class PersistentPartitionedRegionDUnitTest extends 
PersistentPartitionedR
 closePR(vm1);
   }
 
-  @Test(timeout = 6)
+  @Test(timeout = 300_000)
   public void testDiskConflictWithCoLocation() throws Exception {
 Host host = Host.getHost(0);
 VM vm0 = host.getVM(0);



[06/51] [abbrv] geode git commit: merge GEODE-2995, GEODE-3775 into develop with integration test.

2017-07-10 Thread jensdeppe
merge GEODE-2995, GEODE-3775 into develop with integration test.

Signed-off-by: Brian Rowe 


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

Branch: refs/heads/feature/GEODE-3109
Commit: db11ebc1efdf2371bdf1566a7828dc08ea621e2c
Parents: e62e825
Author: Galen OSullivan 
Authored: Wed Jun 21 16:53:03 2017 -0700
Committer: Hitesh Khamesra 
Committed: Mon Jun 26 09:26:23 2017 -0700

--
 .../sockets/ClientProtocolMessageHandler.java   |  18 +--
 .../tier/sockets/ServerConnectionFactory.java   |  39 +-
 .../sockets/ServiceLoadingFailureException.java |  35 ++
 .../ServerConnectionFactoryIntegrationTest.java |  67 --
 .../sockets/ServerConnectionFactoryTest.java|  43 ++-
 .../protobuf/ProtobufStreamProcessor.java   |  15 ++-
 ...he.tier.sockets.ClientProtocolMessageHandler |   1 +
 .../RoundTripCacheConnectionJUnitTest.java  | 123 +++
 8 files changed, 256 insertions(+), 85 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/db11ebc1/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientProtocolMessageHandler.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientProtocolMessageHandler.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientProtocolMessageHandler.java
index 702609d..32e9e4b 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientProtocolMessageHandler.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientProtocolMessageHandler.java
@@ -22,14 +22,14 @@ import java.io.InputStream;
 import java.io.OutputStream;
 
 /**
- * Stub, this will be hooked up to the new client protocol when it's 
implemented.
+ * This is an interface that other modules can implement to hook into
+ * {@link GenericProtocolServerConnection} to handle messages sent to Geode.
+ *
+ * Currently, only one {@link ClientProtocolMessageHandler} at a time can be 
used in a Geode
+ * instance. It gets wired into {@link ServerConnectionFactory} to create all 
instances of
+ * {@link GenericProtocolServerConnection}.
  */
-public class ClientProtocolMessageHandler {
-  /**
-   * Bogus, but it lets us write an integration test so that nobody breaks our 
flow.
-   */
-  public void receiveMessage(InputStream inputStream, OutputStream 
outputStream,
-  InternalCache cache) throws IOException {
-outputStream.write(inputStream.read());
-  }
+public interface ClientProtocolMessageHandler {
+  void receiveMessage(InputStream inputStream, OutputStream outputStream, 
InternalCache cache)
+  throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/db11ebc1/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnectionFactory.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnectionFactory.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnectionFactory.java
index e4746a7..ad13b78 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnectionFactory.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnectionFactory.java
@@ -22,14 +22,46 @@ import org.apache.geode.internal.security.SecurityService;
 
 import java.io.IOException;
 import java.net.Socket;
+import java.util.Iterator;
+import java.util.ServiceLoader;
+import javax.management.ServiceNotFoundException;
 
 /**
  * Creates instances of ServerConnection based on the connection mode provided.
  */
 public class ServerConnectionFactory {
-  // TODO: implement ClientProtocolMessageHandler.
-  private static final ClientProtocolMessageHandler protobufProtocolHandler =
-  new ClientProtocolMessageHandler();
+  private static ClientProtocolMessageHandler protobufProtocolHandler;
+  private static final Object protocolLoadLock = new Object();
+
+  private static ClientProtocolMessageHandler 
findClientProtocolMessageHandler() {
+if (protobufProtocolHandler != null) {
+  return protobufProtocolHandler;
+}
+
+synchronized (protocolLoadLock) {
+  if (protobufProtocolHandler != null) {
+return protobufProtocolHandler;
+  }
+
+  ServiceLoader loader =
+  ServiceLoader.load(ClientProtocolMessageHandler.class);
+  Iterator iterator = loader.iterator();
+
+  if (!iterator.hasNext()) {
+throw new ServiceLoadingFailureException(
+   

  1   2   3   4   5   6   7   8   9   10   >