[2/2] geode git commit: GEODE-2580 : Post Kotlin changes

2017-05-23 Thread udo
GEODE-2580 : Post Kotlin changes


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

Branch: refs/heads/feature/GEODE-2580
Commit: 6a5e4be30b79c805101017c627719e6949c2dfb7
Parents: c1e22f3
Author: Udo Kohlmeyer 
Authored: Tue May 23 16:41:19 2017 -0700
Committer: Udo Kohlmeyer 
Committed: Tue May 23 16:41:19 2017 -0700

--
 .../geode/protocol/client/EncodingTypeThingy.kt |  51 +++---
 .../client/ProtobufProtocolMessageHandler.java  | 147 -
 .../client/ProtobufProtocolMessageHandler.kt| 128 +++
 .../geode/protocol/client/MessageUtils.java |  83 --
 .../geode/protocol/client/MessageUtils.kt   |  69 
 .../client/ProtobufProtocolIntegrationTest.java | 134 
 .../client/ProtobufProtocolIntegrationTest.kt   | 159 +++
 ...rotobufSerializationDeserializationTest.java |  94 ---
 .../ProtobufSerializationDeserializationTest.kt |  94 +++
 .../serialization/SerializationTypeTest.java|  26 ++-
 10 files changed, 492 insertions(+), 493 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/6a5e4be3/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
--
diff --git 
a/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
 
b/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
index 8d65827..cfb1332 100644
--- 
a/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
+++ 
b/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
@@ -5,29 +5,40 @@ import org.apache.geode.pdx.PdxInstance
 import org.apache.geode.protocol.protobuf.BasicTypes
 import org.apache.geode.serialization.SerializationType
 
-fun getEncodingTypeForObjectKT(o: Any?): BasicTypes.EncodingType {
-return when (o) {
-is String -> BasicTypes.EncodingType.STRING
-is Int -> BasicTypes.EncodingType.INT
-is PdxInstance -> {
-if (o.className == JSONFormatter.JSON_CLASSNAME) 
BasicTypes.EncodingType.JSON else BasicTypes.EncodingType.UNRECOGNIZED
+object EncodingTypeThingy {
+@JvmStatic
+fun getEncodingTypeForObjectKT(obj: Any?): BasicTypes.EncodingType {
+return when (obj) {
+is Byte -> BasicTypes.EncodingType.BYTE
+is Short -> BasicTypes.EncodingType.SHORT
+is Long -> BasicTypes.EncodingType.LONG
+is String -> BasicTypes.EncodingType.STRING
+is Int -> BasicTypes.EncodingType.INT
+is PdxInstance -> {
+if (obj.className == JSONFormatter.JSON_CLASSNAME) {
+BasicTypes.EncodingType.JSON
+} else {
+BasicTypes.EncodingType.UNRECOGNIZED
+}
+}
+is ByteArray -> BasicTypes.EncodingType.BINARY
+else -> BasicTypes.EncodingType.UNRECOGNIZED
 }
-is ByteArray -> BasicTypes.EncodingType.BINARY
-else -> BasicTypes.EncodingType.UNRECOGNIZED
 }
-}
 
-fun serializerFromProtoEnum(encodingType: BasicTypes.EncodingType): 
SerializationType {
-return when (encodingType) {
-BasicTypes.EncodingType.INT -> SerializationType.INT
-BasicTypes.EncodingType.LONG -> SerializationType.LONG
-BasicTypes.EncodingType.SHORT -> SerializationType.SHORT
-BasicTypes.EncodingType.BYTE -> SerializationType.BYTE
-BasicTypes.EncodingType.STRING -> SerializationType.STRING
-BasicTypes.EncodingType.BINARY -> SerializationType.BYTE_BLOB
-BasicTypes.EncodingType.JSON -> SerializationType.JSON
-BasicTypes.EncodingType.FLOAT, BasicTypes.EncodingType.BOOLEAN, 
BasicTypes.EncodingType.DOUBLE -> TODO()
-else -> TODO()
+@JvmStatic
+fun serializerFromProtoEnum(encodingType: BasicTypes.EncodingType): 
SerializationType {
+return when (encodingType) {
+BasicTypes.EncodingType.INT -> SerializationType.INT
+BasicTypes.EncodingType.LONG -> SerializationType.LONG
+BasicTypes.EncodingType.SHORT -> SerializationType.SHORT
+BasicTypes.EncodingType.BYTE -> SerializationType.BYTE
+BasicTypes.EncodingType.STRING -> SerializationType.STRING
+BasicTypes.EncodingType.BINARY -> SerializationType.BYTE_BLOB
+BasicTypes.EncodingType.JSON -> SerializationType.JSON
+BasicTypes.EncodingType.FLOAT, BasicTypes.EncodingType.BOOLEAN, 
BasicTypes.EncodingType.DOUBLE -> TODO()
+ 

[1/2] geode git commit: GEODE-2580 : Pre Kotlin conversion

2017-05-23 Thread udo
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2580 2ccedd062 -> 6a5e4be30


GEODE-2580 : Pre Kotlin conversion


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

Branch: refs/heads/feature/GEODE-2580
Commit: c1e22f3757f96e8bf100bd4dd39819e142782e9a
Parents: 2ccedd0
Author: Udo Kohlmeyer 
Authored: Tue May 23 11:47:46 2017 -0700
Committer: Udo Kohlmeyer 
Committed: Tue May 23 11:47:46 2017 -0700

--
 geode-client-protobuf/build.gradle  |  14 +-
 .../geode/protocol/client/EncodingTypeThingy.kt |  33 
 .../client/NewClientProtocolTestClient.java |   8 +-
 .../client/ProtobufProtocolMessageHandler.java  | 153 ++-
 .../src/main/proto/basicTypes.proto |  35 +++--
 .../src/main/proto/region_API.proto |  10 +-
 .../geode/protocol/client/MessageUtils.java |  62 +++-
 .../client/ProtobufProtocolIntegrationTest.java | 112 +++---
 ...rotobufSerializationDeserializationTest.java |  63 
 .../sockets/ClientProtocolMessageHandler.java   |   4 +-
 .../cache/tier/sockets/ServerConnection.java|   4 +-
 .../geode/serialization/Deserializer.java   |   2 +-
 .../geode/serialization/SerializationType.java  |  62 +++-
 .../apache/geode/serialization/Serializer.java  |   2 +-
 .../serialization/SerializationTypeTest.java| 113 ++
 15 files changed, 402 insertions(+), 275 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/c1e22f37/geode-client-protobuf/build.gradle
--
diff --git a/geode-client-protobuf/build.gradle 
b/geode-client-protobuf/build.gradle
index c82f311..79932ae 100644
--- a/geode-client-protobuf/build.gradle
+++ b/geode-client-protobuf/build.gradle
@@ -17,19 +17,24 @@
 
 
 apply plugin: 'java'
+apply plugin: 'kotlin'
 apply plugin: 'com.google.protobuf'
 apply plugin: 'idea'
 
 repositories {
   maven { url "https://plugins.gradle.org/m2/"; }
+mavenCentral()
 }
 
 buildscript {
-  repositories {
+ext.kotlin_version = '1.1.1'
+repositories {
 maven { url "https://plugins.gradle.org/m2/"; }
-  }
+mavenCentral()
+}
   dependencies {
 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.1'
+  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
   }
 }
 
@@ -48,9 +53,12 @@ dependencies {
   testCompile project (':geode-junit')
   testCompile "org.mockito:mockito-core:2.+"
   testCompile files(project(':geode-core').sourceSets.test.output)
-  // Extra proto source files for test besides the ones residing under
+compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
+// Extra proto source files for test besides the ones residing under
   // "src/test".
   //testProtobuf files("lib/protos-test.tar.gz")
+  testCompile 'com.pholser:junit-quickcheck-core:' + 
project.'junit-quickcheck.version'
+  testCompile 'com.pholser:junit-quickcheck-generators:' + 
project.'junit-quickcheck.version'
 }
 
 protobuf {

http://git-wip-us.apache.org/repos/asf/geode/blob/c1e22f37/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
--
diff --git 
a/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
 
b/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
new file mode 100644
index 000..8d65827
--- /dev/null
+++ 
b/geode-client-protobuf/src/main/java/org/apache/geode/protocol/client/EncodingTypeThingy.kt
@@ -0,0 +1,33 @@
+package org.apache.geode.protocol.client
+
+import org.apache.geode.pdx.JSONFormatter
+import org.apache.geode.pdx.PdxInstance
+import org.apache.geode.protocol.protobuf.BasicTypes
+import org.apache.geode.serialization.SerializationType
+
+fun getEncodingTypeForObjectKT(o: Any?): BasicTypes.EncodingType {
+return when (o) {
+is String -> BasicTypes.EncodingType.STRING
+is Int -> BasicTypes.EncodingType.INT
+is PdxInstance -> {
+if (o.className == JSONFormatter.JSON_CLASSNAME) 
BasicTypes.EncodingType.JSON else BasicTypes.EncodingType.UNRECOGNIZED
+}
+is ByteArray -> BasicTypes.EncodingType.BINARY
+else -> BasicTypes.EncodingType.UNRECOGNIZED
+}
+}
+
+fun serializerFromProtoEnum(encodingType: BasicTypes.EncodingType): 
SerializationType {
+return when (encodingType) {
+BasicTypes.EncodingType.INT -> SerializationType.INT
+BasicTypes.EncodingType.LONG -> SerializationType.LONG
+BasicTypes.EncodingType.SHORT -> SerializationTyp

geode git commit: GEODE-2964: add common-collections to gfsh dependencies

2017-05-23 Thread jinmeiliao
Repository: geode
Updated Branches:
  refs/heads/develop 456ee1576 -> f9099df50


GEODE-2964: add common-collections to gfsh dependencies


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

Branch: refs/heads/develop
Commit: f9099df50ae061a158a00f1c3a69327bbf583d1a
Parents: 456ee15
Author: Jinmei Liao 
Authored: Tue May 23 14:57:19 2017 -0700
Committer: Jinmei Liao 
Committed: Tue May 23 16:37:24 2017 -0700

--
 geode-assembly/build.gradle | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/f9099df5/geode-assembly/build.gradle
--
diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle
index a4f0c69..c308d30 100755
--- a/geode-assembly/build.gradle
+++ b/geode-assembly/build.gradle
@@ -131,12 +131,13 @@ def cp = {
 .join(' ')
 
   // then add all the dependencies of the dependent jars
-  jars += ' ' + configurations.archives.dependencies.collect { 
+  jars += ' ' + configurations.archives.dependencies.collect {
 it.dependencyProject.findAll { !(it.name.contains('web-api') || 
it.name.contains('pulse')) }
   .collect { it.configurations.runtime.collect { it.getName() }.findAll {
 // depedencies from geode-core
 it.contains('antlr') ||
 it.contains('commons-io') ||
+it.contains('commons-collections') ||
 it.contains('commons-lang') ||
 it.contains('commons-logging') ||
 it.contains('fast-classpath-scanner') ||



geode git commit: Start 1279

2017-05-23 Thread klund
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-1279 456ee1576 -> 10bc0d69e


Start 1279


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

Branch: refs/heads/feature/GEODE-1279
Commit: 10bc0d69e93a399e95c11db71d22401a4d097a2f
Parents: 456ee15
Author: Kirk Lund 
Authored: Tue May 23 15:45:12 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 15:46:22 2017 -0700

--
 .../apache/geode/cache30/Bug34387DUnitTest.java | 188 ---
 .../CreateAndDestroyKeyTXRegressionTest.java| 186 ++
 .../dunit/internal/DistributedTestFixture.java  |  16 +-
 .../internal/JUnit4DistributedTestCase.java |   2 +-
 4 files changed, 195 insertions(+), 197 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/10bc0d69/geode-core/src/test/java/org/apache/geode/cache30/Bug34387DUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache30/Bug34387DUnitTest.java 
b/geode-core/src/test/java/org/apache/geode/cache30/Bug34387DUnitTest.java
deleted file mode 100644
index d43be83..000
--- a/geode-core/src/test/java/org/apache/geode/cache30/Bug34387DUnitTest.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
- * agreements. See the NOTICE file distributed with this work for additional 
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the 
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-package org.apache.geode.cache30;
-
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-import org.apache.geode.cache.AttributesFactory;
-import org.apache.geode.cache.CacheException;
-import org.apache.geode.cache.CacheListener;
-import org.apache.geode.cache.CacheTransactionManager;
-import org.apache.geode.cache.DataPolicy;
-import org.apache.geode.cache.EntryEvent;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.Scope;
-import org.apache.geode.cache.UnsupportedOperationInTransactionException;
-import org.apache.geode.cache.util.CacheListenerAdapter;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.VM;
-
-/**
- * Test create + localDestroy for bug 34387
- *
- * @since GemFire 5.0
- */
-@Category(DistributedTest.class)
-public class Bug34387DUnitTest extends JUnit4CacheTestCase {
-
-  // private transient Region r;
-  // private transient DistributedMember otherId;
-  protected transient int invokeCount;
-
-  static volatile boolean callbackFailure;
-
-  public Bug34387DUnitTest() {
-super();
-  }
-
-  protected static void callbackAssertEquals(String message, Object expected, 
Object actual) {
-if (expected == null && actual == null)
-  return;
-if (expected != null && expected.equals(actual))
-  return;
-callbackFailure = true;
-// Throws an error that is ignored, but...
-assertEquals(message, expected, actual);
-  }
-
-
-  private VM getOtherVm() {
-Host host = Host.getHost(0);
-return host.getVM(0);
-  }
-
-  private void initOtherId() {
-VM vm = getOtherVm();
-vm.invoke(new CacheSerializableRunnable("Connect") {
-  public void run2() throws CacheException {
-getCache();
-  }
-});
-vm.invoke(() -> Bug34387DUnitTest.getVMDistributedMember());
-  }
-
-  private void doCommitOtherVm(final boolean doDestroy) {
-VM vm = getOtherVm();
-vm.invoke(new CacheSerializableRunnable("create root") {
-  public void run2() throws CacheException {
-AttributesFactory af = new AttributesFactory();
-af.setScope(Scope.DISTRIBUTED_ACK);
-af.setConcurrencyChecksEnabled

[geode] Git Push Summary

2017-05-23 Thread klund
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-1279 [created] 456ee1576


[32/33] geode git commit: Cleanup HARegionQueueJUnitTest and BlockingHARegionQueueJUnitTest

2017-05-23 Thread klund
Cleanup HARegionQueueJUnitTest and BlockingHARegionQueueJUnitTest


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 107d3c4bf362bd70b489ea78585919264c81dc82
Parents: d393b4a
Author: Kirk Lund 
Authored: Mon May 22 17:23:46 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:47:40 2017 -0700

--
 .../ha/BlockingHARegionQueueJUnitTest.java  |  169 +-
 .../cache/ha/HARegionQueueJUnitTest.java| 2307 +-
 2 files changed, 1167 insertions(+), 1309 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/107d3c4b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionQueueJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionQueueJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionQueueJUnitTest.java
index 39aa1e6..b529f0c 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionQueueJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionQueueJUnitTest.java
@@ -14,166 +14,141 @@
  */
 package org.apache.geode.internal.cache.ha;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
 
-import java.io.IOException;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.awaitility.Awaitility;
-
-import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.cache.CacheException;
 import org.apache.geode.internal.cache.Conflatable;
 import org.apache.geode.internal.cache.EventID;
+import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
 /**
  * Test runs all tests of HARegionQueueJUnitTest using BlockingHARegionQueue 
instead of
  * HARegionQueue.
- * 
- * 
  */
 @Category({IntegrationTest.class, ClientSubscriptionTest.class})
 public class BlockingHARegionQueueJUnitTest extends HARegionQueueJUnitTest {
 
-  /**
-   * Creates Blocking HA region-queue object
-   * 
-   * @return Blocking HA region-queue object
-   * @throws IOException
-   * @throws ClassNotFoundException
-   * @throws CacheException
-   * @throws InterruptedException
-   */
-  protected HARegionQueue createHARegionQueue(String name)
-  throws IOException, ClassNotFoundException, CacheException, 
InterruptedException {
-HARegionQueue regionqueue =
-HARegionQueue.getHARegionQueueInstance(name, cache, 
HARegionQueue.BLOCKING_HA_QUEUE, false);
-return regionqueue;
-  }
-
-  /**
-   * Creates Blocking HA region-queue object
-   * 
-   * @return Blocking HA region-queue object
-   * @throws IOException
-   * @throws ClassNotFoundException
-   * @throws CacheException
-   * @throws InterruptedException
-   */
-  protected HARegionQueue createHARegionQueue(String name, 
HARegionQueueAttributes attrs)
-  throws IOException, ClassNotFoundException, CacheException, 
InterruptedException {
-HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name, 
cache, attrs,
-HARegionQueue.BLOCKING_HA_QUEUE, false);
-return regionqueue;
+  @Override
+  protected int queueType() {
+return HARegionQueue.BLOCKING_HA_QUEUE;
   }
 
   /**
* Tests the effect of a put which is blocked because of capacity constraint 
& subsequent passage
* because of take operation
-   * 
*/
   @Test
-  public void testBlockingPutAndTake()
-  throws InterruptedException, IOException, ClassNotFoundException {
+  public void testBlockingPutAndTake() throws Exception {
 HARegionQueueAttributes hrqa = new HARegionQueueAttributes();
 hrqa.setBlockingQueueCapacity(1);
-final HARegionQueue hrq = 
this.createHARegionQueue("testBlockingPutAndTake", hrqa);
-hrq.setPrimary(true);// fix for 40314 - capacity constraint is checked for 
primary only.
+
+HARegionQueue hrq = createHARegionQueue(this.testName.getMethodName(), 
hrqa);
+hrq.setPrimary(true); // fix for 40314 - capacity constraint is checked 
for primary only.
+
 EventID id1 = new EventID(new byte[] {1}, 1, 1);
 hrq.put(new ConflatableObject("key1", "val1", id1, false, "testing"));
-Thread t1 = new Th

[25/33] geode git commit: Run spotlessApply

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/52d2e58d/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterDataSerializers.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterDataSerializers.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterDataSerializers.java
index d1c101f..053b2a8 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterDataSerializers.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterDataSerializers.java
@@ -41,7 +41,8 @@ public class RegisterDataSerializers extends BaseCommand {
   throws IOException, ClassNotFoundException {
 if (logger.isDebugEnabled()) {
   logger.debug("{}: Received register dataserializer request ({} parts) 
from {}",
-  serverConnection.getName(), clientMessage.getNumberOfParts(), 
serverConnection.getSocketString());
+  serverConnection.getName(), clientMessage.getNumberOfParts(),
+  serverConnection.getSocketString());
 }
 int noOfParts = clientMessage.getNumberOfParts();
 
@@ -49,10 +50,12 @@ public class RegisterDataSerializers extends BaseCommand {
 int noOfDataSerializers = (noOfParts - 1) / 2;
 
 // retrieve eventID from the last Part
-ByteBuffer eventIdPartsBuffer = 
ByteBuffer.wrap(clientMessage.getPart(noOfParts - 1).getSerializedForm());
+ByteBuffer eventIdPartsBuffer =
+ByteBuffer.wrap(clientMessage.getPart(noOfParts - 
1).getSerializedForm());
 long threadId = 
EventID.readEventIdPartsFromOptmizedByteArray(eventIdPartsBuffer);
 long sequenceId = 
EventID.readEventIdPartsFromOptmizedByteArray(eventIdPartsBuffer);
-EventID eventId = new 
EventID(serverConnection.getEventMemberIDByteArray(), threadId, sequenceId);
+EventID eventId =
+new EventID(serverConnection.getEventMemberIDByteArray(), threadId, 
sequenceId);
 
 byte[][] serializedDataSerializers = new byte[noOfDataSerializers * 2][];
 boolean caughtCNFE = false;
@@ -101,7 +104,8 @@ public class RegisterDataSerializers extends BaseCommand {
 }
 
 if (logger.isDebugEnabled()) {
-  logger.debug("Registered dataserializer for MembershipId = {}", 
serverConnection.getMembershipID());
+  logger.debug("Registered dataserializer for MembershipId = {}",
+  serverConnection.getMembershipID());
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/52d2e58d/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInstantiators.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInstantiators.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInstantiators.java
index 2b63337..df5a46c 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInstantiators.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInstantiators.java
@@ -53,7 +53,8 @@ public class RegisterInstantiators extends BaseCommand {
   throws IOException, ClassNotFoundException {
 if (logger.isDebugEnabled()) {
   logger.debug("{}: Received register instantiator request ({} parts) from 
{}",
-  serverConnection.getName(), clientMessage.getNumberOfParts(), 
serverConnection.getSocketString());
+  serverConnection.getName(), clientMessage.getNumberOfParts(),
+  serverConnection.getSocketString());
 }
 int noOfParts = clientMessage.getNumberOfParts();
 // Assert parts
@@ -62,10 +63,12 @@ public class RegisterInstantiators extends BaseCommand {
 int noOfInstantiators = (noOfParts - 1) / 3;
 
 // retrieve eventID from the last Part
-ByteBuffer eventIdPartsBuffer = 
ByteBuffer.wrap(clientMessage.getPart(noOfParts - 1).getSerializedForm());
+ByteBuffer eventIdPartsBuffer =
+ByteBuffer.wrap(clientMessage.getPart(noOfParts - 
1).getSerializedForm());
 long threadId = 
EventID.readEventIdPartsFromOptmizedByteArray(eventIdPartsBuffer);
 long sequenceId = 
EventID.readEventIdPartsFromOptmizedByteArray(eventIdPartsBuffer);
-EventID eventId = new 
EventID(serverConnection.getEventMemberIDByteArray(), threadId, sequenceId);
+EventID eventId =
+new EventID(serverConnection.getEventMemberIDByteArray(), threadId, 
sequenceId);
 
 byte[][] serializedInstantiators = new byte[noOfInstantiators * 3][];
 boolean caughtCNFE = false;
@@ -102,7 +105,7 @@ public class RegisterInstantiators extends BaseCommand {
   }
 } catch (Exception e) {
   
logger.warn(LocalizedMessage.create(LocalizedStrings.RegisterInstantiators_BAD_CLIENT,
-  new Object[

[29/33] geode git commit: Cleanup CacheClientUpdater

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/d393b4aa/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
index 7698550..8915c55 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
@@ -94,9 +94,9 @@ import 
org.apache.geode.security.AuthenticationRequiredException;
 import org.apache.geode.security.GemFireSecurityException;
 
 /**
- * CacheClientUpdater is a thread that processes update messages 
from a cache server
- * and {@linkplain org.apache.geode.cache.Region#localInvalidate(Object) 
invalidates} the local
- * cache based on the contents of those messages.
+ * {@code CacheClientUpdater} is a thread that processes update messages from 
a cache server and
+ * {@linkplain org.apache.geode.cache.Region#localInvalidate(Object) 
invalidates} the local cache
+ * based on the contents of those messages.
  * 
  * @since GemFire 3.5
  */
@@ -104,6 +104,8 @@ public class CacheClientUpdater extends Thread implements 
ClientUpdater, Disconn
 
   private static final Logger logger = LogService.getLogger();
 
+  private static final int DEFAULT_SOCKET_BUFFER_SIZE = 32768;
+
   /**
* true if the constructor successfully created a connection. If false, the 
run method for this
* thread immediately exits.
@@ -129,6 +131,7 @@ public class CacheClientUpdater extends Thread implements 
ClientUpdater, Disconn
* The input stream of the socket
*/
   private final InputStream in;
+
   /**
* Failed updater from the endpoint previously known as the primary
*/
@@ -139,12 +142,12 @@ public class CacheClientUpdater extends Thread implements 
ClientUpdater, Disconn
*/
   private final ByteBuffer commBuffer;
 
-  private boolean commBufferReleased;
+  private boolean commBufferReleased; // TODO: fix synchronization
 
   private final CCUStats stats;
 
   /**
-   * Cache for which we provide service
+   * Cache for which we provide service TODO: lifecycle and synchronization 
need work
*/
   private /* final */ InternalCache cache;
 
@@ -175,18 +178,18 @@ public class CacheClientUpdater extends Thread implements 
ClientUpdater, Disconn
*/
   private boolean isOpCompleted;
 
-  public final static String CLIENT_UPDATER_THREAD_NAME = "Cache Client 
Updater Thread ";
+  public static final String CLIENT_UPDATER_THREAD_NAME = "Cache Client 
Updater Thread ";
 
   /**
-   * to enable test flag
+   * to enable test flag TODO: eliminate isUsedByTest
*/
   public static boolean isUsedByTest;
 
   /**
* Indicates if full value was requested from server as a result of failure 
in applying delta
-   * bytes.
+   * bytes. TODO: only used for test assertion
*/
-  public static boolean fullValueRequested = false;
+  static boolean fullValueRequested = false;
 
   private final ServerLocation location;
 
@@ -195,8 +198,8 @@ public class CacheClientUpdater extends Thread implements 
ClientUpdater, Disconn
   private EndpointManager eManager = null;
   private Endpoint endpoint = null;
 
-  static private final long MAX_CACHE_WAIT = Long
-  .getLong(DistributionConfig.GEMFIRE_PREFIX + 
"CacheClientUpdater.MAX_WAIT", 120).longValue(); // seconds
+  private static final long MAX_CACHE_WAIT =
+  Long.getLong(DistributionConfig.GEMFIRE_PREFIX + 
"CacheClientUpdater.MAX_WAIT", 120); // seconds
 
   /**
* Return true if cache appears
@@ -231,7 +234,7 @@ public class CacheClientUpdater extends Thread implements 
ClientUpdater, Disconn
   boolean interrupted = Thread.interrupted();
   try {
 Thread.sleep(1000);
-  } catch (InterruptedException e) {
+  } catch (InterruptedException ignore) {
 interrupted = true;
   } finally {
 if (interrupted) {
@@ -245,12 +248,12 @@ public class CacheClientUpdater extends Thread implements 
ClientUpdater, Disconn
   }
 
   /**
-   * Creates a new CacheClientUpdater with a given name that 
waits for a server to
-   * connect on a given port.
+   * Creates a new {@code CacheClientUpdater} with a given name that waits for 
a server to connect
+   * on a given port.
*
* @param name descriptive name, used for our ThreadGroup
* @param location the endpoint we represent
-   * @param primary true if our endpoint is primary TODO ask the ep for this?
+   * @param primary true if our endpoint is primary
* @param ids the system we are distributing messages through
* 
* @throws AuthenticationRequiredException when client is not configured to 
send credentials using
@@ -265,6 +268,7 @@ public class CacheClientUpdater extends Thread impleme

[26/33] geode git commit: Run spotlessApply

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/52d2e58d/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
index 704f2da..d489b88 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
@@ -188,7 +188,7 @@ public class GatewayReceiverCommand extends BaseCommand {
 int dsid = clientMessage.getPart(partNumber++).getInt();
 
 boolean removeOnException =
-  clientMessage.getPart(partNumber++).getSerializedForm()[0] == 1 ? true : 
false;
+clientMessage.getPart(partNumber++).getSerializedForm()[0] == 1 ? true 
: false;
 
 // Keep track of whether a response has been written for
 // exceptions
@@ -218,8 +218,7 @@ public class GatewayReceiverCommand extends BaseCommand {
 } catch (Exception e) {
   logger.warn(LocalizedMessage.create(
   
LocalizedStrings.ProcessBatch_0_CAUGHT_EXCEPTION_PROCESSING_BATCH_REQUEST_1_CONTAINING_2_EVENTS,
-  new Object[] {
-serverConnection.getName(), Integer.valueOf(batchId),
+  new Object[] {serverConnection.getName(), 
Integer.valueOf(batchId),
   Integer.valueOf(numberOfEvents)}),
   e);
   throw e;
@@ -252,8 +251,7 @@ public class GatewayReceiverCommand extends BaseCommand {
 } catch (Exception e) {
   logger.warn(LocalizedMessage.create(
   
LocalizedStrings.ProcessBatch_0_CAUGHT_EXCEPTION_PROCESSING_BATCH_REQUEST_1_CONTAINING_2_EVENTS,
-  new Object[] {
-serverConnection.getName(), Integer.valueOf(batchId),
+  new Object[] {serverConnection.getName(), 
Integer.valueOf(batchId),
   Integer.valueOf(numberOfEvents)}),
   e);
   throw e;
@@ -266,8 +264,7 @@ public class GatewayReceiverCommand extends BaseCommand {
 } catch (Exception e) {
   logger.warn(LocalizedMessage.create(
   
LocalizedStrings.ProcessBatch_0_CAUGHT_EXCEPTION_PROCESSING_BATCH_REQUEST_1_CONTAINING_2_EVENTS,
-  new Object[] {
-serverConnection.getName(), Integer.valueOf(batchId),
+  new Object[] {serverConnection.getName(), 
Integer.valueOf(batchId),
   Integer.valueOf(numberOfEvents)}),
   e);
   throw e;
@@ -303,8 +300,7 @@ public class GatewayReceiverCommand extends BaseCommand {
   } catch (Exception e) {
 logger.warn(LocalizedMessage.create(
 
LocalizedStrings.ProcessBatch_0_CAUGHT_EXCEPTION_PROCESSING_BATCH_CREATE_REQUEST_1_FOR_2_EVENTS,
-new Object[] {
-  serverConnection.getName(), Integer.valueOf(batchId),
+new Object[] {serverConnection.getName(), 
Integer.valueOf(batchId),
 Integer.valueOf(numberOfEvents)}),
 e);
 throw e;
@@ -313,14 +309,15 @@ public class GatewayReceiverCommand extends BaseCommand {
 if (logger.isDebugEnabled()) {
   logger.debug(
   "{}: Processing batch create request {} on {} for region {} 
key {} value {} callbackArg {}, eventId={}",
-  serverConnection.getName(), batchId, 
serverConnection.getSocketString(), regionName, key,
-  valuePart, callbackArg, eventId);
+  serverConnection.getName(), batchId, 
serverConnection.getSocketString(),
+  regionName, key, valuePart, callbackArg, eventId);
 }
 versionTimeStamp = clientMessage.getPart(index++).getLong();
 // Process the create request
 if (key == null || regionName == null) {
   StringId message = null;
-  Object[] messageArgs = new Object[] { 
serverConnection.getName(), Integer.valueOf(batchId)};
+  Object[] messageArgs =
+  new Object[] {serverConnection.getName(), 
Integer.valueOf(batchId)};
   if (key == null) {
 message =
 
LocalizedStrings.ProcessBatch_0_THE_INPUT_REGION_NAME_FOR_THE_BATCH_CREATE_REQUEST_1_IS_NULL;
@@ -381,15 +378,13 @@ public class GatewayReceiverCommand extends BaseCommand {
   // This exception will be logged in the catch block below
   throw new Exception(
   
LocalizedStrings.ProcessBatch_0_FAILED_TO_CREATE_OR_UPDATE_ENTRY_FOR_REGION_1_KEY_2_VALUE_3_CALLBACKARG_4
-

[11/33] geode git commit: Cleanup CacheClientNotifier

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/c3d4687f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
index 75c89ab..8450db9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
@@ -1951,7 +1951,7 @@ public class CacheClientProxy implements ClientSession {
 
 // Close the proxy
 terminateDispatching(false);
-_cacheClientNotifier._statistics.incQueueDroppedCount();
+_cacheClientNotifier.statistics.incQueueDroppedCount();
 
 /**
  * Setting the expiration task to null again and cancelling existing 
one, if any. See
@@ -2850,7 +2850,7 @@ public class CacheClientProxy implements ClientSession {
   try {
 this._messageQueue.put(clientMessage);
 if (this._proxy.isPaused() && this._proxy.isDurable()) {
-  
this._proxy._cacheClientNotifier._statistics.incEventEnqueuedWhileClientAwayCount();
+  
this._proxy._cacheClientNotifier.statistics.incEventEnqueuedWhileClientAwayCount();
   if (logger.isDebugEnabled()) {
 logger.debug("{}: Queued message while Durable Client is away {}", 
this, clientMessage);
   }



[24/33] geode git commit: Cleanup Message class

2017-05-23 Thread klund
Cleanup Message class


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: d785ca31b2c3abb71ab37dee9fc2629eeaafa285
Parents: 52d2e58
Author: Kirk Lund 
Authored: Mon May 22 13:47:55 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:47:39 2017 -0700

--
 .../java/org/apache/geode/Instantiator.java | 112 ++--
 .../geode/cache/client/internal/AbstractOp.java |   2 +-
 .../geode/cache/client/internal/PingOp.java |  10 +-
 .../cache/tier/sockets/CacheClientUpdater.java  |  17 +-
 .../cache/tier/sockets/ChunkedMessage.java  |  19 +-
 .../internal/cache/tier/sockets/Message.java| 591 ++-
 .../cache/tier/sockets/ServerConnection.java|  65 +-
 .../apache/geode/internal/tcp/Connection.java   |   2 +-
 .../org/apache/geode/internal/util/IOUtils.java |   6 +-
 .../cache/tier/sockets/MessageJUnitTest.java|  64 +-
 .../internal/JUnit4DistributedTestCase.java |   2 +-
 ...arallelGatewaySenderOperationsDUnitTest.java |  16 +-
 12 files changed, 448 insertions(+), 458 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/d785ca31/geode-core/src/main/java/org/apache/geode/Instantiator.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/Instantiator.java 
b/geode-core/src/main/java/org/apache/geode/Instantiator.java
index 3c1ca06..c727e5b 100644
--- a/geode-core/src/main/java/org/apache/geode/Instantiator.java
+++ b/geode-core/src/main/java/org/apache/geode/Instantiator.java
@@ -20,15 +20,15 @@ import 
org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
 /**
- * Instantiator allows classes that implement {@link 
DataSerializable} to be registered
- * with the data serialization framework. Knowledge of 
DataSerializable classes allows
+ * {@code Instantiator} allows classes that implement {@link DataSerializable} 
to be registered
+ * with the data serialization framework. Knowledge of {@code 
DataSerializable} classes allows
  * the framework to optimize how instances of those classes are data 
serialized.
  *
  * 
  *
- * Ordinarily, when a DataSerializable object is written using
+ * Ordinarily, when a {@code DataSerializable} object is written using
  * {@link DataSerializer#writeObject(Object, java.io.DataOutput)}, a special 
marker class id is
- * written to the stream followed by the class name of the 
DataSerializable object.
+ * written to the stream followed by the class name of the {@code 
DataSerializable} object.
  * After the marker class id is read by {@link DataSerializer#readObject} it 
performs the following
  * operations,
  *
@@ -44,23 +44,20 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
  *
  * 
  *
- * However, if a DataSerializable class is {@linkplain 
#register(Instantiator)
+ * However, if a {@code DataSerializable} class is {@linkplain 
#register(Instantiator)
  * registered} with the data serialization framework and assigned a unique 
class id, an important
  * optimization can be performed that avoid the expense of using reflection to 
instantiate the
- * DataSerializable class. When the object is written using
+ * {@code DataSerializable} class. When the object is written using
  * {@link DataSerializer#writeObject(Object, java.io.DataOutput)}, the 
object's registered class id
  * is written to the stream. Consequently, when the data is read from the 
stream, the
- * {@link #newInstance} method of the appropriate Instantiator 
instance is invoked to
- * create an "empty" instance of the DataSerializable instead of 
using reflection to
+ * {@link #newInstance} method of the appropriate {@code Instantiator} 
instance is invoked to
+ * create an "empty" instance of the {@code DataSerializable} instead of using 
reflection to
  * create the new instance.
  *
  * 
  *
- * Commonly, a DataSerializable class will register itself with 
the
- * Instantiator in a static initializer as shown in the below 
example code.
- *
- * 
+ * Commonly, a {@code DataSerializable} class will register itself with the
+ * {@code Instantiator} in a static initializer as shown in the below example 
code.
  *
  * 
 public class User implements DataSerializable {
@@ -101,22 +98,22 @@ public class User implements DataSerializable {
 }
  * 
  *
- * Instantiators may be distributed to other members of the 
distributed system when
+ * {@code Instantiator}s may be distributed to other members of the 
distributed system when
  * they are registered. Consider the following scenario in which VM1 and VM2 
are members 

[21/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
index 9ed00be..f09c854 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
@@ -23,21 +23,20 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.Semaphore;
 import java.util.regex.Pattern;
 
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.CancelException;
 import org.apache.geode.CopyException;
 import org.apache.geode.InternalGemFireError;
 import org.apache.geode.SerializationException;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheLoaderException;
 import org.apache.geode.cache.CacheWriterException;
 import org.apache.geode.cache.InterestResultPolicy;
@@ -86,24 +85,12 @@ import org.apache.geode.security.GemFireSecurityException;
 public abstract class BaseCommand implements Command {
   protected static final Logger logger = LogService.getLogger();
 
-  /**
-   * Whether zipped values are being passed to/from the client. Can be 
modified using the system
-   * property Message.ZIP_VALUES ? This does not appear to happen anywhere
-   */
-  protected static final boolean zipValues = false;
-
-  protected static final boolean APPLY_RETRIES =
-  Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + 
"gateway.ApplyRetries");
-
-  public static final byte[] OK_BYTES = new byte[] {0};
-
-  public static final int maximumChunkSize =
-  Integer.getInteger("BridgeServer.MAXIMUM_CHUNK_SIZE", 100).intValue();
+  private static final byte[] OK_BYTES = new byte[] {0};
 
-  /** Maximum number of entries in each chunked response chunk */
+  public static final int MAXIMUM_CHUNK_SIZE = 
Integer.getInteger("BridgeServer.MAXIMUM_CHUNK_SIZE", 100);
 
   /** Whether to suppress logging of IOExceptions */
-  private static boolean suppressIOExceptionLogging =
+  private static final boolean SUPPRESS_IO_EXCEPTION_LOGGING =
   Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + 
"bridge.suppressIOExceptionLogging");
 
   /**
@@ -112,86 +99,88 @@ public abstract class BaseCommand implements Command {
* of them completes or fails. The bytes are computed based in the size sent 
in the incoming msg
* header.
*/
-  private static final int MAX_INCOMING_DATA =
-  Integer.getInteger("BridgeServer.MAX_INCOMING_DATA", -1).intValue();
+  private static final int MAX_INCOMING_DATA = 
Integer.getInteger("BridgeServer.MAX_INCOMING_DATA", -1);
 
   /**
* Maximum number of concurrent incoming client messages that a bridge 
server will allow. Once a
* server is working on this number additional incoming client messages will 
wait until one of
* them completes or fails.
*/
-  private static final int MAX_INCOMING_MSGS =
-  Integer.getInteger("BridgeServer.MAX_INCOMING_MSGS", -1).intValue();
+  private static final int MAX_INCOMING_MESSAGES = 
Integer.getInteger("BridgeServer.MAX_INCOMING_MSGS", -1);
 
-  private static final Semaphore incomingDataLimiter;
+  private static final Semaphore INCOMING_DATA_LIMITER;
+
+  private static final Semaphore INCOMING_MSG_LIMITER;
+
+  protected SecurityService securityService = 
IntegratedSecurityService.getSecurityService();
 
-  private static final Semaphore incomingMsgLimiter;
   static {
-Semaphore tmp;
+Semaphore semaphore;
 if (MAX_INCOMING_DATA > 0) {
   // backport requires that this is fair since we inc by values > 1
-  tmp = new Semaphore(MAX_INCOMING_DATA, true);
+  semaphore = new Semaphore(MAX_INCOMING_DATA, true);
 } else {
-  tmp = null;
+  semaphore = null;
 }
-incomingDataLimiter = tmp;
-if (MAX_INCOMING_MSGS > 0) {
-  tmp = new Semaphore(MAX_INCOMING_MSGS, false); // unfair for best
-  // performance
+INCOMING_DATA_LIMITER = semaphore;
+if (MAX_INCOMING_MESSAGES > 0) {
+  // unfair for best performance
+  semaphore = new Semaphore(MAX_INCOMING_MESSAGES, false);
 } else {
-  tmp = null;
+  semaphore = null;
 }
-incomingMsgLimiter = tmp;
-
+INCOMING_MSG_LIMITER = semaphore;
   }
 
-  protected SecurityService securityService = 
IntegratedSecurityService.getSecurityService();
+  protected static byte[] okBytes() {
+return OK_BYTES;
+  }
 
-  

[02/33] geode git commit: GEODE-269 : Removing deprecated API's from FunctionService.

2017-05-23 Thread klund
GEODE-269 :  Removing deprecated API's from FunctionService.

* Modified test cases after removing deprecated API's

This closes #526


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 18db4bf382ffbf16de04f5d3dc9462677af341e4
Parents: d88d2de
Author: Deepak Dixit 
Authored: Tue May 23 09:47:13 2017 +0530
Committer: nabarunnag 
Committed: Mon May 22 22:53:14 2017 -0700

--
 .../catalina/PeerToPeerSessionCache.java|  2 +-
 .../modules/util/BootstrappingFunction.java |  2 +-
 .../geode/cache/execute/FunctionService.java| 49 
 .../management/MemoryThresholdsDUnitTest.java   | 32 ++---
 .../ClassPathLoaderIntegrationTest.java |  6 +--
 .../geode/internal/cache/CommitFunction.java|  3 +-
 .../cache/RemoteTransactionDUnitTest.java   | 12 ++---
 .../geode/internal/cache/RollbackFunction.java  |  3 +-
 .../execute/FunctionServiceStatsDUnitTest.java  |  2 +-
 .../LocalFunctionExecutionDUnitTest.java|  4 +-
 .../MemberFunctionExecutionDUnitTest.java   | 33 +++--
 .../DeployCommandRedeployDUnitTest.java |  3 +-
 .../cli/commands/ShowDeadlockDUnitTest.java |  3 +-
 13 files changed, 49 insertions(+), 105 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/18db4bf3/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java
--
diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java
index 69d6ec0..f1afca3 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java
@@ -90,7 +90,7 @@ public class PeerToPeerSessionCache extends 
AbstractSessionCache {
   collector = execution.execute(TouchPartitionedRegionEntriesFunction.ID, 
true, false, true);
 } else {
   // Execute the member touch function on all the server(s)
-  Execution execution = 
FunctionService.onMembers(getCache().getDistributedSystem())
+  Execution execution = FunctionService.onMembers()
   .setArguments(new Object[] {this.sessionRegion.getFullPath(), 
sessionIds});
   collector = execution.execute(TouchReplicatedRegionEntriesFunction.ID, 
true, false, false);
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/18db4bf3/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
--
diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
index 64ecef3..a0e3e85 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
@@ -115,7 +115,7 @@ public class BootstrappingFunction implements Function, 
MembershipListener {
   private void bootstrapMember(InternalDistributedMember member) {
 // Create and execute the function
 Cache cache = CacheFactory.getAnyInstance();
-Execution execution = 
FunctionService.onMember(cache.getDistributedSystem(), member);
+Execution execution = FunctionService.onMember(member);
 ResultCollector collector = execution.execute(this);
 
 // Get the result. Nothing is being done with it.

http://git-wip-us.apache.org/repos/asf/geode/blob/18db4bf3/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionService.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionService.java 
b/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionService.java
index 8f64caf..8489275 100755
--- 
a/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionService.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionService.java
@@ -135,55 +135,6 @@ public class FunctionService {
 
   /**
* Returns an {@link Execution} object that can be used to execute a data 
independent function on
-   * a {@link DistributedMember} of the {@link DistributedSystem}. If the 
member is n

[07/33] geode git commit: GEODE-2943: Wildcard and space queries are now handled correctly

2017-05-23 Thread klund
GEODE-2943: Wildcard and space queries are now handled correctly


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: db028ac063a5701ea815ae58acbce269f1aa
Parents: 3cbb6fc
Author: Barry Oglesby 
Authored: Fri May 19 15:24:35 2017 -0700
Committer: Barry Oglesby 
Committed: Tue May 23 11:16:35 2017 -0700

--
 .../geode/internal/i18n/LocalizedStrings.java   |  2 ++
 .../lucene/internal/StringQueryProvider.java|  8 +++--
 .../cache/lucene/LuceneQueriesAccessorBase.java | 19 ++
 .../cache/lucene/LuceneQueriesDUnitTest.java| 37 
 .../cli/LuceneIndexCommandsDUnitTest.java   | 25 -
 5 files changed, 64 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/db028ac0/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java 
b/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
index 2fb8c8d..f19c4e7 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
@@ -7692,6 +7692,8 @@ public class LocalizedStrings {
   new StringId(6657, "Lucene index {0} on region {1} already exists.");
   public static final StringId 
LuceneIndexCreation_IGNORING_DUPLICATE_INDEX_CREATION_0_ON_REGION_1 =
   new StringId(6658, "Ignoring duplicate index creation for Lucene index 
{0} on region {1}");
+  public static final StringId 
StringQueryProvider_PARSING_QUERY_0_FAILED_DUE_TO_1 =
+  new StringId(6659, "Parsing query {0} failed due to: {1}");
 
   /** Testing strings, messageId 9-9 **/
 

http://git-wip-us.apache.org/repos/asf/geode/blob/db028ac0/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
--
diff --git 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
index 7b72748..82dd10f 100644
--- 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
+++ 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
@@ -19,6 +19,7 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.queryparser.flexible.core.QueryNodeException;
 import org.apache.lucene.queryparser.flexible.standard.StandardQueryParser;
@@ -69,14 +70,17 @@ public class StringQueryProvider implements 
LuceneQueryProvider, DataSerializabl
   String[] fields = index.getFieldNames();
   LuceneIndexImpl indexImpl = (LuceneIndexImpl) index;
   StandardQueryParser parser = new 
StandardQueryParser(indexImpl.getAnalyzer());
+  parser.setAllowLeadingWildcard(true);
   try {
 luceneQuery = parser.parse(query, defaultField);
 if (logger.isDebugEnabled()) {
   logger.debug("User query " + query + " is parsed to be: " + 
luceneQuery);
 }
   } catch (QueryNodeException e) {
-logger.debug("Query node exception:" + query, e);
-throw new LuceneQueryException("Malformed lucene query: " + query, e);
+logger.warn("Caught the following exception attempting parse query '" 
+ query + "': ", e);
+throw new LuceneQueryException(
+
LocalizedStrings.StringQueryProvider_PARSING_QUERY_0_FAILED_DUE_TO_1
+.toLocalizedString("'" + query + "'", e.getMessage()));
   }
 }
 return luceneQuery;

http://git-wip-us.apache.org/repos/asf/geode/blob/db028ac0/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
--
diff --git 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
index 9568ab8..86993da 100644
--- 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
+++ 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
@@ -22,6 +22,7 @@ import static 
org.apache.geode.cache.lucene.test.LuceneTestUtilities.RE

[22/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
Cleanup BaseCommand


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: fec1be9246ce2791841a8e8ebbf3dd1f7a8699f9
Parents: c3d4687
Author: Kirk Lund 
Authored: Fri May 19 14:57:20 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:47:38 2017 -0700

--
 .../java/org/apache/geode/GemFireException.java |  93 +--
 .../org/apache/geode/cache/CacheException.java  |  14 +-
 .../geode/cache/CacheRuntimeException.java  |  15 +-
 .../org/apache/geode/internal/DSFIDFactory.java |   2 +-
 .../geode/internal/cache/PartitionedRegion.java |   3 +-
 .../geode/internal/cache/ha/HARegionQueue.java  | 157 ++--
 .../geode/internal/cache/tier/Command.java  |  17 +-
 .../cache/tier/sockets/BaseCommand.java | 720 ---
 .../cache/tier/sockets/BaseCommandQuery.java|  20 +-
 .../cache/tier/sockets/CacheClientNotifier.java | 231 ++
 .../ServerInterestRegistrationMessage.java  | 120 
 .../cache/tier/sockets/command/AddPdxEnum.java  |  22 +-
 .../cache/tier/sockets/command/AddPdxType.java  |  22 +-
 .../cache/tier/sockets/command/ClearRegion.java |  52 +-
 .../cache/tier/sockets/command/ClientReady.java |  20 +-
 .../tier/sockets/command/CloseConnection.java   |  28 +-
 .../tier/sockets/command/CommitCommand.java |  24 +-
 .../cache/tier/sockets/command/ContainsKey.java |  46 +-
 .../tier/sockets/command/ContainsKey66.java |  48 +-
 .../tier/sockets/command/CreateRegion.java  |  44 +-
 .../cache/tier/sockets/command/Default.java |   9 +-
 .../cache/tier/sockets/command/Destroy.java |  74 +-
 .../cache/tier/sockets/command/Destroy65.java   | 102 +--
 .../cache/tier/sockets/command/Destroy70.java   |   4 +-
 .../tier/sockets/command/DestroyRegion.java |  75 +-
 .../tier/sockets/command/ExecuteFunction.java   |  26 +-
 .../tier/sockets/command/ExecuteFunction65.java |  30 +-
 .../tier/sockets/command/ExecuteFunction66.java |  40 +-
 .../tier/sockets/command/ExecuteFunction70.java |   4 +-
 .../sockets/command/ExecuteRegionFunction.java  |  36 +-
 .../command/ExecuteRegionFunction61.java|  40 +-
 .../command/ExecuteRegionFunction65.java|  40 +-
 .../command/ExecuteRegionFunction66.java|  44 +-
 .../command/ExecuteRegionFunctionSingleHop.java |  46 +-
 .../sockets/command/GatewayReceiverCommand.java | 214 +++---
 .../cache/tier/sockets/command/Get70.java   |  74 +-
 .../cache/tier/sockets/command/GetAll.java  |  52 +-
 .../cache/tier/sockets/command/GetAll651.java   |  53 +-
 .../cache/tier/sockets/command/GetAll70.java|  54 +-
 .../cache/tier/sockets/command/GetAllForRI.java |   2 +-
 .../sockets/command/GetAllWithCallback.java |  59 +-
 .../command/GetClientPRMetadataCommand.java |  26 +-
 .../command/GetClientPRMetadataCommand66.java   |  26 +-
 .../GetClientPartitionAttributesCommand.java|  28 +-
 .../GetClientPartitionAttributesCommand66.java  |  28 +-
 .../sockets/command/GetFunctionAttribute.java   |  16 +-
 .../tier/sockets/command/GetPDXEnumById.java|  24 +-
 .../tier/sockets/command/GetPDXIdForEnum.java   |  22 +-
 .../tier/sockets/command/GetPDXIdForType.java   |  24 +-
 .../tier/sockets/command/GetPDXTypeById.java|  24 +-
 .../tier/sockets/command/GetPdxEnums70.java |  22 +-
 .../tier/sockets/command/GetPdxTypes70.java |  22 +-
 .../cache/tier/sockets/command/Invalid.java |   9 +-
 .../cache/tier/sockets/command/Invalidate.java  |  74 +-
 .../tier/sockets/command/Invalidate70.java  |   4 +-
 .../cache/tier/sockets/command/KeySet.java  |  57 +-
 .../cache/tier/sockets/command/MakePrimary.java |  22 +-
 .../tier/sockets/command/ManagementCommand.java |   2 +-
 .../cache/tier/sockets/command/PeriodicAck.java |  32 +-
 .../cache/tier/sockets/command/Ping.java|  28 +-
 .../cache/tier/sockets/command/Put.java |  86 +--
 .../cache/tier/sockets/command/Put61.java   | 106 +--
 .../cache/tier/sockets/command/Put65.java   | 152 ++--
 .../cache/tier/sockets/command/Put70.java   |   4 +-
 .../cache/tier/sockets/command/PutAll.java  |  84 +--
 .../cache/tier/sockets/command/PutAll70.java|  98 +--
 .../cache/tier/sockets/command/PutAll80.java| 112 ++-
 .../sockets/command/PutUserCredentials.java |  32 +-
 .../cache/tier/sockets/command/Query.java   |  26 +-
 .../cache/tier/sockets/command/Query651.java|  41 +-
 .../command/RegisterDataSerializers.java|  30 +-
 .../sockets/command/RegisterInstantiators.java  |  36 +-
 .../tier/sockets/command/RegisterInterest.java  |  88 +--
 .../sockets/command/RegisterInterest61.java |  98 +--
 .../sockets/command/RegisterInterestList.java   |  88 +--
 .../sockets/command/Reg

[12/33] geode git commit: Cleanup CacheClientNotifier

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/c3d4687f/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
index e79bfbd..4bd4970 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
@@ -93,7 +93,6 @@ import org.apache.geode.internal.cache.ClientRegionEventImpl;
 import org.apache.geode.internal.cache.ClientServerObserver;
 import org.apache.geode.internal.cache.ClientServerObserverHolder;
 import org.apache.geode.internal.cache.Conflatable;
-import org.apache.geode.internal.cache.DistributedRegion;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.EnumListenerEvent;
 import org.apache.geode.internal.cache.EventID;
@@ -120,29 +119,158 @@ import 
org.apache.geode.security.AuthenticationFailedException;
 import org.apache.geode.security.AuthenticationRequiredException;
 
 /**
- * Class CacheClientNotifier works on the server and manages 
client socket connections
- * to clients requesting notification of updates and notifies them when 
updates occur.
+ * Class {@code CacheClientNotifier} works on the server and manages client 
socket connections to
+ * clients requesting notification of updates and notifies them when updates 
occur.
  *
  * @since GemFire 3.2
  */
-@SuppressWarnings({"synthetic-access", "deprecation"})
 public class CacheClientNotifier {
   private static final Logger logger = LogService.getLogger();
 
   private static volatile CacheClientNotifier ccnSingleton;
 
   /**
-   * Factory method to construct a CacheClientNotifier 
CacheClientNotifier instance.
+   * The map of known {@code CacheClientProxy} instances. Maps 
ClientProxyMembershipID to
+   * CacheClientProxy. Note that the keys in this map are not updated when a 
durable client
+   * reconnects. To make sure you get the updated ClientProxyMembershipID use 
this map to lookup the
+   * CacheClientProxy and then call getProxyID on it.
+   * 
+   * NOTE: package-private to avoid synthetic accessor
+   */
+  final ConcurrentMap/*  */ 
clientProxies =
+  new ConcurrentHashMap();
+
+  /**
+   * The map of {@code CacheClientProxy} instances which are getting 
initialized. Maps
+   * ClientProxyMembershipID to CacheClientProxy.
+   */
+  private final ConcurrentMap/*  */ 
initClientProxies =
+  new ConcurrentHashMap();
+
+  private final Set timedOutDurableClientProxies = 
new HashSet<>();
+
+  /**
+   * The GemFire {@code InternalCache}. Note that since this is a singleton 
class you should not use
+   * a direct reference to cache in CacheClientNotifier code. Instead, you 
should always use
+   * {@code getCache()}
+   */
+  private InternalCache cache; // TODO: fix synchronization of cache
+
+  private InternalLogWriter logWriter;
+
+  /**
+   * The GemFire security {@code LogWriter}
+   */
+  private InternalLogWriter securityLogWriter;
+
+  /** the maximum number of messages that can be enqueued in a client-queue. */
+  private final int maximumMessageCount;
+
+  /**
+   * the time (in seconds) after which a message in the client queue will 
expire.
+   */
+  private final int messageTimeToLive;
+
+  /**
+   * A listener which receives notifications about queues that are added or 
removed
+   */
+  private final ConnectionListener connectionListener;
+
+  private final CacheServerStats acceptorStats;
+
+  /**
+   * haContainer can hold either the name of the client-messages-region (in 
case of eviction
+   * policies "mem" or "entry") or an instance of HashMap (in case of eviction 
policy "none"). In
+   * both the cases, it'll store HAEventWrapper as its key and 
ClientUpdateMessage as its value.
+   */
+  private volatile HAContainerWrapper haContainer;
+
+  /**
+   * The size of the server-to-client communication socket buffers. This can 
be modified using the
+   * BridgeServer.SOCKET_BUFFER_SIZE system property.
+   */
+  private static final int socketBufferSize =
+  Integer.getInteger("BridgeServer.SOCKET_BUFFER_SIZE", 32768);
+
+  /**
+   * The statistics for this notifier
+   */
+  final CacheClientNotifierStats statistics; // TODO: pass statistics into 
CacheClientProxy then
+ // make private
+
+  /**
+   * The {@code InterestRegistrationListener} instances registered in this VM. 
This is used when
+   * modifying the set of listeners.
+   */
+  private final Set writableInterestRegistrationListeners = new 
CopyOnWriteArraySet();
+
+  /**
+   * The {@code InterestRegistrationListener} instances registered in this VM. 
This is used to
+   * provide a

[15/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInterest.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInterest.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInterest.java
index 52a929f..afb0f2c 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInterest.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RegisterInterest.java
@@ -46,51 +46,51 @@ public class RegisterInterest extends BaseCommand {
   }
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long start)
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long start)
   throws IOException, InterruptedException {
 Part regionNamePart = null, keyPart = null;
 String regionName = null;
 Object key = null;
-servConn.setAsTrue(REQUIRES_RESPONSE);
-servConn.setAsTrue(REQUIRES_CHUNKED_RESPONSE);
+serverConnection.setAsTrue(REQUIRES_RESPONSE);
+serverConnection.setAsTrue(REQUIRES_CHUNKED_RESPONSE);
 
 // bserverStats.incLong(readDestroyRequestTimeId,
 // DistributionStats.getStatTime() - start);
 // bserverStats.incInt(destroyRequestsId, 1);
 // start = DistributionStats.getStatTime();
 // Retrieve the data from the message parts
-regionNamePart = msg.getPart(0);
+regionNamePart = clientMessage.getPart(0);
 regionName = regionNamePart.getString();
 InterestResultPolicy policy = null;
 // Retrieve the interest type
-int interestType = msg.getPart(1).getInt();
+int interestType = clientMessage.getPart(1).getInt();
 
 // Retrieve the InterestResultPolicy
 try {
-  policy = (InterestResultPolicy) msg.getPart(2).getObject();
+  policy = (InterestResultPolicy) clientMessage.getPart(2).getObject();
 } catch (Exception e) {
-  writeChunkedException(msg, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeChunkedException(clientMessage, e, serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   return;
 }
 boolean isDurable = false;
 try {
-  Part durablePart = msg.getPart(3);
+  Part durablePart = clientMessage.getPart(3);
   byte[] durablePartBytes = (byte[]) durablePart.getObject();
   isDurable = durablePartBytes[0] == 0x01;
 } catch (Exception e) {
-  writeChunkedException(msg, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeChunkedException(clientMessage, e, serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   return;
 }
 // Retrieve the key
-keyPart = msg.getPart(4);
+keyPart = clientMessage.getPart(4);
 regionName = regionNamePart.getString();
 try {
   key = keyPart.getStringOrObject();
 } catch (Exception e) {
-  writeChunkedException(msg, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeChunkedException(clientMessage, e, serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   return;
 }
 
@@ -98,21 +98,21 @@ public class RegisterInterest extends BaseCommand {
 
 // VJR: Check for a sixth part for client version 6.0.3 onwards for the
 // time being until refactoring into a new command version.
-if (msg.getNumberOfParts() > 5) {
+if (clientMessage.getNumberOfParts() > 5) {
   try {
-Part notifyPart = msg.getPart(5);
+Part notifyPart = clientMessage.getPart(5);
 byte[] notifyPartBytes = (byte[]) notifyPart.getObject();
 sendUpdatesAsInvalidates = notifyPartBytes[0] == 0x01;
   } catch (Exception e) {
-writeChunkedException(msg, e, false, servConn);
-servConn.setAsTrue(RESPONDED);
+writeChunkedException(clientMessage, e, serverConnection);
+serverConnection.setAsTrue(RESPONDED);
 return;
   }
 }
 
 if (logger.isDebugEnabled()) {
   logger.debug("{}: Received register interest request ({} bytes) from {} 
for region {} key {}",
-  servConn.getName(), msg.getPayloadLength(), 
servConn.getSocketString(), regionName, key);
+  serverConnection.getName(), clientMessage.getPayloadLength(), 
serverConnection.getSocketString(), regionName, key);
 }
 
 // Process the register interest request
@@ -126,19 +126,19 @@ public class RegisterInterest extends BaseCommand {
 message =
 
LocalizedStrings.RegisterInterest_THE_INPUT_REGION_NAME_FOR_THE_REGISTER_INTEREST_REQUEST_IS_NULL;
   }
-  logger.warn("{}: {}", servConn.getName(), message.toLocalizedString());
-  writeChunkedErrorResponse(msg, MessageType.REGISTER_INTEREST_DATA_ERROR,
-  message.toLocalizedString(), servConn);
-  servConn.s

[33/33] geode git commit: Do NOT close HeapDataOutputStream that is passed to Part

2017-05-23 Thread klund
Do NOT close HeapDataOutputStream that is passed to Part


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 47c372f21999c442deeea4184ad135662e1d8ac4
Parents: 107d3c4
Author: Kirk Lund 
Authored: Tue May 23 14:46:34 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 15:38:52 2017 -0700

--
 .../internal/cache/tier/sockets/Message.java| 53 +++-
 1 file changed, 18 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/47c372f2/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
index 2ac6fea..1f9ef91 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
@@ -14,8 +14,6 @@
  */
 package org.apache.geode.internal.cache.tier.sockets;
 
-import static org.apache.geode.internal.util.IOUtils.close;
-
 import org.apache.geode.SerializationException;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.Assert;
@@ -111,26 +109,20 @@ public class Message {
   private static final byte[] FALSE = defineFalse();
 
   private static byte[] defineTrue() {
-HeapDataOutputStream hdos = new HeapDataOutputStream(10, null);
-try {
+try (HeapDataOutputStream hdos = new HeapDataOutputStream(10, null)) {
   BlobHelper.serializeTo(Boolean.TRUE, hdos);
   return hdos.toByteArray();
 } catch (IOException e) {
   throw new IllegalStateException(e);
-} finally {
-  close(hdos);
 }
   }
 
   private static byte[] defineFalse() {
-HeapDataOutputStream hdos = new HeapDataOutputStream(10, null);
-try {
+try (HeapDataOutputStream hdos = new HeapDataOutputStream(10, null)) {
   BlobHelper.serializeTo(Boolean.FALSE, hdos);
   return hdos.toByteArray();
 } catch (IOException e) {
   throw new IllegalStateException(e);
-} finally {
-  close(hdos);
 }
   }
 
@@ -288,23 +280,17 @@ public class Message {
 if (enableCaching) {
   byte[] bytes = CACHED_STRINGS.get(str);
   if (bytes == null) {
-HeapDataOutputStream hdos = new HeapDataOutputStream(str);
-try {
+try (HeapDataOutputStream hdos = new HeapDataOutputStream(str)) {
   bytes = hdos.toByteArray();
   CACHED_STRINGS.put(str, bytes);
-} finally {
-  close(hdos);
 }
   }
   part.setPartState(bytes, false);
+
 } else {
-  HeapDataOutputStream hdos = new HeapDataOutputStream(str);
-  try {
-this.messageModified = true;
-part.setPartState(hdos, false);
-  } finally {
-close(hdos);
-  }
+  // do NOT close the HeapDataOutputStream
+  this.messageModified = true;
+  part.setPartState(new HeapDataOutputStream(str), false);
 }
 this.currentPart++;
   }
@@ -380,20 +366,18 @@ public class Message {
   v = null;
 }
 
-// create the HDOS with a flag telling it that it can keep any byte[] or 
ByteBuffers/ByteSources
-// passed to it.
+// Create the HDOS with a flag telling it that it can keep any byte[] or 
ByteBuffers/ByteSources
+// passed to it. Do NOT close the HeapDataOutputStream!
 HeapDataOutputStream hdos = new HeapDataOutputStream(this.chunkSize, v, 
true);
 try {
   BlobHelper.serializeTo(o, hdos);
-  this.messageModified = true;
-  Part part = this.partsList[this.currentPart];
-  part.setPartState(hdos, true);
-  this.currentPart++;
 } catch (IOException ex) {
   throw new SerializationException("failed serializing object", ex);
-} finally {
-  close(hdos);
 }
+this.messageModified = true;
+Part part = this.partsList[this.currentPart];
+part.setPartState(hdos, true);
+this.currentPart++;
   }
 
   private void serializeAndAddPart(Object o, boolean zipValues) {
@@ -406,18 +390,17 @@ public class Message {
   v = null;
 }
 
+// do NOT close the HeapDataOutputStream
 HeapDataOutputStream hdos = new HeapDataOutputStream(this.chunkSize, v);
 try {
   BlobHelper.serializeTo(o, hdos);
-  this.messageModified = true;
-  Part part = this.partsList[this.currentPart];
-  part.setPartState(hdos, true);
-  this.currentPart++;
 } catch (IOException ex) {
 

[14/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RollbackCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RollbackCommand.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RollbackCommand.java
index a579170..cd12ea7 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RollbackCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/RollbackCommand.java
@@ -39,18 +39,18 @@ public class RollbackCommand extends BaseCommand {
   private RollbackCommand() {}
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long start)
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long start)
   throws IOException, ClassNotFoundException, InterruptedException {
-servConn.setAsTrue(REQUIRES_RESPONSE);
-TXManagerImpl txMgr = (TXManagerImpl) 
servConn.getCache().getCacheTransactionManager();
+serverConnection.setAsTrue(REQUIRES_RESPONSE);
+TXManagerImpl txMgr = (TXManagerImpl) 
serverConnection.getCache().getCacheTransactionManager();
 InternalDistributedMember client =
-(InternalDistributedMember) 
servConn.getProxyID().getDistributedMember();
-int uniqId = msg.getTransactionId();
+(InternalDistributedMember) 
serverConnection.getProxyID().getDistributedMember();
+int uniqId = clientMessage.getTransactionId();
 TXId txId = new TXId(client, uniqId);
 if (txMgr.isHostedTxRecentlyCompleted(txId)) {
   if (logger.isDebugEnabled()) {
 logger.debug("TX: found a recently rolled back tx: {}", txId);
-sendRollbackReply(msg, servConn);
+sendRollbackReply(clientMessage, serverConnection);
 txMgr.removeHostedTXState(txId);
 return;
   }
@@ -60,16 +60,16 @@ public class RollbackCommand extends BaseCommand {
   if (txState != null) {
 txId = txState.getTxId();
 txMgr.rollback();
-sendRollbackReply(msg, servConn);
+sendRollbackReply(clientMessage, serverConnection);
   } else {
 // could not find TxState in the host server.
 // Protect against a failover command received so late,
 // and it is removed from the failoverMap due to capacity.
-sendRollbackReply(msg, servConn);
+sendRollbackReply(clientMessage, serverConnection);
   }
 } catch (Exception e) {
-  writeException(msg, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeException(clientMessage, e, false, serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
 } finally {
   if (logger.isDebugEnabled()) {
 logger.debug("TX: removing tx state for {}", txId);

http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Size.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Size.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Size.java
index c78f4d9..42e14a3 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Size.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Size.java
@@ -56,18 +56,18 @@ public class Size extends BaseCommand {
   }
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long start)
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long start)
   throws IOException, InterruptedException {
 StringBuilder errMessage = new StringBuilder();
-CachedRegionHelper crHelper = servConn.getCachedRegionHelper();
-CacheServerStats stats = servConn.getCacheServerStats();
-servConn.setAsTrue(REQUIRES_RESPONSE);
+CachedRegionHelper crHelper = serverConnection.getCachedRegionHelper();
+CacheServerStats stats = serverConnection.getCacheServerStats();
+serverConnection.setAsTrue(REQUIRES_RESPONSE);
 
 long oldStart = start;
 start = DistributionStats.getStatTime();
 stats.incReadSizeRequestTime(start - oldStart);
 // Retrieve the data from the message parts
-Part regionNamePart = msg.getPart(0);
+Part regionNamePart = clientMessage.getPart(0);
 String regionName = regionNamePart.getString();
 
 if (regionName == null) {
@@ -76,8 +76,8 @@ public class Size extends BaseCommand {
   errMessage
   
.append(LocalizedStrings.BaseCommand__THE_INPUT_REGION_NAME_FOR_THE_0_REQUEST_IS_NULL
   .toLocalizedString("size"));
-  writeErrorResponse(msg, MessageType.SIZE_ERROR, errMessage.toString(), 
servConn);
- 

[20/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
index 4bd4970..5631184 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
@@ -17,9 +17,7 @@ package org.apache.geode.internal.cache.tier.sockets;
 import static org.apache.geode.distributed.ConfigurationProperties.*;
 
 import java.io.BufferedOutputStream;
-import java.io.DataInput;
 import java.io.DataInputStream;
-import java.io.DataOutput;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.lang.reflect.Method;
@@ -70,12 +68,7 @@ import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.distributed.internal.HighPriorityDistributionMessage;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.distributed.internal.MessageWithReply;
-import org.apache.geode.distributed.internal.ReplyMessage;
-import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.internal.ClassLoadUtil;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.statistics.DummyStatisticsFactory;
@@ -127,6 +120,22 @@ import 
org.apache.geode.security.AuthenticationRequiredException;
 public class CacheClientNotifier {
   private static final Logger logger = LogService.getLogger();
 
+  /**
+   * The size of the server-to-client communication socket buffers. This can 
be modified using the
+   * BridgeServer.SOCKET_BUFFER_SIZE system property.
+   */
+  private static final int socketBufferSize =
+Integer.getInteger("BridgeServer.SOCKET_BUFFER_SIZE", 32768);
+
+  private static final long CLIENT_PING_TASK_PERIOD =
+Long.getLong(DistributionConfig.GEMFIRE_PREFIX + 
"serverToClientPingPeriod", 6);
+
+  /**
+   * package-private to avoid synthetic accessor
+   */
+  static final long CLIENT_PING_TASK_COUNTER =
+Long.getLong(DistributionConfig.GEMFIRE_PREFIX + 
"serverToClientPingCounter", 3);
+
   private static volatile CacheClientNotifier ccnSingleton;
 
   /**
@@ -149,20 +158,6 @@ public class CacheClientNotifier {
 
   private final Set timedOutDurableClientProxies = 
new HashSet<>();
 
-  /**
-   * The GemFire {@code InternalCache}. Note that since this is a singleton 
class you should not use
-   * a direct reference to cache in CacheClientNotifier code. Instead, you 
should always use
-   * {@code getCache()}
-   */
-  private InternalCache cache; // TODO: fix synchronization of cache
-
-  private InternalLogWriter logWriter;
-
-  /**
-   * The GemFire security {@code LogWriter}
-   */
-  private InternalLogWriter securityLogWriter;
-
   /** the maximum number of messages that can be enqueued in a client-queue. */
   private final int maximumMessageCount;
 
@@ -179,24 +174,9 @@ public class CacheClientNotifier {
   private final CacheServerStats acceptorStats;
 
   /**
-   * haContainer can hold either the name of the client-messages-region (in 
case of eviction
-   * policies "mem" or "entry") or an instance of HashMap (in case of eviction 
policy "none"). In
-   * both the cases, it'll store HAEventWrapper as its key and 
ClientUpdateMessage as its value.
-   */
-  private volatile HAContainerWrapper haContainer;
-
-  /**
-   * The size of the server-to-client communication socket buffers. This can 
be modified using the
-   * BridgeServer.SOCKET_BUFFER_SIZE system property.
-   */
-  private static final int socketBufferSize =
-  Integer.getInteger("BridgeServer.SOCKET_BUFFER_SIZE", 32768);
-
-  /**
* The statistics for this notifier
*/
-  final CacheClientNotifierStats statistics; // TODO: pass statistics into 
CacheClientProxy then
- // make private
+  final CacheClientNotifierStats statistics; // TODO: pass statistics into 
CacheClientProxy
 
   /**
* The {@code InterestRegistrationListener} instances registered in this VM. 
This is used when
@@ -209,55 +189,41 @@ public class CacheClientNotifier {
* provide a read-only {@code Set} of listeners.
*/
   private final Set readableInterestRegistrationListeners =
-  Collections.unmodifiableSet(this.writableInterestRegistrationListeners);
-
-  /**
-   * System property name for indicating how much frequently the "Queue full" 
message 

[23/33] geode git commit: Add ServerLauncherUtils and CacheServerUtils

2017-05-23 Thread klund
Add ServerLauncherUtils and CacheServerUtils


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: f4e93f8c175f53e34206d3bf99a4da499e8a0797
Parents: fec1be9
Author: Kirk Lund 
Authored: Fri May 19 14:57:44 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:47:38 2017 -0700

--
 .../geode/distributed/ServerLauncherUtils.java  | 30 +++
 .../cache/tier/sockets/CacheServerUtils.java| 55 
 2 files changed, 85 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/f4e93f8c/geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherUtils.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherUtils.java
 
b/geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherUtils.java
new file mode 100644
index 000..017e0f5
--- /dev/null
+++ 
b/geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherUtils.java
@@ -0,0 +1,30 @@
+/*
+ * 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.distributed;
+
+import org.apache.geode.cache.Cache;
+
+/**
+ * Provides tests a way to access non-public state in ServerLauncher
+ */
+public class ServerLauncherUtils {
+
+  /**
+   * Returns the Cache from an online in-process ServerLauncher instance
+   */
+  public static Cache getCache(final ServerLauncher serverLauncher) {
+return serverLauncher.getCache();
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/f4e93f8c/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/CacheServerUtils.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/CacheServerUtils.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/CacheServerUtils.java
new file mode 100644
index 000..8cd7622
--- /dev/null
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/CacheServerUtils.java
@@ -0,0 +1,55 @@
+/*
+ * 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.cache.tier.sockets;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.server.CacheServer;
+import org.apache.geode.internal.cache.CacheServerImpl;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Provides tests a way to access CacheServer, AcceptorImpl and 
ServerConnection
+ */
+public class CacheServerUtils {
+
+  /**
+   * Returns single CacheServer for the specified Cache instance
+   */
+  public static CacheServer getCacheServer(final Cache cache) {
+List cacheServers = cache.getCacheServers();
+CacheServer cacheServer = cacheServers.get(0);
+return cacheServer;
+  }
+
+  /**
+   * Returns AcceptorImpl for the specified CacheServer instance
+   */
+  public static AcceptorImpl getAcceptorImpl(final CacheServer cacheServer) {
+AcceptorImpl acceptor = ((CacheServerImpl) cacheServer).getAcceptor();
+return acceptor;
+  }
+
+  /**
+   * Returns single ServerConnection

[05/33] geode git commit: GEODE-2420: Renamed methods that had signatures changed

2017-05-23 Thread klund
GEODE-2420: Renamed methods that had signatures changed

Updated javadocs for the renamed methods to explicitly call out the
exceptions thrown


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: adbdf50f1a5986e5c75b47184f547a3e0d78f0e2
Parents: c5962aa
Author: Ken Howe 
Authored: Tue May 23 09:40:27 2017 -0700
Committer: Ken Howe 
Committed: Tue May 23 09:42:36 2017 -0700

--
 .../internal/cli/commands/ExportLogsCommand.java   | 17 +
 .../cli/commands/ExportLogsCommandTest.java|  9 -
 .../cli/commands/ExportLogsFileSizeLimitTest.java  |  7 +++
 3 files changed, 16 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/adbdf50f/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
index ab93f94..b824bc9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
@@ -142,7 +142,7 @@ public class ExportLogsCommand implements CommandMarker {
 // The sum of the estimated export sizes from each member should not 
exceed the
 // disk available on the locator
 try {
-  sizeCheckIsEnabledAndWithinDiskSpaceOfMember("locator", 
parseFileSizeLimit(fileSizeLimit),
+  checkIfExportLogsOverflowsDisk("locator", 
parseFileSizeLimit(fileSizeLimit),
   totalEstimatedExportSize, getLocalDiskAvailable());
 } catch (ManagementException e) {
   return ResultBuilder.createUserErrorResult(e.getMessage());
@@ -201,8 +201,7 @@ public class ExportLogsCommand implements CommandMarker {
   logger.info("Zipping into: " + exportedLogsZipFile.toString());
   ZipUtils.zipDirectory(exportedLogsDir, exportedLogsZipFile);
   try {
-isFileSizeCheckEnabledAndWithinLimit(parseFileSizeLimit(fileSizeLimit),
-exportedLogsZipFile.toFile());
+checkFileSizeWithinLimit(parseFileSizeLimit(fileSizeLimit), 
exportedLogsZipFile.toFile());
   } catch (ManagementException e) {
 FileUtils.deleteQuietly(exportedLogsZipFile.toFile());
 return ResultBuilder.createUserErrorResult(e.getMessage());
@@ -263,9 +262,10 @@ public class ExportLogsCommand implements CommandMarker {
   }
 
   /**
-   * Throws ManagementException if file size is over fileSizeLimit bytes
+   * @throws ManagementException if checking is enabled (fileSizeLimit > 0) 
and file size is over
+   * fileSizeLimit bytes
*/
-  void isFileSizeCheckEnabledAndWithinLimit(long fileSizeLimitBytes, File 
file) {
+  void checkFileSizeWithinLimit(long fileSizeLimitBytes, File file) {
 if (fileSizeLimitBytes > 0) {
   if (FileUtils.sizeOf(file) > fileSizeLimitBytes) {
 StringBuilder sb = new StringBuilder();
@@ -280,10 +280,11 @@ public class ExportLogsCommand implements CommandMarker {
 
 
   /**
-   * Throws ManagementException if export file size checking is enabled and 
the space required on a
-   * cluster member to filter and zip up files to be exported exceeds the disk 
space available
+   * @throws ManagementException if export file size checking is enabled 
(fileSizeLimit > 0) and the
+   * space required on a cluster member to filter and zip up files to 
be exported exceeds
+   * the disk space available
*/
-  void sizeCheckIsEnabledAndWithinDiskSpaceOfMember(String memberName, long 
fileSizeLimitBytes,
+  void checkIfExportLogsOverflowsDisk(String memberName, long 
fileSizeLimitBytes,
   long estimatedSize, long diskAvailable) {
 if (fileSizeLimitBytes > 0) {
   StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/geode/blob/adbdf50f/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
index a91..16549e7 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
+

[27/33] geode git commit: Run spotlessApply

2017-05-23 Thread klund
Run spotlessApply


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 52d2e58da1e7efaf0457ea9fb0489d2c285229ba
Parents: f4e93f8
Author: Kirk Lund 
Authored: Fri May 19 15:23:12 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:47:39 2017 -0700

--
 .../java/org/apache/geode/GemFireException.java |   7 +-
 .../geode/cache/CacheRuntimeException.java  |   4 +-
 .../geode/internal/cache/ha/HARegionQueue.java  |  18 +--
 .../cache/tier/sockets/BaseCommand.java | 152 ---
 .../cache/tier/sockets/CacheClientNotifier.java |   8 +-
 .../ServerInterestRegistrationMessage.java  |  31 ++--
 .../cache/tier/sockets/command/AddPdxEnum.java  |   3 +-
 .../cache/tier/sockets/command/AddPdxType.java  |   3 +-
 .../cache/tier/sockets/command/ClearRegion.java |  14 +-
 .../cache/tier/sockets/command/ClientReady.java |  12 +-
 .../tier/sockets/command/CloseConnection.java   |  11 +-
 .../tier/sockets/command/CommitCommand.java |   3 +-
 .../cache/tier/sockets/command/ContainsKey.java |   9 +-
 .../tier/sockets/command/ContainsKey66.java |   9 +-
 .../tier/sockets/command/CreateRegion.java  |  10 +-
 .../cache/tier/sockets/command/Default.java |  10 +-
 .../cache/tier/sockets/command/Destroy.java |  15 +-
 .../cache/tier/sockets/command/Destroy65.java   |  34 +++--
 .../tier/sockets/command/DestroyRegion.java |  11 +-
 .../tier/sockets/command/ExecuteFunction.java   |   3 +-
 .../tier/sockets/command/ExecuteFunction65.java |   3 +-
 .../tier/sockets/command/ExecuteFunction66.java |   3 +-
 .../tier/sockets/command/ExecuteFunction70.java |   3 +-
 .../sockets/command/ExecuteRegionFunction.java  |   3 +-
 .../command/ExecuteRegionFunction61.java|   3 +-
 .../command/ExecuteRegionFunction65.java|   3 +-
 .../command/ExecuteRegionFunction66.java|   3 +-
 .../command/ExecuteRegionFunctionSingleHop.java |   3 +-
 .../sockets/command/GatewayReceiverCommand.java |  85 +--
 .../cache/tier/sockets/command/Get70.java   |  14 +-
 .../cache/tier/sockets/command/GetAll.java  |   8 +-
 .../cache/tier/sockets/command/GetAll651.java   |   8 +-
 .../cache/tier/sockets/command/GetAll70.java|  11 +-
 .../sockets/command/GetAllWithCallback.java |  11 +-
 .../command/GetClientPRMetadataCommand.java |   6 +-
 .../command/GetClientPRMetadataCommand66.java   |   6 +-
 .../sockets/command/GetFunctionAttribute.java   |   3 +-
 .../tier/sockets/command/GetPDXEnumById.java|   5 +-
 .../tier/sockets/command/GetPDXIdForEnum.java   |   3 +-
 .../tier/sockets/command/GetPDXIdForType.java   |   3 +-
 .../tier/sockets/command/GetPDXTypeById.java|   5 +-
 .../cache/tier/sockets/command/Invalid.java |   7 +-
 .../cache/tier/sockets/command/Invalidate.java  |  18 ++-
 .../cache/tier/sockets/command/KeySet.java  |  12 +-
 .../cache/tier/sockets/command/MakePrimary.java |   7 +-
 .../cache/tier/sockets/command/PeriodicAck.java |   5 +-
 .../cache/tier/sockets/command/Ping.java|  11 +-
 .../cache/tier/sockets/command/Put.java |  25 +--
 .../cache/tier/sockets/command/Put61.java   |  20 ++-
 .../cache/tier/sockets/command/Put65.java   |  35 +++--
 .../cache/tier/sockets/command/PutAll.java  |  23 ++-
 .../cache/tier/sockets/command/PutAll70.java|  31 ++--
 .../cache/tier/sockets/command/PutAll80.java|  35 +++--
 .../sockets/command/PutUserCredentials.java |   9 +-
 .../cache/tier/sockets/command/Query.java   |   3 +-
 .../cache/tier/sockets/command/Query651.java|  12 +-
 .../command/RegisterDataSerializers.java|  12 +-
 .../sockets/command/RegisterInstantiators.java  |  14 +-
 .../tier/sockets/command/RegisterInterest.java  |  21 +--
 .../sockets/command/RegisterInterest61.java |  19 +--
 .../sockets/command/RegisterInterestList.java   |  18 ++-
 .../sockets/command/RegisterInterestList61.java |  18 ++-
 .../sockets/command/RegisterInterestList66.java |  15 +-
 .../cache/tier/sockets/command/RemoveAll.java   |  36 +++--
 .../tier/sockets/command/RemoveUserAuth.java|   4 +-
 .../cache/tier/sockets/command/Request.java |  14 +-
 .../tier/sockets/command/RequestEventValue.java |  20 ++-
 .../cache/tier/sockets/command/Size.java|   6 +-
 .../command/TXSynchronizationCommand.java   |  13 +-
 .../sockets/command/UnregisterInterest.java |  14 +-
 .../sockets/command/UnregisterInterestList.java |  11 +-
 .../command/UpdateClientNotification.java   |   3 +-
 .../cache/tier/sockets/command/CloseCQ.java |  16 +-
 .../cache/tier/sockets/command/ExecuteCQ.java   |  13 +-
 .../cache/tier/sockets/command/ExecuteCQ61.java |  16 +-
 .../cache/tier

[09/33] geode git commit: GEODE-2967: ResultCollection instead of StructCollection

2017-05-23 Thread klund
GEODE-2967: ResultCollection instead of StructCollection

* If we have one runtime iterator which is in case of self joins, 
ResultSet or ResultBags are created
* Otherwise StructBag or StructSets are used


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 9c408681364973096cf4192255ec3f40d86b70bd
Parents: db81d92
Author: nabarun 
Authored: Mon May 22 11:34:52 2017 -0700
Committer: nabarun 
Committed: Tue May 23 13:50:49 2017 -0700

--
 .../geode/cache/query/internal/QueryUtils.java  | 21 +
 .../query/internal/index/IndexUseJUnitTest.java | 47 +++-
 2 files changed, 58 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/9c408681/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
index bb0cbea..4d43729 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
@@ -23,6 +23,7 @@ import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.geode.cache.query.internal.types.ObjectTypeImpl;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.query.AmbiguousNameException;
@@ -806,8 +807,6 @@ public class QueryUtils {
* 
*/
   static StructType createStructTypeForRuntimeIterators(List runTimeIterators) 
{
-Support.Assert(runTimeIterators.size() > 1,
-"The number of Iterators passed should be greater than 1 to create a 
structSet");
 int len = runTimeIterators.size();
 String[] fieldNames = new String[len];
 String[] indexAlternativeFieldNames = new String[len];
@@ -886,10 +885,9 @@ public class QueryUtils {
   }
   return null;
 }
-
-Index lhsIndx = lhsIndxData.getIndex();
-Index rhsIndx = rhsIndxData.getIndex();
-if (((IndexProtocol) lhsIndx).isValid() && ((IndexProtocol) 
rhsIndx).isValid()) {
+IndexProtocol lhsIndx = lhsIndxData.getIndex();
+IndexProtocol rhsIndx = rhsIndxData.getIndex();
+if (lhsIndx.isValid() && rhsIndx.isValid()) {
   return new IndexData[] {lhsIndxData, rhsIndxData};
 }
 return null;
@@ -1463,10 +1461,15 @@ public class QueryUtils {
 }
   }
 }
-Support.Assert(totalFinalList.size() > 1,
-" Since we are in relationship index this itself means that we have 
atleast two RuntimeIterators");
+SelectResults returnSet;
 StructType stype = createStructTypeForRuntimeIterators(totalFinalList);
-SelectResults returnSet = QueryUtils.createStructCollection(context, 
stype);
+if (totalFinalList.size() == 1) {
+  returnSet = QueryUtils.createResultCollection(context, new 
ObjectTypeImpl(stype.getClass()));
+} else {
+  returnSet = QueryUtils.createStructCollection(context, stype);
+}
+
+
 RuntimeIterator[][] mappings = new RuntimeIterator[2][];
 mappings[0] = ich1.indexFieldToItrsMapping;
 mappings[1] = ich2.indexFieldToItrsMapping;

http://git-wip-us.apache.org/repos/asf/geode/blob/9c408681/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
index c865347..c55f3f3 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
@@ -1367,7 +1367,7 @@ public class IndexUseJUnitTest {
 
   @Test
   public void testIndexUseSelfJoin() throws Exception {
-String[] queries = {"SELECT DISTINCT * FROM /pos p1, /pos p2 where 
p1.status = p2.status",
+String[] queries = {"SELECT DISTINCT * FROM /pos p1, /pos p2 where 
p1.status = p1.status",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.ID = p2.ID",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.P1.secId = 
p2.P1.secId",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.status = p2.status 
and p1.status = 'active'",
@@ -1407,6 +1407,51 @@ public class IndexUseJUnitTest {
   }
 
   @Test
+  public void testIndexUseSelfJoinUsingO

[31/33] geode git commit: Cleanup HARegionQueueJUnitTest and BlockingHARegionQueueJUnitTest

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/107d3c4b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
index 4028ab3..929093d 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARegionQueueJUnitTest.java
@@ -15,6 +15,8 @@
 package org.apache.geode.internal.cache.ha;
 
 import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.number.OrderingComparison.*;
 import static org.junit.Assert.*;
 
 import java.io.IOException;
@@ -23,101 +25,75 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.awaitility.Awaitility;
-
-import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.ErrorCollector;
+import org.junit.rules.TestName;
 
-import org.apache.geode.LogWriter;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.CacheListener;
 import org.apache.geode.cache.EntryEvent;
 import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionExistsException;
 import org.apache.geode.cache.util.CacheListenerAdapter;
-import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.cache.Conflatable;
 import org.apache.geode.internal.cache.EventID;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.RegionQueue;
 import org.apache.geode.test.dunit.ThreadUtils;
+import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties;
+import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
 /**
  * This is a test for the APIs of a HARegionQueue and verifies that the head, 
tail and size counters
  * are updated properly.
+ *
+ * TODO: need to rewrite a bunch of tests in HARegionQueueJUnitTest
  */
 @Category({IntegrationTest.class, ClientSubscriptionTest.class})
 public class HARegionQueueJUnitTest {
 
-  /** The cache instance */
-  protected InternalCache cache = null;
+  /** total number of threads doing put operations */
+  private static final int TOTAL_PUT_THREADS = 10;
 
-  /** Logger for this test */
-  protected LogWriter logger;
+  private static HARegionQueue hrqForTestSafeConflationRemoval;
+  private static List list1;
 
-  /** The RegionQueue instance */
-  protected HARegionQueue rq;
+  protected InternalCache cache;
+  private HARegionQueue haRegionQueue;
 
-  /** total number of threads doing put operations */
-  private static final int TOTAL_PUT_THREADS = 10;
+  @Rule
+  public DistributedRestoreSystemProperties restoreSystemProperties =
+  new DistributedRestoreSystemProperties();
 
-  boolean expiryCalled = false;
+  @Rule
+  public ErrorCollector errorCollector = new ErrorCollector();
 
-  volatile boolean encounteredException = false;
-  boolean allowExpiryToProceed = false;
-  boolean complete = false;
+  @Rule
+  public TestName testName = new TestName();
 
   @Before
   public void setUp() throws Exception {
-cache = createCache();
-logger = cache.getLogger();
-encounteredException = false;
+this.cache = createCache();
   }
 
   @After
   public void tearDown() throws Exception {
-cache.close();
-  }
-
-  /**
-   * Creates the cache instance for the test
-   */
-  private InternalCache createCache() throws CacheException {
-return (InternalCache) new CacheFactory().set(MCAST_PORT, "0").create();
-  }
-
-  /**
-   * Creates HA region-queue object
-   */
-  private HARegionQueue createHARegionQueue(String name)
-  throws IOException, ClassNotFoundException, CacheException, 
InterruptedException {
-HARegionQueue regionqueue = HARegionQueue.getHARegionQueueInstance(name, 
cache,
-HARegionQueue.NON_BLOCKING_HA_QUEUE, false);
-return regionqueue;
-  }
-
-  /**
-   * Creates region-queue object
-   */
-  private HARegionQueue createHARegionQueue(Str

[30/33] geode git commit: Cleanup CacheClientUpdater

2017-05-23 Thread klund
Cleanup CacheClientUpdater


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: d393b4aa6b9fcb3d58ea7e81a883c862e6853178
Parents: d785ca3
Author: Kirk Lund 
Authored: Mon May 22 14:49:21 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:47:40 2017 -0700

--
 .../java/org/apache/geode/Instantiator.java |  99 ++-
 .../internal/cache/tier/CachedRegionHelper.java |  18 +-
 .../cache/tier/sockets/CacheClientUpdater.java  | 850 ++-
 .../cache/tier/sockets/ChunkedMessage.java  |   6 +-
 .../internal/cache/tier/sockets/Message.java|  61 +-
 .../cache/tier/sockets/ServerConnection.java|   5 +-
 ...arallelGatewaySenderOperationsDUnitTest.java |   3 +-
 7 files changed, 528 insertions(+), 514 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/d393b4aa/geode-core/src/main/java/org/apache/geode/Instantiator.java
--
diff --git a/geode-core/src/main/java/org/apache/geode/Instantiator.java 
b/geode-core/src/main/java/org/apache/geode/Instantiator.java
index c727e5b..ea42057 100644
--- a/geode-core/src/main/java/org/apache/geode/Instantiator.java
+++ b/geode-core/src/main/java/org/apache/geode/Instantiator.java
@@ -20,16 +20,16 @@ import 
org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
 /**
- * {@code Instantiator} allows classes that implement {@link DataSerializable} 
to be registered
- * with the data serialization framework. Knowledge of {@code 
DataSerializable} classes allows
- * the framework to optimize how instances of those classes are data 
serialized.
+ * {@code Instantiator} allows classes that implement {@link DataSerializable} 
to be registered with
+ * the data serialization framework. Knowledge of {@code DataSerializable} 
classes allows the
+ * framework to optimize how instances of those classes are data serialized.
  *
  * 
  *
  * Ordinarily, when a {@code DataSerializable} object is written using
  * {@link DataSerializer#writeObject(Object, java.io.DataOutput)}, a special 
marker class id is
- * written to the stream followed by the class name of the {@code 
DataSerializable} object.
- * After the marker class id is read by {@link DataSerializer#readObject} it 
performs the following
+ * written to the stream followed by the class name of the {@code 
DataSerializable} object. After
+ * the marker class id is read by {@link DataSerializer#readObject} it 
performs the following
  * operations,
  *
  * 
@@ -44,20 +44,20 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
  *
  * 
  *
- * However, if a {@code DataSerializable} class is {@linkplain 
#register(Instantiator)
- * registered} with the data serialization framework and assigned a unique 
class id, an important
- * optimization can be performed that avoid the expense of using reflection to 
instantiate the
+ * However, if a {@code DataSerializable} class is {@linkplain 
#register(Instantiator) registered}
+ * with the data serialization framework and assigned a unique class id, an 
important optimization
+ * can be performed that avoid the expense of using reflection to instantiate 
the
  * {@code DataSerializable} class. When the object is written using
  * {@link DataSerializer#writeObject(Object, java.io.DataOutput)}, the 
object's registered class id
  * is written to the stream. Consequently, when the data is read from the 
stream, the
- * {@link #newInstance} method of the appropriate {@code Instantiator} 
instance is invoked to
- * create an "empty" instance of the {@code DataSerializable} instead of using 
reflection to
- * create the new instance.
+ * {@link #newInstance} method of the appropriate {@code Instantiator} 
instance is invoked to create
+ * an "empty" instance of the {@code DataSerializable} instead of using 
reflection to create the new
+ * instance.
  *
  * 
  *
- * Commonly, a {@code DataSerializable} class will register itself with the
- * {@code Instantiator} in a static initializer as shown in the below example 
code.
+ * Commonly, a {@code DataSerializable} class will register itself with the 
{@code Instantiator} in
+ * a static initializer as shown in the below example code.
  *
  * 
 public class User implements DataSerializable {
@@ -98,20 +98,19 @@ public class User implements DataSerializable {
 }
  * 
  *
- * {@code Instantiator}s may be distributed to other members of the 
distributed system when
- * they are registered. Consider the following scenario in which VM1 and VM2 
are members of the same
+ * {@code Instant

[18/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
index d44a4ad..704f2da 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GatewayReceiverCommand.java
@@ -79,14 +79,14 @@ public class GatewayReceiverCommand extends BaseCommand {
   }
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long start)
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long start)
   throws IOException, InterruptedException {
 Part regionNamePart = null, keyPart = null, valuePart = null, 
callbackArgPart = null;
 String regionName = null;
 Object callbackArg = null, key = null;
 int partNumber = 0;
-CachedRegionHelper crHelper = servConn.getCachedRegionHelper();
-GatewayReceiverStats stats = (GatewayReceiverStats) 
servConn.getCacheServerStats();
+CachedRegionHelper crHelper = serverConnection.getCachedRegionHelper();
+GatewayReceiverStats stats = (GatewayReceiverStats) 
serverConnection.getCacheServerStats();
 EventID eventId = null;
 LocalRegion region = null;
 List exceptions = new ArrayList();
@@ -102,20 +102,20 @@ public class GatewayReceiverCommand extends BaseCommand {
 // statement so that all messages can take advantage of it.
 boolean earlyAck = false;// msg.getEarlyAck();
 
-stats.incBatchSize(msg.getPayloadLength());
+stats.incBatchSize(clientMessage.getPayloadLength());
 
 // Retrieve the number of events
-Part numberOfEventsPart = msg.getPart(0);
+Part numberOfEventsPart = clientMessage.getPart(0);
 int numberOfEvents = numberOfEventsPart.getInt();
 stats.incEventsReceived(numberOfEvents);
 
 // Retrieve the batch id
-Part batchIdPart = msg.getPart(1);
+Part batchIdPart = clientMessage.getPart(1);
 int batchId = batchIdPart.getInt();
 
 // If this batch has already been seen, do not reply.
 // Instead, drop the batch and continue.
-if (batchId <= servConn.getLatestBatchIdReplied()) {
+if (batchId <= serverConnection.getLatestBatchIdReplied()) {
   if (GatewayReceiver.APPLY_RETRIES) {
 // Do nothing!!!
 logger.warn(LocalizedMessage.create(
@@ -125,17 +125,17 @@ public class GatewayReceiverCommand extends BaseCommand {
 logger.warn(LocalizedMessage.create(
 
LocalizedStrings.ProcessBatch_RECEIVED_PROCESS_BATCH_REQUEST_0_THAT_HAS_ALREADY_BEEN_OR_IS_BEING_PROCESSED__THIS_PROCESS_BATCH_REQUEST_IS_BEING_IGNORED,
 batchId));
-writeReply(msg, servConn, batchId, numberOfEvents);
+writeReply(clientMessage, serverConnection, batchId, numberOfEvents);
 return;
   }
   stats.incDuplicateBatchesReceived();
 }
 
 // Verify the batches arrive in order
-if (batchId != servConn.getLatestBatchIdReplied() + 1) {
+if (batchId != serverConnection.getLatestBatchIdReplied() + 1) {
   logger.warn(LocalizedMessage.create(
   
LocalizedStrings.ProcessBatch_RECEIVED_PROCESS_BATCH_REQUEST_0_OUT_OF_ORDER_THE_ID_OF_THE_LAST_BATCH_PROCESSED_WAS_1_THIS_BATCH_REQUEST_WILL_BE_PROCESSED_BUT_SOME_MESSAGES_MAY_HAVE_BEEN_LOST,
-  new Object[] {batchId, servConn.getLatestBatchIdReplied()}));
+  new Object[] {batchId, serverConnection.getLatestBatchIdReplied()}));
   stats.incOutoforderBatchesReceived();
 }
 
@@ -146,7 +146,7 @@ public class GatewayReceiverCommand extends BaseCommand {
 // If early ack mode, acknowledge right away
 // Not sure if earlyAck makes sense with sliding window
 if (earlyAck) {
-  servConn.incrementLatestBatchIdReplied(batchId);
+  serverConnection.incrementLatestBatchIdReplied(batchId);
 
   // writeReply(msg, servConn);
   // servConn.setAsTrue(RESPONDED);
@@ -162,13 +162,13 @@ public class GatewayReceiverCommand extends BaseCommand {
 if (logger.isDebugEnabled()) {
   logger.debug(
   "{}: Received process batch request {} containing {} events ({} 
bytes) with {} acknowledgement on {}",
-  servConn.getName(), batchId, numberOfEvents, msg.getPayloadLength(),
-  (earlyAck ? "early" : "normal"), servConn.getSocketString());
+  serverConnection.getName(), batchId, numberOfEvents, 
clientMessage.getPayloadLength(),
+  (earlyAck ? "early" : "normal"), serverConnection.getSocketString());
   if (earlyAck) {
 logger.debug(
 "{}: Sent process batch early response for b

[16/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Put65.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Put65.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Put65.java
index d53c89e..581aec6 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Put65.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Put65.java
@@ -63,7 +63,7 @@ public class Put65 extends BaseCommand {
   }
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long p_start)
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long p_start)
   throws IOException, InterruptedException {
 long start = p_start;
 Part regionNamePart = null, keyPart = null, valuePart = null, 
callbackArgPart = null;
@@ -72,11 +72,11 @@ public class Put65 extends BaseCommand {
 Part eventPart = null;
 StringBuffer errMessage = new StringBuffer();
 boolean isDelta = false;
-CachedRegionHelper crHelper = servConn.getCachedRegionHelper();
-CacheServerStats stats = servConn.getCacheServerStats();
+CachedRegionHelper crHelper = serverConnection.getCachedRegionHelper();
+CacheServerStats stats = serverConnection.getCacheServerStats();
 
 // requiresResponse = true;
-servConn.setAsTrue(REQUIRES_RESPONSE);
+serverConnection.setAsTrue(REQUIRES_RESPONSE);
 {
   long oldStart = start;
   start = DistributionStats.getStatTime();
@@ -84,50 +84,50 @@ public class Put65 extends BaseCommand {
 }
 // Retrieve the data from the message parts
 int idx = 0;
-regionNamePart = msg.getPart(idx++);
+regionNamePart = clientMessage.getPart(idx++);
 Operation operation;
 try {
-  operation = (Operation) msg.getPart(idx++).getObject();
+  operation = (Operation) clientMessage.getPart(idx++).getObject();
   if (operation == null) { // native clients send a null since the op is 
java-serialized
 operation = Operation.UPDATE;
   }
 } catch (ClassNotFoundException e) {
-  writeException(msg, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeException(clientMessage, e, false, serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   return;
 }
-int flags = msg.getPart(idx++).getInt();
+int flags = clientMessage.getPart(idx++).getInt();
 boolean requireOldValue = ((flags & 0x01) == 0x01);
 boolean haveExpectedOldValue = ((flags & 0x02) == 0x02);
 Object expectedOldValue = null;
 if (haveExpectedOldValue) {
   try {
-expectedOldValue = msg.getPart(idx++).getObject();
+expectedOldValue = clientMessage.getPart(idx++).getObject();
   } catch (ClassNotFoundException e) {
-writeException(msg, e, false, servConn);
-servConn.setAsTrue(RESPONDED);
+writeException(clientMessage, e, false, serverConnection);
+serverConnection.setAsTrue(RESPONDED);
 return;
   }
 }
-keyPart = msg.getPart(idx++);
+keyPart = clientMessage.getPart(idx++);
 try {
-  isDelta = ((Boolean) msg.getPart(idx).getObject()).booleanValue();
+  isDelta = ((Boolean) 
clientMessage.getPart(idx).getObject()).booleanValue();
   idx += 1;
 } catch (Exception e) {
-  writeException(msg, MessageType.PUT_DELTA_ERROR, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeException(clientMessage, MessageType.PUT_DELTA_ERROR, e, false, 
serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   // CachePerfStats not available here.
   return;
 }
-valuePart = msg.getPart(idx++);
-eventPart = msg.getPart(idx++);
-if (msg.getNumberOfParts() > idx) {
-  callbackArgPart = msg.getPart(idx++);
+valuePart = clientMessage.getPart(idx++);
+eventPart = clientMessage.getPart(idx++);
+if (clientMessage.getNumberOfParts() > idx) {
+  callbackArgPart = clientMessage.getPart(idx++);
   try {
 callbackArg = callbackArgPart.getObject();
   } catch (Exception e) {
-writeException(msg, e, false, servConn);
-servConn.setAsTrue(RESPONDED);
+writeException(clientMessage, e, false, serverConnection);
+serverConnection.setAsTrue(RESPONDED);
 return;
   }
 }
@@ -136,8 +136,8 @@ public class Put65 extends BaseCommand {
 try {
   key = keyPart.getStringOrObject();
 } catch (Exception e) {
-  writeException(msg, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeException(clientMessage, e, false, serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   return;
 }
 
@@ -145,8 +145,8 @@ public class Put65 extends BaseCommand {
 i

[08/33] geode git commit: GEODE-2951: Removed --pageSize option

2017-05-23 Thread klund
GEODE-2951: Removed --pageSize option


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: db81d9280cf9b2286294ebcfa3ee7c3418da2ce2
Parents: db028ac
Author: Barry Oglesby 
Authored: Tue May 23 12:59:17 2017 -0700
Committer: Barry Oglesby 
Committed: Tue May 23 12:59:17 2017 -0700

--
 .../cache/lucene/internal/cli/LuceneIndexCommands.java   |  8 +---
 .../internal/cli/LuceneIndexCommandsJUnitTest.java   | 11 ++-
 2 files changed, 7 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/db81d928/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
--
diff --git 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
index 033fedc..5e17f6e 100755
--- 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
+++ 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
@@ -275,19 +275,13 @@ public class LuceneIndexCommands extends 
AbstractCommandsSupport {
   @CliOption(key = LuceneCliStrings.LUCENE_SEARCH_INDEX__LIMIT, 
unspecifiedDefaultValue = "-1",
   help = LuceneCliStrings.LUCENE_SEARCH_INDEX__LIMIT__HELP) final int 
limit,
 
-  @CliOption(key = LuceneCliStrings.LUCENE_SEARCH_INDEX__PAGE_SIZE,
-  unspecifiedDefaultValue = "-1",
-  help = LuceneCliStrings.LUCENE_SEARCH_INDEX__PAGE_SIZE__HELP) int 
pageSize,
-
   @CliOption(key = LuceneCliStrings.LUCENE_SEARCH_INDEX__KEYSONLY,
   unspecifiedDefaultValue = "false",
   help = LuceneCliStrings.LUCENE_SEARCH_INDEX__KEYSONLY__HELP) boolean 
keysOnly) {
 try {
   LuceneQueryInfo queryInfo =
   new LuceneQueryInfo(indexName, regionPath, queryString, 
defaultField, limit, keysOnly);
-  if (pageSize == -1) {
-pageSize = Integer.MAX_VALUE;
-  }
+  int pageSize = Integer.MAX_VALUE;
   searchResults = getSearchResults(queryInfo);
   return displayResults(pageSize, keysOnly);
 } catch (FunctionInvocationTargetException ignore) {

http://git-wip-us.apache.org/repos/asf/geode/blob/db81d928/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
--
diff --git 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
index 143e99d..66e15bb 100644
--- 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
+++ 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
@@ -50,6 +50,7 @@ import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
@@ -265,7 +266,7 @@ public class LuceneIndexCommandsJUnitTest {
 doReturn(queryResultsList).when(mockResultCollector).getResult();
 
 CommandResult result =
-(CommandResult) commands.searchIndex("index", "region", "Result1", 
"field1", -1, -1, false);
+(CommandResult) commands.searchIndex("index", "region", "Result1", 
"field1", -1, false);
 
 TabularResultData data = (TabularResultData) result.getResultData();
 
@@ -274,7 +275,7 @@ public class LuceneIndexCommandsJUnitTest {
 assertEquals(Arrays.asList("1.1", "1.2", "1.3"), 
data.retrieveAllValues("score"));
   }
 
-  @Test
+  @Ignore
   public void testSearchIndexWithPaging() throws Exception {
 final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
 final Gfsh mockGfsh = mock(Gfsh.class);
@@ -306,7 +307,7 @@ public class LuceneIndexCommandsJUnitTest {
 String expectedPage3 = getPage(expectedResults, new int[] {4, 5});
 String expectedPage4 = getPage(expectedResults, new int[] {6});
 
-commands.searchIndex("index", "region", "Result1", "field1", -1, 2, false);
+commands.searchIndex("index", "region", "Result1", "field1", -1, false);
 verify(mockGfsh, times(20)).printAsInfo(resultCaptor.capture());
 List actualPageResu

[03/33] geode git commit: GEODE-2420: Resolve conflicts with recent checkin

2017-05-23 Thread klund
GEODE-2420: Resolve conflicts with recent checkin

Use InternalCache instead of GemnFireCachImpl.

Refactored product and tests
- Combined LogExporter and LogSizer.
- Remove classes no longer needed


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: c5962aa9308764bb964e4b4160e969f2dfae062d
Parents: 3ce3437
Author: Ken Howe 
Authored: Mon May 15 15:00:00 2017 -0700
Committer: Ken Howe 
Committed: Tue May 23 08:16:17 2017 -0700

--
 .../cli/commands/ExportLogsCommand.java | 199 ---
 .../cli/functions/ExportLogsFunction.java   |   3 +-
 .../cli/functions/ExportedLogsSizeInfo.java | 105 --
 .../cli/functions/SizeExportLogsFunction.java   |  29 ++-
 .../internal/cli/i18n/CliStrings.java   |   2 +-
 .../internal/cli/util/LogExporter.java  |  63 +-
 .../management/internal/cli/util/LogSizer.java  | 118 ---
 .../cli/commands/ExportLogsCommandTest.java | 121 ++-
 .../cli/commands/ExportLogsDUnitTest.java   |  21 +-
 .../commands/ExportLogsFileSizeLimitTest.java   |   4 +-
 .../cli/commands/ExportLogsTestSuite.java   |  10 +-
 .../cli/functions/ExportedLogsSizeInfoTest.java | 133 -
 .../SizeExportLogsFunctionCacheTest.java| 174 
 .../functions/SizeExportLogsFunctionTest.java   | 178 +
 .../cli/functions/SizeExportLogsTestSuite.java  |  29 ---
 .../internal/cli/util/LogExporterTest.java  |   6 +-
 .../internal/cli/util/LogSizerTest.java |  17 +-
 17 files changed, 376 insertions(+), 836 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/c5962aa9/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
index af681da..ab93f94 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
@@ -44,7 +44,6 @@ import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.CliUtil;
 import org.apache.geode.management.internal.cli.functions.ExportLogsFunction;
-import org.apache.geode.management.internal.cli.functions.ExportedLogsSizeInfo;
 import 
org.apache.geode.management.internal.cli.functions.SizeExportLogsFunction;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.ResultBuilder;
@@ -65,7 +64,7 @@ public class ExportLogsCommand implements CommandMarker {
 
   private static final Pattern DISK_SPACE_LIMIT_PATTERN = 
Pattern.compile("(\\d+)([kmgtKMGT]?)");
 
-  private InternalCache getCache() {
+  InternalCache getCache() {
 return (InternalCache) CacheFactory.getAnyInstance();
   }
 
@@ -129,106 +128,88 @@ public class ExportLogsCommand implements CommandMarker {
 
   List results = (List) estimateLogSize(args, 
server).getResult();
   long estimatedSize = 0;
-  long diskAvailable = 0;
-  long diskSize = 0;
   if (!results.isEmpty()) {
 List res = (List) results.get(0);
-if (res.get(0) instanceof ExportedLogsSizeInfo) {
-  ExportedLogsSizeInfo sizeInfo = (ExportedLogsSizeInfo) 
res.get(0);
-  estimatedSize = sizeInfo.getLogsSize();
-  diskAvailable = sizeInfo.getDiskAvailable();
-  diskSize = sizeInfo.getDiskSize();
+if (res.get(0) instanceof Long) {
+  estimatedSize = (Long) res.get(0);
 }
   }
   logger.info("Received estimated export size from member {}: {}", 
server.getId(),
   estimatedSize);
   totalEstimatedExportSize += estimatedSize;
-
-  // If export size checking is enabled, then estimated size on each 
member shouldn't exceed
-  // the available disk on that member
-  try {
-isSizeCheckEnabledAndWithinDiskSpaceOfMember(server.getName(),
-parseFileSizeLimit(fileSizeLimit), estimatedSize, 
diskAvailable, diskSize);
-  } catch (ManagementException e) {
-return ResultBuilder.createUserErrorResult(e.getMessage());
-  }
 }
 
 // The sum of the estimated e

[19/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyRegion.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyRegion.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyRegion.java
index 13fef02..de37040 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyRegion.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/DestroyRegion.java
@@ -45,15 +45,15 @@ public class DestroyRegion extends BaseCommand {
   }
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long start)
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long start)
   throws IOException, InterruptedException {
 Part regionNamePart = null, callbackArgPart = null;
 String regionName = null;
 Object callbackArg = null;
 Part eventPart = null;
 StringBuffer errMessage = new StringBuffer();
-CacheServerStats stats = servConn.getCacheServerStats();
-servConn.setAsTrue(REQUIRES_RESPONSE);
+CacheServerStats stats = serverConnection.getCacheServerStats();
+serverConnection.setAsTrue(REQUIRES_RESPONSE);
 
 {
   long oldStart = start;
@@ -61,11 +61,11 @@ public class DestroyRegion extends BaseCommand {
   stats.incReadDestroyRegionRequestTime(start - oldStart);
 }
 // Retrieve the data from the message parts
-regionNamePart = msg.getPart(0);
-eventPart = msg.getPart(1);
+regionNamePart = clientMessage.getPart(0);
+eventPart = clientMessage.getPart(1);
 // callbackArgPart = null; (redundant assignment)
-if (msg.getNumberOfParts() > 2) {
-  callbackArgPart = msg.getPart(2);
+if (clientMessage.getNumberOfParts() > 2) {
+  callbackArgPart = clientMessage.getPart(2);
   try {
 callbackArg = callbackArgPart.getObject();
   } catch (DistributedSystemDisconnectedException se) {
@@ -73,47 +73,46 @@ public class DestroyRegion extends BaseCommand {
 if (logger.isDebugEnabled()) {
   logger.debug(
   "{} ignoring message of type {} from client {} because shutdown 
occurred during message processing.",
-  servConn.getName(), MessageType.getString(msg.getMessageType()),
-  servConn.getProxyID());
+  serverConnection.getName(), 
MessageType.getString(clientMessage.getMessageType()),
+  serverConnection.getProxyID());
 }
 
-servConn.setFlagProcessMessagesAsFalse();
-servConn.setClientDisconnectedException(se);
+serverConnection.setFlagProcessMessagesAsFalse();
+serverConnection.setClientDisconnectedException(se);
 return;
   } catch (Exception e) {
-writeException(msg, e, false, servConn);
-servConn.setAsTrue(RESPONDED);
+writeException(clientMessage, e, false, serverConnection);
+serverConnection.setAsTrue(RESPONDED);
 return;
   }
 }
 regionName = regionNamePart.getString();
 if (logger.isDebugEnabled()) {
   logger.debug("{}: Received destroy region request ({} bytes) from {} for 
region {}",
-  servConn.getName(), msg.getPayloadLength(), 
servConn.getSocketString(), regionName);
+  serverConnection.getName(), clientMessage.getPayloadLength(), 
serverConnection.getSocketString(), regionName);
 }
 
 // Process the destroy region request
 if (regionName == null) {
   logger.warn(LocalizedMessage.create(
   
LocalizedStrings.DestroyRegion_0_THE_INPUT_REGION_NAME_FOR_THE_DESTROY_REGION_REQUEST_IS_NULL,
-  servConn.getName()));
+  serverConnection.getName()));
   errMessage.append(
   
LocalizedStrings.DestroyRegion__THE_INPUT_REGION_NAME_FOR_THE_DESTROY_REGION_REQUEST_IS_NULL
   .toLocalizedString());
 
-  writeErrorResponse(msg, MessageType.DESTROY_REGION_DATA_ERROR, 
errMessage.toString(),
-  servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeErrorResponse(clientMessage, MessageType.DESTROY_REGION_DATA_ERROR, 
errMessage.toString(), serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   return;
 }
 
-LocalRegion region = (LocalRegion) 
servConn.getCache().getRegion(regionName);
+LocalRegion region = (LocalRegion) 
serverConnection.getCache().getRegion(regionName);
 if (region == null) {
   String reason =
   
LocalizedStrings.DestroyRegion_REGION_WAS_NOT_FOUND_DURING_DESTROY_REGION_REQUEST
   .toLocalizedString();
-  writeRegionDestroyedEx(msg, regionName, reason, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeRegionDestroyedEx(clientMessage, regionName, reason, 
serverConnection);
+  serverConnect

[17/33] geode git commit: Cleanup BaseCommand

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetFunctionAttribute.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetFunctionAttribute.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetFunctionAttribute.java
index 8ec16ef..f56a4d9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetFunctionAttribute.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetFunctionAttribute.java
@@ -34,15 +34,15 @@ public class GetFunctionAttribute extends BaseCommand {
   }
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long start) 
throws IOException {
-servConn.setAsTrue(REQUIRES_RESPONSE);
-String functionId = msg.getPart(0).getString();
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long start) throws IOException {
+serverConnection.setAsTrue(REQUIRES_RESPONSE);
+String functionId = clientMessage.getPart(0).getString();
 if (functionId == null) {
   String message =
   
LocalizedStrings.GetFunctionAttribute_THE_INPUT_0_FOR_GET_FUNCTION_ATTRIBUTE_REQUEST_IS_NULL
   .toLocalizedString("functionId");
-  logger.warn("{}: {}", servConn.getName(), message);
-  sendError(msg, message, servConn);
+  logger.warn("{}: {}", serverConnection.getName(), message);
+  sendError(clientMessage, message, serverConnection);
   return;
 }
 
@@ -52,8 +52,8 @@ public class GetFunctionAttribute extends BaseCommand {
   message =
   
LocalizedStrings.GetFunctionAttribute_THE_FUNCTION_IS_NOT_REGISTERED_FOR_FUNCTION_ID_0
   .toLocalizedString(functionId);
-  logger.warn("{}: {}", servConn.getName(), message);
-  sendError(msg, message, servConn);
+  logger.warn("{}: {}", serverConnection.getName(), message);
+  sendError(clientMessage, message, serverConnection);
   return;
 }
 
@@ -61,7 +61,7 @@ public class GetFunctionAttribute extends BaseCommand {
 functionAttributes[0] = (byte) (function.hasResult() ? 1 : 0);
 functionAttributes[1] = (byte) (function.isHA() ? 1 : 0);
 functionAttributes[2] = (byte) (function.optimizeForWrite() ? 1 : 0);
-writeResponseWithFunctionAttribute(functionAttributes, msg, servConn);
+writeResponseWithFunctionAttribute(functionAttributes, clientMessage, 
serverConnection);
   }
 
   private void sendError(Message msg, String message, ServerConnection 
servConn)

http://git-wip-us.apache.org/repos/asf/geode/blob/fec1be92/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetPDXEnumById.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetPDXEnumById.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetPDXEnumById.java
index 54a21ed..cc7dd05 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetPDXEnumById.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/GetPDXEnumById.java
@@ -36,32 +36,32 @@ public class GetPDXEnumById extends BaseCommand {
   private GetPDXEnumById() {}
 
   @Override
-  public void cmdExecute(Message msg, ServerConnection servConn, long start)
+  public void cmdExecute(Message clientMessage, ServerConnection 
serverConnection, long start)
   throws IOException, ClassNotFoundException {
-servConn.setAsTrue(REQUIRES_RESPONSE);
+serverConnection.setAsTrue(REQUIRES_RESPONSE);
 if (logger.isDebugEnabled()) {
-  logger.debug("{}: Received get pdx enum by id request ({} parts) from 
{}", servConn.getName(),
-  msg.getNumberOfParts(), servConn.getSocketString());
+  logger.debug("{}: Received get pdx enum by id request ({} parts) from 
{}", serverConnection.getName(),
+  clientMessage.getNumberOfParts(), 
serverConnection.getSocketString());
 }
-int enumId = msg.getPart(0).getInt();
+int enumId = clientMessage.getPart(0).getInt();
 
 EnumInfo result;
 try {
-  InternalCache cache = servConn.getCache();
+  InternalCache cache = serverConnection.getCache();
   TypeRegistry registry = cache.getPdxRegistry();
   result = registry.getEnumInfoById(enumId);
 } catch (Exception e) {
-  writeException(msg, e, false, servConn);
-  servConn.setAsTrue(RESPONDED);
+  writeException(clientMessage, e, false, serverConnection);
+  serverConnection.setAsTrue(RESPONDED);
   return;
 }
 
-Message responseMsg = servConn.getResponseMessage();
+Message responseMsg = serverConnection.getResponseMessage();
 responseMsg.setMessa

[13/33] geode git commit: Cleanup CacheClientNotifier

2017-05-23 Thread klund
Cleanup CacheClientNotifier


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: c3d4687fa0a37e5fb35fa0f408dc27e007c98671
Parents: 456ee15
Author: Kirk Lund 
Authored: Thu May 18 13:28:38 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:47:37 2017 -0700

--
 .../cache/tier/sockets/CacheClientNotifier.java | 1160 --
 .../cache/tier/sockets/CacheClientProxy.java|4 +-
 2 files changed, 542 insertions(+), 622 deletions(-)
--




[10/33] geode git commit: GEODE-2961: Fixed distinct multiple OR query returning partial results

2017-05-23 Thread klund
GEODE-2961: Fixed distinct multiple OR query returning partial results


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 456ee15768fb08c8e1c8c5836479d27e1bc61835
Parents: 9c40868
Author: David Anuta 
Authored: Tue May 23 13:53:19 2017 -0700
Committer: nabarun 
Committed: Tue May 23 14:05:41 2017 -0700

--
 .../internal/AbstractGroupOrRangeJunction.java  |  2 +-
 .../query/internal/index/IndexUseJUnitTest.java | 16 
 2 files changed, 17 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/456ee157/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
index 5ed4d86..35f0290 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
@@ -325,7 +325,7 @@ public abstract class AbstractGroupOrRangeJunction extends 
AbstractCompiledValue
 if (intermediateResults == null) {
   intermediateResults = filterResults;
 } else if (isDistinct && !isConditioningNeeded) {
-  intermediateResults = filterResults;
+  intermediateResults.addAll(filterResults);
 } else {
   intermediateResults = QueryUtils.union(intermediateResults, 
filterResults, context);
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/456ee157/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
index c55f3f3..9c8756c 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
@@ -1366,6 +1366,22 @@ public class IndexUseJUnitTest {
   }
 
   @Test
+  public void queryWithOrClauseShouldReturnCorrectResultSet() throws Exception 
{
+String query =
+"SELECT DISTINCT p1.ID FROM /pos p1 where p1.ID IN SET (0,1) OR 
p1.status = 'active'";
+
+Query q = qs.newQuery(query);
+QueryObserverImpl observer = new QueryObserverImpl();
+QueryObserverHolder.setInstance(observer);
+SelectResults sr = (SelectResults) q.execute();
+if (!observer.isIndexesUsed)
+  fail("Index should have been used for query '" + q.getQueryString() + 
"'");
+
+assertEquals(sr.size(), 3);
+qs.removeIndexes();
+  }
+
+  @Test
   public void testIndexUseSelfJoin() throws Exception {
 String[] queries = {"SELECT DISTINCT * FROM /pos p1, /pos p2 where 
p1.status = p1.status",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.ID = p2.ID",



[04/33] geode git commit: GEODE-2420: Enable export logs size estimation and user warning

2017-05-23 Thread klund
GEODE-2420: Enable export logs size estimation and user warning

Adds 'export logs' option, --file-limit-size, to allow user to set
maximun size of the epxorted logs zip file.

When size checking is enabled (file-limit-size > 0) then the check
will also prevent filling up the disk on each member while consolidating
and filtering the logs.


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 3ce3437ddaf9c3614b11f066011ed33664259e9f
Parents: 18db4bf
Author: Ken Howe 
Authored: Fri May 5 14:04:11 2017 -0700
Committer: Ken Howe 
Committed: Tue May 23 08:16:17 2017 -0700

--
 .../membership/InternalDistributedMember.java   |  22 +-
 .../cli/commands/ExportLogsCommand.java | 277 ---
 .../cli/functions/SizeExportLogsFunction.java   |   4 +-
 .../management/internal/cli/util/LogSizer.java  |   6 +-
 .../cli/commands/ExportLogsCommandTest.java | 225 ++-
 .../cli/commands/ExportLogsDUnitTest.java   |   7 +
 .../commands/ExportLogsFileSizeLimitTest.java   |   2 +-
 .../cli/commands/ExportLogsTestSuite.java   |  10 +-
 .../SizeExportLogsFunctionCacheTest.java|  12 +-
 9 files changed, 436 insertions(+), 129 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/3ce3437d/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
index 7170f20..6982d31 100755
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
@@ -190,8 +190,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* string).
* 
*
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 
*
* 
* @param i the hostname, must be for the current host
@@ -228,8 +228,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* string).
* 
*
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 
*
* 
* @param i the hostname, must be for the current host
@@ -264,8 +264,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* LonerDistributionManager.
* 
*
-   * < b> [bruce]DO NOT USE THIS METHOD TO CREATE ANYTHING OTHER THAN A LONER 
ID WITHOUT TALKING TO
-   * ME FIRST. IT DOES NOT PROPERLY INITIALIZE THE ID. 
+   * < b> DO NOT USE THIS METHOD TO CREATE ANYTHING OTHER THAN A LONER ID. IT 
DOES NOT PROPERLY
+   * INITIALIZE THE ID. 
*
* @param host the hostname, must be for the current host
* @param p the membership listening port
@@ -298,8 +298,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* address).
* 
*
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 
*
* 
* @param i the hostname, must be for the current host
@@ -314,8 +314,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* Create a InternalDistributedMember as defined by the given address.
* 
* 
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INI

[06/33] geode git commit: GEODE-2918 Close cache when ConflictingPersistentDataException is thrown.

2017-05-23 Thread klund
GEODE-2918 Close cache when ConflictingPersistentDataException is thrown.

During disk recovery the ConflictingPersistentDataException is not handled
properly; it should have logged an error and closed the cache.
When it is handled incorrectly, the cache is in inconsistent state; causing
other operations to fail in unexpected ways.


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 3cbb6fcd08272dc6a5219e9092b34ae29eed79f3
Parents: adbdf50
Author: Anil 
Authored: Mon May 22 10:42:08 2017 -0700
Committer: Anil 
Committed: Tue May 23 10:18:23 2017 -0700

--
 .../apache/geode/cache/DiskAccessException.java |   9 +
 .../ConflictingPersistentDataException.java |   6 +-
 .../geode/internal/cache/LocalRegion.java   |   9 +-
 .../geode/internal/cache/ProxyBucketRegion.java |   5 +-
 .../persistence/PersistenceAdvisorImpl.java |  16 +-
 .../PersistentPartitionedRegionDUnitTest.java   | 169 ---
 .../PersistentPartitionedRegionTestBase.java|  82 -
 7 files changed, 262 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/3cbb6fcd/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java 
b/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
index fb640cd..51018a5 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
@@ -110,6 +110,15 @@ public class DiskAccessException extends 
CacheRuntimeException {
   }
 
   /**
+   * Constructs a new DiskAccessException with a message string.
+   *
+   * @param msg the message string
+   */
+  public DiskAccessException(String msg) {
+super(msg);
+  }
+
+  /**
* Returns true if this exception originated from a remote node.
*/
   public boolean isRemote() {

http://git-wip-us.apache.org/repos/asf/geode/blob/3cbb6fcd/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
 
b/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
index 9bf7234..3ea7c3e 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
@@ -15,7 +15,7 @@
 package org.apache.geode.cache.persistence;
 
 import org.apache.geode.GemFireException;
-import org.apache.geode.admin.AdminDistributedSystem;
+import org.apache.geode.cache.DiskAccessException;
 
 /**
  * Thrown when a member with persistence is recovering, and it discovers that 
the data it has on
@@ -28,7 +28,7 @@ import org.apache.geode.admin.AdminDistributedSystem;
  * 
  * @since GemFire 6.5
  */
-public class ConflictingPersistentDataException extends GemFireException {
+public class ConflictingPersistentDataException extends DiskAccessException {
 
   private static final long serialVersionUID = -2629287782021455875L;
 
@@ -48,6 +48,4 @@ public class ConflictingPersistentDataException extends 
GemFireException {
 super(cause);
   }
 
-
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/3cbb6fcd/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index 8e7ec68..4446d48 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -81,6 +81,7 @@ import org.apache.geode.cache.control.ResourceManager;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.cache.partition.PartitionRegionHelper;
+import org.apache.geode.cache.persistence.ConflictingPersistentDataException;
 import org.apache.geode.cache.query.FunctionDomainException;
 import org.apache.geode.cache.query.Index;
 import org.apache.geode.cache.query.IndexMaintenanceException;
@@ -6595,8 +6596,12 @@ public class LocalRegion extends AbstractRegion 
implem

[01/33] geode git commit: GEODE-2956: Trimmed analyzer strings in create index [Forced Update!]

2017-05-23 Thread klund
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2632-17 012b47563 -> 47c372f21 (forced update)


GEODE-2956: Trimmed analyzer strings in create index

This closes #524


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: d88d2de96cea615ba278f3503ea5f7757d3f2e14
Parents: 8782f0b
Author: David Anuta 
Authored: Mon May 22 17:10:25 2017 -0700
Committer: nabarunnag 
Committed: Mon May 22 21:50:03 2017 -0700

--
 .../functions/LuceneCreateIndexFunction.java|  9 --
 .../LuceneIndexCreationIntegrationTest.java |  2 ++
 .../cli/LuceneIndexCommandsDUnitTest.java   | 33 
 3 files changed, 42 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/d88d2de9/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
--
diff --git 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
index a5ec7d5..9f938a5 100644
--- 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
+++ 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
@@ -96,8 +96,13 @@ public class LuceneCreateIndexFunction extends 
FunctionAdapter implements Intern
   private Analyzer toAnalyzer(String className) {
 if (className == null)
   className = StandardAnalyzer.class.getCanonicalName();
-else if (StringUtils.trim(className).equals("") | 
StringUtils.trim(className).equals("null"))
-  className = StandardAnalyzer.class.getCanonicalName();
+else {
+  String trimmedClassName = StringUtils.trim(className);
+  if (trimmedClassName.equals("") || trimmedClassName.equals("null"))
+className = StandardAnalyzer.class.getCanonicalName();
+  else
+className = trimmedClassName;
+}
 
 Class clazz =
 CliUtil.forName(className, 
LuceneCliStrings.LUCENE_CREATE_INDEX__ANALYZER);

http://git-wip-us.apache.org/repos/asf/geode/blob/d88d2de9/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
--
diff --git 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
index 2fea5d5..b590afb 100644
--- 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
+++ 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
@@ -43,6 +43,7 @@ import 
org.apache.geode.cache.lucene.internal.LuceneIndexImplFactory;
 import org.apache.geode.cache.lucene.internal.LuceneRawIndex;
 import org.apache.geode.cache.lucene.internal.LuceneRawIndexFactory;
 import org.apache.geode.cache.lucene.internal.LuceneServiceImpl;
+import org.apache.geode.cache.lucene.internal.xml.LuceneIndexCreation;
 import org.apache.geode.cache.lucene.test.LuceneTestUtilities;
 import org.apache.geode.cache.lucene.test.TestObject;
 import org.apache.geode.internal.cache.BucketNotFoundException;
@@ -77,6 +78,7 @@ public class LuceneIndexCreationIntegrationTest extends 
LuceneIntegrationTest {
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
 
+
   @Test
   public void 
shouldCreateIndexWriterWithAnalyzersWhenSettingPerFieldAnalyzers()
   throws BucketNotFoundException, InterruptedException {

http://git-wip-us.apache.org/repos/asf/geode/blob/d88d2de9/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
--
diff --git 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
index 9ef3f28..c96f846 100755
--- 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
+++ 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
@@ -198,6 +198,39 @@ public class LuceneIndexCommandsDUnitTest extends 
CliCommandTestBase {
   }
 
   @Test
+  public v

[28/33] geode git commit: Cleanup CacheClientUpdater

2017-05-23 Thread klund
http://git-wip-us.apache.org/repos/asf/geode/blob/d393b4aa/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
--
diff --git 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
index 8cedbf0..702e6c8 100644
--- 
a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
+++ 
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
@@ -43,7 +43,8 @@ import org.apache.geode.test.junit.categories.DistributedTest;
 public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
 
   @Rule
-  public DistributedRestoreSystemProperties restoreSystemProperties = new 
DistributedRestoreSystemProperties();
+  public DistributedRestoreSystemProperties restoreSystemProperties =
+  new DistributedRestoreSystemProperties();
 
   @Override
   protected final void postSetUpWANTestBase() throws Exception {



geode git commit: Do NOT close HeapDataOutputStream that is passed to Part

2017-05-23 Thread klund
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2632-17 fd84df29b -> 012b47563


Do NOT close HeapDataOutputStream that is passed to Part


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

Branch: refs/heads/feature/GEODE-2632-17
Commit: 012b47563bd54a6ba0956296f62fadb292cd4dfc
Parents: fd84df2
Author: Kirk Lund 
Authored: Tue May 23 14:46:34 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 23 14:46:34 2017 -0700

--
 .../internal/cache/tier/sockets/Message.java| 36 
 1 file changed, 15 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/012b4756/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
index 2ac6fea..de3017b 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/Message.java
@@ -297,14 +297,11 @@ public class Message {
 }
   }
   part.setPartState(bytes, false);
+
 } else {
-  HeapDataOutputStream hdos = new HeapDataOutputStream(str);
-  try {
-this.messageModified = true;
-part.setPartState(hdos, false);
-  } finally {
-close(hdos);
-  }
+  // do NOT close the HeapDataOutputStream
+  this.messageModified = true;
+  part.setPartState(new HeapDataOutputStream(str), false);
 }
 this.currentPart++;
   }
@@ -380,20 +377,18 @@ public class Message {
   v = null;
 }
 
-// create the HDOS with a flag telling it that it can keep any byte[] or 
ByteBuffers/ByteSources
-// passed to it.
+// Create the HDOS with a flag telling it that it can keep any byte[] or 
ByteBuffers/ByteSources
+// passed to it. Do NOT close the HeapDataOutputStream!
 HeapDataOutputStream hdos = new HeapDataOutputStream(this.chunkSize, v, 
true);
 try {
   BlobHelper.serializeTo(o, hdos);
-  this.messageModified = true;
-  Part part = this.partsList[this.currentPart];
-  part.setPartState(hdos, true);
-  this.currentPart++;
 } catch (IOException ex) {
   throw new SerializationException("failed serializing object", ex);
-} finally {
-  close(hdos);
 }
+this.messageModified = true;
+Part part = this.partsList[this.currentPart];
+part.setPartState(hdos, true);
+this.currentPart++;
   }
 
   private void serializeAndAddPart(Object o, boolean zipValues) {
@@ -406,18 +401,17 @@ public class Message {
   v = null;
 }
 
+// do NOT close the HeapDataOutputStream
 HeapDataOutputStream hdos = new HeapDataOutputStream(this.chunkSize, v);
 try {
   BlobHelper.serializeTo(o, hdos);
-  this.messageModified = true;
-  Part part = this.partsList[this.currentPart];
-  part.setPartState(hdos, true);
-  this.currentPart++;
 } catch (IOException ex) {
   throw new SerializationException("failed serializing object", ex);
-} finally {
-  close(hdos);
 }
+this.messageModified = true;
+Part part = this.partsList[this.currentPart];
+part.setPartState(hdos, true);
+this.currentPart++;
   }
 
   public void addIntPart(int v) {



geode-native git commit: GEODE-2741: Adds .NET 3.5 runtime for NUnit tests.

2017-05-23 Thread jbarrett
Repository: geode-native
Updated Branches:
  refs/heads/develop 2796a8955 -> d1710133a


GEODE-2741: Adds .NET 3.5 runtime for NUnit tests.


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

Branch: refs/heads/develop
Commit: d1710133a12ba674648fd33e7eb04f1f2dce93b7
Parents: 2796a89
Author: Jacob Barrett 
Authored: Tue May 23 14:43:10 2017 -0700
Committer: Jacob Barrett 
Committed: Tue May 23 14:43:10 2017 -0700

--
 packer/build-windows.json | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/geode-native/blob/d1710133/packer/build-windows.json
--
diff --git a/packer/build-windows.json b/packer/build-windows.json
index 4803e27..a35e0f7 100644
--- a/packer/build-windows.json
+++ b/packer/build-windows.json
@@ -48,6 +48,7 @@
 "choco install git.install -confirm",
 "# broken choco install activeperl -confirm",
 "choco install doxygen.install --allowEmptyChecksums -confirm",
+"choco install dotnet3.5 --confirm",
 "choco install nunit.install --version 2.6.4 -confirm",
 "choco install netfx-4.5.2-devpack --allowEmptyChecksums -confirm",
 "choco install nsis -confirm"



geode git commit: GEODE-2961: Fixed distinct multiple OR query returning partial results

2017-05-23 Thread nnag
Repository: geode
Updated Branches:
  refs/heads/develop 9c4086813 -> 456ee1576


GEODE-2961: Fixed distinct multiple OR query returning partial results


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

Branch: refs/heads/develop
Commit: 456ee15768fb08c8e1c8c5836479d27e1bc61835
Parents: 9c40868
Author: David Anuta 
Authored: Tue May 23 13:53:19 2017 -0700
Committer: nabarun 
Committed: Tue May 23 14:05:41 2017 -0700

--
 .../internal/AbstractGroupOrRangeJunction.java  |  2 +-
 .../query/internal/index/IndexUseJUnitTest.java | 16 
 2 files changed, 17 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/456ee157/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
index 5ed4d86..35f0290 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractGroupOrRangeJunction.java
@@ -325,7 +325,7 @@ public abstract class AbstractGroupOrRangeJunction extends 
AbstractCompiledValue
 if (intermediateResults == null) {
   intermediateResults = filterResults;
 } else if (isDistinct && !isConditioningNeeded) {
-  intermediateResults = filterResults;
+  intermediateResults.addAll(filterResults);
 } else {
   intermediateResults = QueryUtils.union(intermediateResults, 
filterResults, context);
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/456ee157/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
index c55f3f3..9c8756c 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
@@ -1366,6 +1366,22 @@ public class IndexUseJUnitTest {
   }
 
   @Test
+  public void queryWithOrClauseShouldReturnCorrectResultSet() throws Exception 
{
+String query =
+"SELECT DISTINCT p1.ID FROM /pos p1 where p1.ID IN SET (0,1) OR 
p1.status = 'active'";
+
+Query q = qs.newQuery(query);
+QueryObserverImpl observer = new QueryObserverImpl();
+QueryObserverHolder.setInstance(observer);
+SelectResults sr = (SelectResults) q.execute();
+if (!observer.isIndexesUsed)
+  fail("Index should have been used for query '" + q.getQueryString() + 
"'");
+
+assertEquals(sr.size(), 3);
+qs.removeIndexes();
+  }
+
+  @Test
   public void testIndexUseSelfJoin() throws Exception {
 String[] queries = {"SELECT DISTINCT * FROM /pos p1, /pos p2 where 
p1.status = p1.status",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.ID = p2.ID",



geode git commit: GEODE-2967: ResultCollection instead of StructCollection

2017-05-23 Thread nnag
Repository: geode
Updated Branches:
  refs/heads/develop db81d9280 -> 9c4086813


GEODE-2967: ResultCollection instead of StructCollection

* If we have one runtime iterator which is in case of self joins, 
ResultSet or ResultBags are created
* Otherwise StructBag or StructSets are used


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

Branch: refs/heads/develop
Commit: 9c408681364973096cf4192255ec3f40d86b70bd
Parents: db81d92
Author: nabarun 
Authored: Mon May 22 11:34:52 2017 -0700
Committer: nabarun 
Committed: Tue May 23 13:50:49 2017 -0700

--
 .../geode/cache/query/internal/QueryUtils.java  | 21 +
 .../query/internal/index/IndexUseJUnitTest.java | 47 +++-
 2 files changed, 58 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/9c408681/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
index bb0cbea..4d43729 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
@@ -23,6 +23,7 @@ import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.geode.cache.query.internal.types.ObjectTypeImpl;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.query.AmbiguousNameException;
@@ -806,8 +807,6 @@ public class QueryUtils {
* 
*/
   static StructType createStructTypeForRuntimeIterators(List runTimeIterators) 
{
-Support.Assert(runTimeIterators.size() > 1,
-"The number of Iterators passed should be greater than 1 to create a 
structSet");
 int len = runTimeIterators.size();
 String[] fieldNames = new String[len];
 String[] indexAlternativeFieldNames = new String[len];
@@ -886,10 +885,9 @@ public class QueryUtils {
   }
   return null;
 }
-
-Index lhsIndx = lhsIndxData.getIndex();
-Index rhsIndx = rhsIndxData.getIndex();
-if (((IndexProtocol) lhsIndx).isValid() && ((IndexProtocol) 
rhsIndx).isValid()) {
+IndexProtocol lhsIndx = lhsIndxData.getIndex();
+IndexProtocol rhsIndx = rhsIndxData.getIndex();
+if (lhsIndx.isValid() && rhsIndx.isValid()) {
   return new IndexData[] {lhsIndxData, rhsIndxData};
 }
 return null;
@@ -1463,10 +1461,15 @@ public class QueryUtils {
 }
   }
 }
-Support.Assert(totalFinalList.size() > 1,
-" Since we are in relationship index this itself means that we have 
atleast two RuntimeIterators");
+SelectResults returnSet;
 StructType stype = createStructTypeForRuntimeIterators(totalFinalList);
-SelectResults returnSet = QueryUtils.createStructCollection(context, 
stype);
+if (totalFinalList.size() == 1) {
+  returnSet = QueryUtils.createResultCollection(context, new 
ObjectTypeImpl(stype.getClass()));
+} else {
+  returnSet = QueryUtils.createStructCollection(context, stype);
+}
+
+
 RuntimeIterator[][] mappings = new RuntimeIterator[2][];
 mappings[0] = ich1.indexFieldToItrsMapping;
 mappings[1] = ich2.indexFieldToItrsMapping;

http://git-wip-us.apache.org/repos/asf/geode/blob/9c408681/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
index c865347..c55f3f3 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java
@@ -1367,7 +1367,7 @@ public class IndexUseJUnitTest {
 
   @Test
   public void testIndexUseSelfJoin() throws Exception {
-String[] queries = {"SELECT DISTINCT * FROM /pos p1, /pos p2 where 
p1.status = p2.status",
+String[] queries = {"SELECT DISTINCT * FROM /pos p1, /pos p2 where 
p1.status = p1.status",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.ID = p2.ID",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.P1.secId = 
p2.P1.secId",
 "SELECT DISTINCT * FROM /pos p1, /pos p2 where p1.status = p2.status 
and p1.status = 'active'",
@@ -1407,6 +1407,51 @@ public class IndexUseJ

geode git commit: GEODE-2951: Removed --pageSize option

2017-05-23 Thread boglesby
Repository: geode
Updated Branches:
  refs/heads/develop db028ac06 -> db81d9280


GEODE-2951: Removed --pageSize option


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

Branch: refs/heads/develop
Commit: db81d9280cf9b2286294ebcfa3ee7c3418da2ce2
Parents: db028ac
Author: Barry Oglesby 
Authored: Tue May 23 12:59:17 2017 -0700
Committer: Barry Oglesby 
Committed: Tue May 23 12:59:17 2017 -0700

--
 .../cache/lucene/internal/cli/LuceneIndexCommands.java   |  8 +---
 .../internal/cli/LuceneIndexCommandsJUnitTest.java   | 11 ++-
 2 files changed, 7 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/db81d928/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
--
diff --git 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
index 033fedc..5e17f6e 100755
--- 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
+++ 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
@@ -275,19 +275,13 @@ public class LuceneIndexCommands extends 
AbstractCommandsSupport {
   @CliOption(key = LuceneCliStrings.LUCENE_SEARCH_INDEX__LIMIT, 
unspecifiedDefaultValue = "-1",
   help = LuceneCliStrings.LUCENE_SEARCH_INDEX__LIMIT__HELP) final int 
limit,
 
-  @CliOption(key = LuceneCliStrings.LUCENE_SEARCH_INDEX__PAGE_SIZE,
-  unspecifiedDefaultValue = "-1",
-  help = LuceneCliStrings.LUCENE_SEARCH_INDEX__PAGE_SIZE__HELP) int 
pageSize,
-
   @CliOption(key = LuceneCliStrings.LUCENE_SEARCH_INDEX__KEYSONLY,
   unspecifiedDefaultValue = "false",
   help = LuceneCliStrings.LUCENE_SEARCH_INDEX__KEYSONLY__HELP) boolean 
keysOnly) {
 try {
   LuceneQueryInfo queryInfo =
   new LuceneQueryInfo(indexName, regionPath, queryString, 
defaultField, limit, keysOnly);
-  if (pageSize == -1) {
-pageSize = Integer.MAX_VALUE;
-  }
+  int pageSize = Integer.MAX_VALUE;
   searchResults = getSearchResults(queryInfo);
   return displayResults(pageSize, keysOnly);
 } catch (FunctionInvocationTargetException ignore) {

http://git-wip-us.apache.org/repos/asf/geode/blob/db81d928/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
--
diff --git 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
index 143e99d..66e15bb 100644
--- 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
+++ 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
@@ -50,6 +50,7 @@ import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
@@ -265,7 +266,7 @@ public class LuceneIndexCommandsJUnitTest {
 doReturn(queryResultsList).when(mockResultCollector).getResult();
 
 CommandResult result =
-(CommandResult) commands.searchIndex("index", "region", "Result1", 
"field1", -1, -1, false);
+(CommandResult) commands.searchIndex("index", "region", "Result1", 
"field1", -1, false);
 
 TabularResultData data = (TabularResultData) result.getResultData();
 
@@ -274,7 +275,7 @@ public class LuceneIndexCommandsJUnitTest {
 assertEquals(Arrays.asList("1.1", "1.2", "1.3"), 
data.retrieveAllValues("score"));
   }
 
-  @Test
+  @Ignore
   public void testSearchIndexWithPaging() throws Exception {
 final InternalCache mockCache = mock(InternalCache.class, "InternalCache");
 final Gfsh mockGfsh = mock(Gfsh.class);
@@ -306,7 +307,7 @@ public class LuceneIndexCommandsJUnitTest {
 String expectedPage3 = getPage(expectedResults, new int[] {4, 5});
 String expectedPage4 = getPage(expectedResults, new int[] {6});
 
-commands.searchIndex("index", "region", "Result1", "field1", -1, 2, false);
+commands.searchIndex("index", "region", "Result1", "field1", -1, false);
 verify(mockGfsh, time

geode git commit: GEODE-2943: Wildcard and space queries are now handled correctly

2017-05-23 Thread boglesby
Repository: geode
Updated Branches:
  refs/heads/develop 3cbb6fcd0 -> db028ac06


GEODE-2943: Wildcard and space queries are now handled correctly


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

Branch: refs/heads/develop
Commit: db028ac063a5701ea815ae58acbce269f1aa
Parents: 3cbb6fc
Author: Barry Oglesby 
Authored: Fri May 19 15:24:35 2017 -0700
Committer: Barry Oglesby 
Committed: Tue May 23 11:16:35 2017 -0700

--
 .../geode/internal/i18n/LocalizedStrings.java   |  2 ++
 .../lucene/internal/StringQueryProvider.java|  8 +++--
 .../cache/lucene/LuceneQueriesAccessorBase.java | 19 ++
 .../cache/lucene/LuceneQueriesDUnitTest.java| 37 
 .../cli/LuceneIndexCommandsDUnitTest.java   | 25 -
 5 files changed, 64 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/db028ac0/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java 
b/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
index 2fb8c8d..f19c4e7 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/i18n/LocalizedStrings.java
@@ -7692,6 +7692,8 @@ public class LocalizedStrings {
   new StringId(6657, "Lucene index {0} on region {1} already exists.");
   public static final StringId 
LuceneIndexCreation_IGNORING_DUPLICATE_INDEX_CREATION_0_ON_REGION_1 =
   new StringId(6658, "Ignoring duplicate index creation for Lucene index 
{0} on region {1}");
+  public static final StringId 
StringQueryProvider_PARSING_QUERY_0_FAILED_DUE_TO_1 =
+  new StringId(6659, "Parsing query {0} failed due to: {1}");
 
   /** Testing strings, messageId 9-9 **/
 

http://git-wip-us.apache.org/repos/asf/geode/blob/db028ac0/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
--
diff --git 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
index 7b72748..82dd10f 100644
--- 
a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
+++ 
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/StringQueryProvider.java
@@ -19,6 +19,7 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.queryparser.flexible.core.QueryNodeException;
 import org.apache.lucene.queryparser.flexible.standard.StandardQueryParser;
@@ -69,14 +70,17 @@ public class StringQueryProvider implements 
LuceneQueryProvider, DataSerializabl
   String[] fields = index.getFieldNames();
   LuceneIndexImpl indexImpl = (LuceneIndexImpl) index;
   StandardQueryParser parser = new 
StandardQueryParser(indexImpl.getAnalyzer());
+  parser.setAllowLeadingWildcard(true);
   try {
 luceneQuery = parser.parse(query, defaultField);
 if (logger.isDebugEnabled()) {
   logger.debug("User query " + query + " is parsed to be: " + 
luceneQuery);
 }
   } catch (QueryNodeException e) {
-logger.debug("Query node exception:" + query, e);
-throw new LuceneQueryException("Malformed lucene query: " + query, e);
+logger.warn("Caught the following exception attempting parse query '" 
+ query + "': ", e);
+throw new LuceneQueryException(
+
LocalizedStrings.StringQueryProvider_PARSING_QUERY_0_FAILED_DUE_TO_1
+.toLocalizedString("'" + query + "'", e.getMessage()));
   }
 }
 return luceneQuery;

http://git-wip-us.apache.org/repos/asf/geode/blob/db028ac0/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
--
diff --git 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
index 9568ab8..86993da 100644
--- 
a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
+++ 
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesAccessorBase.java
@@ -22,6 +22,7 @@ impo

geode git commit: GEODE-2918 Close cache when ConflictingPersistentDataException is thrown.

2017-05-23 Thread agingade
Repository: geode
Updated Branches:
  refs/heads/develop adbdf50f1 -> 3cbb6fcd0


GEODE-2918 Close cache when ConflictingPersistentDataException is thrown.

During disk recovery the ConflictingPersistentDataException is not handled
properly; it should have logged an error and closed the cache.
When it is handled incorrectly, the cache is in inconsistent state; causing
other operations to fail in unexpected ways.


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

Branch: refs/heads/develop
Commit: 3cbb6fcd08272dc6a5219e9092b34ae29eed79f3
Parents: adbdf50
Author: Anil 
Authored: Mon May 22 10:42:08 2017 -0700
Committer: Anil 
Committed: Tue May 23 10:18:23 2017 -0700

--
 .../apache/geode/cache/DiskAccessException.java |   9 +
 .../ConflictingPersistentDataException.java |   6 +-
 .../geode/internal/cache/LocalRegion.java   |   9 +-
 .../geode/internal/cache/ProxyBucketRegion.java |   5 +-
 .../persistence/PersistenceAdvisorImpl.java |  16 +-
 .../PersistentPartitionedRegionDUnitTest.java   | 169 ---
 .../PersistentPartitionedRegionTestBase.java|  82 -
 7 files changed, 262 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/3cbb6fcd/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java 
b/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
index fb640cd..51018a5 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/DiskAccessException.java
@@ -110,6 +110,15 @@ public class DiskAccessException extends 
CacheRuntimeException {
   }
 
   /**
+   * Constructs a new DiskAccessException with a message string.
+   *
+   * @param msg the message string
+   */
+  public DiskAccessException(String msg) {
+super(msg);
+  }
+
+  /**
* Returns true if this exception originated from a remote node.
*/
   public boolean isRemote() {

http://git-wip-us.apache.org/repos/asf/geode/blob/3cbb6fcd/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
 
b/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
index 9bf7234..3ea7c3e 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
@@ -15,7 +15,7 @@
 package org.apache.geode.cache.persistence;
 
 import org.apache.geode.GemFireException;
-import org.apache.geode.admin.AdminDistributedSystem;
+import org.apache.geode.cache.DiskAccessException;
 
 /**
  * Thrown when a member with persistence is recovering, and it discovers that 
the data it has on
@@ -28,7 +28,7 @@ import org.apache.geode.admin.AdminDistributedSystem;
  * 
  * @since GemFire 6.5
  */
-public class ConflictingPersistentDataException extends GemFireException {
+public class ConflictingPersistentDataException extends DiskAccessException {
 
   private static final long serialVersionUID = -2629287782021455875L;
 
@@ -48,6 +48,4 @@ public class ConflictingPersistentDataException extends 
GemFireException {
 super(cause);
   }
 
-
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/3cbb6fcd/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index 8e7ec68..4446d48 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -81,6 +81,7 @@ import org.apache.geode.cache.control.ResourceManager;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.cache.partition.PartitionRegionHelper;
+import org.apache.geode.cache.persistence.ConflictingPersistentDataException;
 import org.apache.geode.cache.query.FunctionDomainException;
 import org.apache.geode.cache.query.Index;
 import org.apache.geode.cache.query.IndexMaintenanceException;
@@ -6595,8

geode-native git commit: GEODE-2741: Update Linux build to JDK 8 update 131.

2017-05-23 Thread jbarrett
Repository: geode-native
Updated Branches:
  refs/heads/develop cb9c4e21f -> 2796a8955


GEODE-2741: Update Linux build to JDK 8 update 131.

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

Branch: refs/heads/develop
Commit: 2796a8955e2f23a908f696a083784ebf72fe7520
Parents: cb9c4e2
Author: Jacob Barrett 
Authored: Tue May 23 09:58:05 2017 -0700
Committer: Jacob Barrett 
Committed: Tue May 23 09:58:05 2017 -0700

--
 packer/rhel/install-jdk-1.8.sh   |  2 +-
 packer/windows/buildenv.bat  | 28 ++--
 packer/windows/sshd-recovery.bat | 28 ++--
 3 files changed, 29 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode-native/blob/2796a895/packer/rhel/install-jdk-1.8.sh
--
diff --git a/packer/rhel/install-jdk-1.8.sh b/packer/rhel/install-jdk-1.8.sh
index 1a93b64..016ea05 100644
--- a/packer/rhel/install-jdk-1.8.sh
+++ b/packer/rhel/install-jdk-1.8.sh
@@ -20,7 +20,7 @@ set -x -e -o pipefail
 tmp=`mktemp -d`
 
 curl -o ${tmp}/jdk.rpm -v -j -k -L -H "Cookie: 
oraclelicense=accept-securebackup-cookie" \
-http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm
+
http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
 
 yum install -y ${tmp}/jdk.rpm
 

http://git-wip-us.apache.org/repos/asf/geode-native/blob/2796a895/packer/windows/buildenv.bat
--
diff --git a/packer/windows/buildenv.bat b/packer/windows/buildenv.bat
index 029dc71..fa02cf3 100644
--- a/packer/windows/buildenv.bat
+++ b/packer/windows/buildenv.bat
@@ -1,17 +1,17 @@
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements.  See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License.  You may obtain a copy of the License at
-rem 
-rem  http://www.apache.org/licenses/LICENSE-2.0
-rem 
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
+@rem Licensed to the Apache Software Foundation (ASF) under one or more
+@rem contributor license agreements.  See the NOTICE file distributed with
+@rem this work for additional information regarding copyright ownership.
+@rem The ASF licenses this file to You under the Apache License, Version 2.0
+@rem (the "License"); you may not use this file except in compliance with
+@rem the License.  You may obtain a copy of the License at
+@rem 
+@rem  http://www.apache.org/licenses/LICENSE-2.0
+@rem 
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
 
 @rem Fixup ENV issues with SSH
 set APPDATA=C:\Users\build\AppData\Roaming

http://git-wip-us.apache.org/repos/asf/geode-native/blob/2796a895/packer/windows/sshd-recovery.bat
--
diff --git a/packer/windows/sshd-recovery.bat b/packer/windows/sshd-recovery.bat
index da49c7b..2b278f0 100644
--- a/packer/windows/sshd-recovery.bat
+++ b/packer/windows/sshd-recovery.bat
@@ -1,17 +1,17 @@
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements.  See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License.  You may obtain a copy of the License at
-rem 
-rem  http://www.apache.org/licenses/LICENSE-2.0
-rem 
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific langua

[3/3] geode git commit: GEODE-2420: Renamed methods that had signatures changed

2017-05-23 Thread khowe
GEODE-2420: Renamed methods that had signatures changed

Updated javadocs for the renamed methods to explicitly call out the
exceptions thrown


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

Branch: refs/heads/develop
Commit: adbdf50f1a5986e5c75b47184f547a3e0d78f0e2
Parents: c5962aa
Author: Ken Howe 
Authored: Tue May 23 09:40:27 2017 -0700
Committer: Ken Howe 
Committed: Tue May 23 09:42:36 2017 -0700

--
 .../internal/cli/commands/ExportLogsCommand.java   | 17 +
 .../cli/commands/ExportLogsCommandTest.java|  9 -
 .../cli/commands/ExportLogsFileSizeLimitTest.java  |  7 +++
 3 files changed, 16 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/adbdf50f/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
index ab93f94..b824bc9 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
@@ -142,7 +142,7 @@ public class ExportLogsCommand implements CommandMarker {
 // The sum of the estimated export sizes from each member should not 
exceed the
 // disk available on the locator
 try {
-  sizeCheckIsEnabledAndWithinDiskSpaceOfMember("locator", 
parseFileSizeLimit(fileSizeLimit),
+  checkIfExportLogsOverflowsDisk("locator", 
parseFileSizeLimit(fileSizeLimit),
   totalEstimatedExportSize, getLocalDiskAvailable());
 } catch (ManagementException e) {
   return ResultBuilder.createUserErrorResult(e.getMessage());
@@ -201,8 +201,7 @@ public class ExportLogsCommand implements CommandMarker {
   logger.info("Zipping into: " + exportedLogsZipFile.toString());
   ZipUtils.zipDirectory(exportedLogsDir, exportedLogsZipFile);
   try {
-isFileSizeCheckEnabledAndWithinLimit(parseFileSizeLimit(fileSizeLimit),
-exportedLogsZipFile.toFile());
+checkFileSizeWithinLimit(parseFileSizeLimit(fileSizeLimit), 
exportedLogsZipFile.toFile());
   } catch (ManagementException e) {
 FileUtils.deleteQuietly(exportedLogsZipFile.toFile());
 return ResultBuilder.createUserErrorResult(e.getMessage());
@@ -263,9 +262,10 @@ public class ExportLogsCommand implements CommandMarker {
   }
 
   /**
-   * Throws ManagementException if file size is over fileSizeLimit bytes
+   * @throws ManagementException if checking is enabled (fileSizeLimit > 0) 
and file size is over
+   * fileSizeLimit bytes
*/
-  void isFileSizeCheckEnabledAndWithinLimit(long fileSizeLimitBytes, File 
file) {
+  void checkFileSizeWithinLimit(long fileSizeLimitBytes, File file) {
 if (fileSizeLimitBytes > 0) {
   if (FileUtils.sizeOf(file) > fileSizeLimitBytes) {
 StringBuilder sb = new StringBuilder();
@@ -280,10 +280,11 @@ public class ExportLogsCommand implements CommandMarker {
 
 
   /**
-   * Throws ManagementException if export file size checking is enabled and 
the space required on a
-   * cluster member to filter and zip up files to be exported exceeds the disk 
space available
+   * @throws ManagementException if export file size checking is enabled 
(fileSizeLimit > 0) and the
+   * space required on a cluster member to filter and zip up files to 
be exported exceeds
+   * the disk space available
*/
-  void sizeCheckIsEnabledAndWithinDiskSpaceOfMember(String memberName, long 
fileSizeLimitBytes,
+  void checkIfExportLogsOverflowsDisk(String memberName, long 
fileSizeLimitBytes,
   long estimatedSize, long diskAvailable) {
 if (fileSizeLimitBytes > 0) {
   StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/geode/blob/adbdf50f/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
index a91..16549e7 100644
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
+++ 
b/geode-co

[2/3] geode git commit: GEODE-2420: Enable export logs size estimation and user warning

2017-05-23 Thread khowe
GEODE-2420: Enable export logs size estimation and user warning

Adds 'export logs' option, --file-limit-size, to allow user to set
maximun size of the epxorted logs zip file.

When size checking is enabled (file-limit-size > 0) then the check
will also prevent filling up the disk on each member while consolidating
and filtering the logs.


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

Branch: refs/heads/develop
Commit: 3ce3437ddaf9c3614b11f066011ed33664259e9f
Parents: 18db4bf
Author: Ken Howe 
Authored: Fri May 5 14:04:11 2017 -0700
Committer: Ken Howe 
Committed: Tue May 23 08:16:17 2017 -0700

--
 .../membership/InternalDistributedMember.java   |  22 +-
 .../cli/commands/ExportLogsCommand.java | 277 ---
 .../cli/functions/SizeExportLogsFunction.java   |   4 +-
 .../management/internal/cli/util/LogSizer.java  |   6 +-
 .../cli/commands/ExportLogsCommandTest.java | 225 ++-
 .../cli/commands/ExportLogsDUnitTest.java   |   7 +
 .../commands/ExportLogsFileSizeLimitTest.java   |   2 +-
 .../cli/commands/ExportLogsTestSuite.java   |  10 +-
 .../SizeExportLogsFunctionCacheTest.java|  12 +-
 9 files changed, 436 insertions(+), 129 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/3ce3437d/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
index 7170f20..6982d31 100755
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
@@ -190,8 +190,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* string).
* 
*
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 
*
* 
* @param i the hostname, must be for the current host
@@ -228,8 +228,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* string).
* 
*
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 
*
* 
* @param i the hostname, must be for the current host
@@ -264,8 +264,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* LonerDistributionManager.
* 
*
-   * < b> [bruce]DO NOT USE THIS METHOD TO CREATE ANYTHING OTHER THAN A LONER 
ID WITHOUT TALKING TO
-   * ME FIRST. IT DOES NOT PROPERLY INITIALIZE THE ID. 
+   * < b> DO NOT USE THIS METHOD TO CREATE ANYTHING OTHER THAN A LONER ID. IT 
DOES NOT PROPERLY
+   * INITIALIZE THE ID. 
*
* @param host the hostname, must be for the current host
* @param p the membership listening port
@@ -298,8 +298,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* address).
* 
*
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 
*
* 
* @param i the hostname, must be for the current host
@@ -314,8 +314,8 @@ public class InternalDistributedMember implements 
DistributedMember, Externaliza
* Create a InternalDistributedMember as defined by the given address.
* 
* 
-   *  [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs 
FOR USE IN THE PRODUCT.
-   * IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED FOR P2P FUNCTIONALITY. 

+   *  THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR USE 
IN THE PRODUCT. IT
+   * DOES NOT PROPERLY INITIALIZE ATTRIB

[1/3] geode git commit: GEODE-2420: Resolve conflicts with recent checkin

2017-05-23 Thread khowe
Repository: geode
Updated Branches:
  refs/heads/develop 18db4bf38 -> adbdf50f1


GEODE-2420: Resolve conflicts with recent checkin

Use InternalCache instead of GemnFireCachImpl.

Refactored product and tests
- Combined LogExporter and LogSizer.
- Remove classes no longer needed


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

Branch: refs/heads/develop
Commit: c5962aa9308764bb964e4b4160e969f2dfae062d
Parents: 3ce3437
Author: Ken Howe 
Authored: Mon May 15 15:00:00 2017 -0700
Committer: Ken Howe 
Committed: Tue May 23 08:16:17 2017 -0700

--
 .../cli/commands/ExportLogsCommand.java | 199 ---
 .../cli/functions/ExportLogsFunction.java   |   3 +-
 .../cli/functions/ExportedLogsSizeInfo.java | 105 --
 .../cli/functions/SizeExportLogsFunction.java   |  29 ++-
 .../internal/cli/i18n/CliStrings.java   |   2 +-
 .../internal/cli/util/LogExporter.java  |  63 +-
 .../management/internal/cli/util/LogSizer.java  | 118 ---
 .../cli/commands/ExportLogsCommandTest.java | 121 ++-
 .../cli/commands/ExportLogsDUnitTest.java   |  21 +-
 .../commands/ExportLogsFileSizeLimitTest.java   |   4 +-
 .../cli/commands/ExportLogsTestSuite.java   |  10 +-
 .../cli/functions/ExportedLogsSizeInfoTest.java | 133 -
 .../SizeExportLogsFunctionCacheTest.java| 174 
 .../functions/SizeExportLogsFunctionTest.java   | 178 +
 .../cli/functions/SizeExportLogsTestSuite.java  |  29 ---
 .../internal/cli/util/LogExporterTest.java  |   6 +-
 .../internal/cli/util/LogSizerTest.java |  17 +-
 17 files changed, 376 insertions(+), 836 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/c5962aa9/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
--
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
index af681da..ab93f94 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
@@ -44,7 +44,6 @@ import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.CliUtil;
 import org.apache.geode.management.internal.cli.functions.ExportLogsFunction;
-import org.apache.geode.management.internal.cli.functions.ExportedLogsSizeInfo;
 import 
org.apache.geode.management.internal.cli.functions.SizeExportLogsFunction;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.ResultBuilder;
@@ -65,7 +64,7 @@ public class ExportLogsCommand implements CommandMarker {
 
   private static final Pattern DISK_SPACE_LIMIT_PATTERN = 
Pattern.compile("(\\d+)([kmgtKMGT]?)");
 
-  private InternalCache getCache() {
+  InternalCache getCache() {
 return (InternalCache) CacheFactory.getAnyInstance();
   }
 
@@ -129,106 +128,88 @@ public class ExportLogsCommand implements CommandMarker {
 
   List results = (List) estimateLogSize(args, 
server).getResult();
   long estimatedSize = 0;
-  long diskAvailable = 0;
-  long diskSize = 0;
   if (!results.isEmpty()) {
 List res = (List) results.get(0);
-if (res.get(0) instanceof ExportedLogsSizeInfo) {
-  ExportedLogsSizeInfo sizeInfo = (ExportedLogsSizeInfo) 
res.get(0);
-  estimatedSize = sizeInfo.getLogsSize();
-  diskAvailable = sizeInfo.getDiskAvailable();
-  diskSize = sizeInfo.getDiskSize();
+if (res.get(0) instanceof Long) {
+  estimatedSize = (Long) res.get(0);
 }
   }
   logger.info("Received estimated export size from member {}: {}", 
server.getId(),
   estimatedSize);
   totalEstimatedExportSize += estimatedSize;
-
-  // If export size checking is enabled, then estimated size on each 
member shouldn't exceed
-  // the available disk on that member
-  try {
-isSizeCheckEnabledAndWithinDiskSpaceOfMember(server.getName(),
-parseFileSizeLimit(fileSizeLimit), estimatedSize, 
diskAvailable, diskSize);
-  } catch (ManagementException e) {
-return ResultBuilder.createUserErrorResult(e.getMessage(

geode-native git commit: GEODE-2741: Update Windows build to use Visual Studio 2015 / VC14.

2017-05-23 Thread jbarrett
Repository: geode-native
Updated Branches:
  refs/heads/develop 9d840acef -> cb9c4e21f


GEODE-2741: Update Windows build to use Visual Studio 2015 / VC14.


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

Branch: refs/heads/develop
Commit: cb9c4e21f696236e84d9228874a307083b5788ba
Parents: 9d840ac
Author: Jacob Barrett 
Authored: Tue May 23 08:05:19 2017 -0700
Committer: Jacob Barrett 
Committed: Tue May 23 08:05:19 2017 -0700

--
 packer/windows/buildenv.bat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/geode-native/blob/cb9c4e21/packer/windows/buildenv.bat
--
diff --git a/packer/windows/buildenv.bat b/packer/windows/buildenv.bat
index 203e811..029dc71 100644
--- a/packer/windows/buildenv.bat
+++ b/packer/windows/buildenv.bat
@@ -21,5 +21,5 @@ set TMP=C:\Users\build\AppData\Local\Temp\3
 if not exist %TEMP% mkdir %TEMP%
 
 @rem Setup VC
-call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %*
+call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %*