[geode] branch develop updated: GEODE-3540: unable to gfsh destroy gateway-sender (#1414)

2018-02-08 Thread sai_boorlagadda
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new bbea69a  GEODE-3540: unable to gfsh destroy gateway-sender (#1414)
bbea69a is described below

commit bbea69a1e0c153e28f5958a58387b80f70fcdc89
Author: Sai Boorlagadda 
AuthorDate: Thu Feb 8 15:45:39 2018 -0800

GEODE-3540: unable to gfsh destroy gateway-sender (#1414)

   GW sender bean is not unregistered during destroy command which
   is why it appears when you list gateways after destroy. This fix is to
   unregistered the MX bean from SystemManagementService
---
 .../geode/internal/cache/GemFireCacheImpl.java |   3 +
 .../geode/management/JMXNotificationType.java  |   7 ++
 .../management/internal/ManagementConstants.java   |   1 +
 .../internal/beans/ManagementAdapter.java  |  22 +
 .../internal/beans/ManagementListener.java |   4 +
 .../DestroyGatewaySenderCommandDUnitTest.java  | 106 +
 6 files changed, 143 insertions(+)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index 0db245d..f87b4e9 100755
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -3880,6 +3880,9 @@ public class GemFireCacheImpl implements InternalCache, 
InternalClientCache, Has
 this.allGatewaySenders = Collections.unmodifiableSet(newSenders);
   }
 }
+if (!(sender.getRemoteDSId() < 0)) {
+  this.system.handleResourceEvent(ResourceEvent.GATEWAYSENDER_REMOVE, 
sender);
+}
   }
 
   @Override
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/JMXNotificationType.java 
b/geode-core/src/main/java/org/apache/geode/management/JMXNotificationType.java
index 74f94a7..351a3a6 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/JMXNotificationType.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/JMXNotificationType.java
@@ -159,6 +159,13 @@ public interface JMXNotificationType {
   DistributionConfig.GEMFIRE_PREFIX + 
"distributedsystem.gateway.sender.resumed";
 
   /**
+   * Notification type which indicates that a gateway sender is removed 
+   * The value of this type string is 
gemfire.distributedsystem.gateway.sender.removed.
+   */
+  public static final String GATEWAY_SENDER_REMOVED =
+  DistributionConfig.GEMFIRE_PREFIX + 
"distributedsystem.gateway.sender.removed";
+
+  /**
* Notification type which indicates that an async queue is created 
* The value of this type string is
* ggemfire.distributedsystem.asycn.event.queue.created.
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementConstants.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementConstants.java
index de9687a..8f8ad7c 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementConstants.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementConstants.java
@@ -180,6 +180,7 @@ public interface ManagementConstants {
   String GATEWAY_SENDER_STOPPED_PREFIX = "GatewaySender Stopped in the VM ";
   String GATEWAY_SENDER_PAUSED_PREFIX = "GatewaySender Paused in the VM ";
   String GATEWAY_SENDER_RESUMED_PREFIX = "GatewaySender Resumed in the VM ";
+  String GATEWAY_SENDER_REMOVED_PREFIX = "GatewaySender Removed in the VM ";
 
   String GATEWAY_RECEIVER_CREATED_PREFIX = "GatewayReceiver Created in the VM 
";
   String GATEWAY_RECEIVER_STARTED_PREFIX = "GatewayReceiver Started in the VM 
";
diff --git 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
index 405cb02..171256e 100644
--- 
a/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
+++ 
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
@@ -963,6 +963,28 @@ public class ManagementAdapter {
 memberLevelNotifEmitter.sendNotification(notification);
   }
 
+  public void handleGatewaySenderRemoved(GatewaySender sender) throws 
ManagementException {
+if (!isServiceInitialised("handleGatewaySenderRemoved")) {
+  return;
+}
+if ((sender.getRemoteDSId() < 0)) {
+  return;
+}
+
+GatewaySenderMBean bean =
+(GatewaySenderMBean) 
service.getLocalGatewaySenderMXBean(sender.getId());
+bean.stopMonitor();
+
+ObjectName gatewaySenderName = MBeanJMXAdapter.getGatewaySenderMBeanName(
+internalCache.getDistributedSystem().getDistributedMember(), 

[geode] branch feature/GEODE-3643 updated: GEODE-3643: Add function execution on specific member

2018-02-08 Thread bschuchardt
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-3643
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3643 by this 
push:
 new 4094543  GEODE-3643: Add function execution on specific member
4094543 is described below

commit 40945432cb527511dfe03286d78fda26c4dd0187
Author: Bruce Schuchardt 
AuthorDate: Thu Feb 8 14:53:44 2018 -0800

GEODE-3643: Add function execution on specific member

fixing a dumb test failure
---
 .../org/apache/geode/distributed/internal/LonerDistributionManager.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
index 9d94001..c5b2f41 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
@@ -143,7 +143,7 @@ public class LonerDistributionManager implements 
DistributionManager {
 return id;
   }
 }
-if (Objects.equals(localAddress.getName(), localAddress)) {
+if (Objects.equals(localAddress.getName(), name)) {
   return localAddress;
 }
 return null;

-- 
To stop receiving notification emails like this one, please contact
bschucha...@apache.org.


[geode] branch feature/GEODE-3643 updated: GEODE-3643: Add function execution on specific member

2018-02-08 Thread bschuchardt
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-3643
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3643 by this 
push:
 new 026c326  GEODE-3643: Add function execution on specific member
026c326 is described below

commit 026c32604e932659c348a5f1078a972c98ef8ef9
Author: Bruce Schuchardt 
AuthorDate: Thu Feb 8 13:52:43 2018 -0800

GEODE-3643: Add function execution on specific member

fixups from review comments
---
 .../internal/ClusterDistributionManager.java |  5 +++--
 .../internal/LonerDistributionManager.java   | 20 ++--
 ...ecuteFunctionOnMemberRequestOperationHandler.java |  6 +++---
 ...ecuteFunctionOnRegionRequestOperationHandler.java |  7 +--
 ...a => ExecuteFunctionOnMemberIntegrationTest.java} |  2 +-
 ...a => ExecuteFunctionOnRegionIntegrationTest.java} |  2 +-
 ...tionOnMemberRequestOperationHandlerJUnitTest.java | 14 +++---
 7 files changed, 30 insertions(+), 26 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java
index 9c8995b..ba87f52 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java
@@ -27,6 +27,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ConcurrentHashMap;
@@ -1454,11 +1455,11 @@ public class ClusterDistributionManager implements 
DistributionManager {
   @Override
   public DistributedMember getMemberWithName(String name) {
 for (DistributedMember id : members.values()) {
-  if (id.getName() != null && id.getName().equals(name)) {
+  if (Objects.equals(id.getName(), name)) {
 return id;
   }
 }
-if (localAddress.getName() != null && localAddress.getName().equals(name)) 
{
+if (Objects.equals(localAddress, name)) {
   return localAddress;
 }
 return null;
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
index 2f8c4fc..9d94001 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java
@@ -62,8 +62,8 @@ public class LonerDistributionManager implements 
DistributionManager {
   public LonerDistributionManager(InternalDistributedSystem system, 
InternalLogWriter logger) {
 this.system = system;
 this.logger = logger;
-this.id = generateMemberId();
-this.allIds = Collections.singleton(id);
+this.localAddress = generateMemberId();
+this.allIds = Collections.singleton(localAddress);
 this.viewMembers = new ArrayList(allIds);
 DistributionStats.enableClockStats = 
this.system.getConfig().getEnableTimeStatistics();
   }
@@ -83,7 +83,7 @@ public class LonerDistributionManager implements 
DistributionManager {
 }
   }
 
-  private final InternalDistributedMember id;
+  private final InternalDistributedMember localAddress;
 
   /*
* static { // Make the id a little unique String host; try { host =
@@ -112,7 +112,7 @@ public class LonerDistributionManager implements 
DistributionManager {
   }
 
   public InternalDistributedMember getDistributionManagerId() {
-return id;
+return localAddress;
   }
 
   public Set getDistributionManagerIds() {
@@ -139,12 +139,12 @@ public class LonerDistributionManager implements 
DistributionManager {
   @Override
   public DistributedMember getMemberWithName(String name) {
 for (DistributedMember id : canonicalIds.values()) {
-  if (id.getName() != null && id.getName().equals(name)) {
+  if (Objects.equals(id.getName(), name)) {
 return id;
   }
 }
-if (id.getName() != null && id.getName().equals(name)) {
-  return id;
+if (Objects.equals(localAddress.getName(), localAddress)) {
+  return localAddress;
 }
 return null;
   }
@@ -1167,17 +1167,17 @@ public class LonerDistributionManager implements 
DistributionManager {
 
   /** Returns count of members filling the specified role */
   public int getRoleCount(Role role) {
-return id.getRoles().contains(role) ? 1 : 0;
+return localAddress.getRoles().contains(role) ? 1 : 0;
   }
 
   /** Returns true if at least one member is filling the specified role */
   public boolean isRolePresent(Role role) {
-return 

[geode] branch develop updated: GEODE-2569: Avoid unhelpful log message via a null check. (#1404)

2018-02-08 Thread pivotalsarge
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 17654b9  GEODE-2569: Avoid unhelpful log message via a null check. 
(#1404)
17654b9 is described below

commit 17654b9be859c59a7d26362d4a53851d3515a3ef
Author: Michael "Sarge" Dodge 
AuthorDate: Thu Feb 8 12:42:28 2018 -0800

GEODE-2569: Avoid unhelpful log message via a null check. (#1404)

- Since the default for "ack-severe-alert-threshold"
  is zero, there is a code path where the target member
  is null at the point of logging. So check for null.
---
 .../main/java/org/apache/geode/internal/tcp/ConnectionTable.java  | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java 
b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
index f7d104c..693e4f1 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java
@@ -1255,9 +1255,11 @@ public class ConnectionTable {
 long now = System.currentTimeMillis();
 if (!severeAlertIssued && ackSATimeout > 0 && startTime + ackTimeout < 
now) {
   if (startTime + ackTimeout + ackSATimeout < now) {
-logger.fatal(LocalizedMessage.create(
-
LocalizedStrings.ConnectionTable_UNABLE_TO_FORM_A_TCPIP_CONNECTION_TO_0_IN_OVER_1_SECONDS,
-new Object[] {targetMember, (ackSATimeout + ackTimeout) / 
1000}));
+if (targetMember != null) {
+  logger.fatal(LocalizedMessage.create(
+  
LocalizedStrings.ConnectionTable_UNABLE_TO_FORM_A_TCPIP_CONNECTION_TO_0_IN_OVER_1_SECONDS,
+  new Object[] {targetMember, (ackSATimeout + ackTimeout) / 
1000}));
+}
 severeAlertIssued = true;
   } else if (!suspected) {
 logger.warn(LocalizedMessage.create(

-- 
To stop receiving notification emails like this one, please contact
pivotalsa...@apache.org.


[geode] branch develop updated: GEODE-4583: remove getAnyInstance calls (#1407)

2018-02-08 Thread dschneider
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new b1ba8fd  GEODE-4583: remove getAnyInstance calls (#1407)
b1ba8fd is described below

commit b1ba8fd5c94d6f97db7d80ebf7d557f8e720dbae
Author: Darrel Schneider 
AuthorDate: Thu Feb 8 12:25:58 2018 -0800

GEODE-4583: remove getAnyInstance calls (#1407)

getAnyInstance was being used to get the old logger.
Now the class declares a static log4j logger and uses it.
---
 .../geode/internal/shared/NativeCallsJNAImpl.java  | 46 +-
 1 file changed, 18 insertions(+), 28 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCallsJNAImpl.java
 
b/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCallsJNAImpl.java
index f6204f4..40f3f89 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCallsJNAImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCallsJNAImpl.java
@@ -40,10 +40,11 @@ import com.sun.jna.Pointer;
 import com.sun.jna.Structure;
 import com.sun.jna.ptr.IntByReference;
 import com.sun.jna.win32.StdCallLibrary;
+import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.SystemFailure;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.cache.DiskStoreImpl;
+import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.process.signal.Signal;
 
 
@@ -59,6 +60,8 @@ import org.apache.geode.internal.process.signal.Signal;
  */
 public class NativeCallsJNAImpl {
 
+  private static final Logger logger = LogService.getLogger();
+
   // no instance allowed
   private NativeCallsJNAImpl() {}
 
@@ -281,20 +284,13 @@ public class NativeCallsJNAImpl {
 
 @Override
 public void preBlow(String path, long maxSize, boolean preAllocate) throws 
IOException {
-  final org.apache.geode.LogWriter logger;
-  if (InternalDistributedSystem.getAnyInstance() != null) {
-logger = InternalDistributedSystem.getAnyInstance().getLogWriter();
-  } else {
-logger = null;
-  }
-
-  if (logger != null && logger.fineEnabled()) {
-logger.fine("DEBUG preBlow called for path = " + path);
+  if (logger.isDebugEnabled()) {
+logger.debug("DEBUG preBlow called for path = " + path);
   }
   if (!preAllocate || !hasFallocate(path)) {
 super.preBlow(path, maxSize, preAllocate);
-if (logger != null && logger.fineEnabled()) {
-  logger.fine("DEBUG preBlow super.preBlow 1 called for path = " + 
path);
+if (logger.isDebugEnabled()) {
+  logger.debug("DEBUG preBlow super.preBlow 1 called for path = " + 
path);
 }
 return;
   }
@@ -304,8 +300,8 @@ public class NativeCallsJNAImpl {
 fd = createFD(path, 00644);
 if (!isOnLocalFileSystem(path)) {
   super.preBlow(path, maxSize, preAllocate);
-  if (logger != null && logger.fineEnabled()) {
-logger.fine("DEBUG preBlow super.preBlow 2 called as path = " + 
path
+  if (logger.isDebugEnabled()) {
+logger.debug("DEBUG preBlow super.preBlow 2 called as path = " + 
path
 + " not on local file system");
   }
   if (DiskStoreImpl.TEST_NO_FALLOC_DIRS != null) {
@@ -317,13 +313,13 @@ public class NativeCallsJNAImpl {
 if (DiskStoreImpl.TEST_CHK_FALLOC_DIRS != null) {
   DiskStoreImpl.TEST_CHK_FALLOC_DIRS.add(path);
 }
-if (logger != null && logger.fineEnabled()) {
-  logger.fine("DEBUG preBlow posix_fallocate called for path = " + path
+if (logger.isDebugEnabled()) {
+  logger.debug("DEBUG preBlow posix_fallocate called for path = " + 
path
   + " and ret = 0 maxsize = " + maxSize);
 }
   } catch (LastErrorException le) {
-if (logger != null && logger.fineEnabled()) {
-  logger.fine("DEBUG preBlow posix_fallocate called for path = " + 
path + " and ret = "
+if (logger.isDebugEnabled()) {
+  logger.debug("DEBUG preBlow posix_fallocate called for path = " + 
path + " and ret = "
   + le.getErrorCode() + " maxsize = " + maxSize);
 }
 // check for no space left on device
@@ -343,8 +339,8 @@ public class NativeCallsJNAImpl {
 }
 if (unknownError) {
   super.preBlow(path, maxSize, preAllocate);
-  if (logger != null && logger.infoEnabled()) {
-logger.fine("DEBUG preBlow super.preBlow 3 called for path = " + 
path);
+  if (logger.isDebugEnabled()) {
+logger.debug("DEBUG preBlow super.preBlow 3 called for path = " + 
path);
   }
 }
   }
@@ -675,12 +671,6 @@ public class 

[geode-examples] branch develop updated: GEODE-4253: Add an example for expiration. (#44)

2018-02-08 Thread pivotalsarge
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new e28850d  GEODE-4253: Add an example for expiration. (#44)
e28850d is described below

commit e28850ddd6cd6d77dfadac0719c8cab90d7900d1
Author: Michael "Sarge" Dodge 
AuthorDate: Thu Feb 8 12:07:36 2018 -0800

GEODE-4253: Add an example for expiration. (#44)
---
 README.md  |  2 +-
 expiration/README.md   | 54 +
 expiration/scripts/start.gfsh  | 26 +++
 expiration/scripts/stop.gfsh   | 19 +
 .../apache/geode_examples/expiration/Example.java  | 88 ++
 settings.gradle|  1 +
 6 files changed, 189 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 952dc1f..e2d67f0 100644
--- a/README.md
+++ b/README.md
@@ -78,7 +78,7 @@ tutorial.
 *  Continuous Querying
 *  Transactions
 *  [Eviction](eviction/README.md)
-*  Expiration
+*  [Expiration](expiration/README.md)
 *  Overflow
 *  Security
 *  Off-heap
diff --git a/expiration/README.md b/expiration/README.md
new file mode 100644
index 000..74edb95
--- /dev/null
+++ b/expiration/README.md
@@ -0,0 +1,54 @@
+
+
+# Geode Expiration Example
+
+This is a simple example that demonstrates expiration of entries from a 
region. This can be used to
+prevent stale entries from lingering in a region. This also allows control 
over the system resources
+consumed by any given region.
+
+A region is a collection of entries which are tuples of key and value. When 
statistics-gathering is
+enabled, the region maintains access and modification times for each entry. 
With entry expiration
+configured, the region will enforce time-to-live limits on entries. When the 
time since access or
+modification exceeds the configured duration, the region will take an action 
to expire the entry.
+The region can either destroy expired entries in their entirety or invalidate 
expired entries by
+removing their values.
+
+This example creates a region where the entries are destroyed after ten 
seconds without being
+updated. The example first puts ten random integers into the region. Then the 
example loops,
+printing the number of entries in the region, until the region is empty.
+
+This example assumes you have installed Java and Geode.
+
+## Steps
+
+1. From the `geode-examples/expiration` directory, build the example and
+   run unit tests.
+
+$ ../gradlew build
+
+2. Next start a locator, start a server, and create a region.
+
+$ gfsh run --file=scripts/start.gfsh
+
+3. Run the example to demonstrate expiration.
+
+$ ../gradlew run
+
+4. Shut down the system.
+
+$ gfsh run --file=scripts/stop.gfsh
diff --git a/expiration/scripts/start.gfsh b/expiration/scripts/start.gfsh
new file mode 100755
index 000..e06d1d2
--- /dev/null
+++ b/expiration/scripts/start.gfsh
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+start locator --name=locator --bind-address=127.0.0.1
+start server --name=server1 --locators=127.0.0.1[10334] --server-port=0 
--classpath=../build/classes/main
+start server --name=server2 --locators=127.0.0.1[10334] --server-port=0 
--classpath=../build/classes/main
+list members
+
+create region --name=example-region --type=REPLICATE --skip-if-exists=true \
+--enable-statistics=true \
+--entry-time-to-live-expiration=10 
--entry-time-to-live-expiration-action=local-destroy
+describe region --name=example-region
diff --git a/expiration/scripts/stop.gfsh b/expiration/scripts/stop.gfsh
new file mode 100755
index 000..15cd93c
--- /dev/null
+++ b/expiration/scripts/stop.gfsh
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you 

[geode-native] branch develop updated: GEODE-4507: add whitespace after header.

2018-02-08 Thread echobravo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 28e47a8  GEODE-4507: add whitespace after header.
28e47a8 is described below

commit 28e47a8b4e041a4ad49212f486f0494c8c9c5fc3
Author: Ernest Burghardt 
AuthorDate: Thu Feb 8 13:02:31 2018 -0700

GEODE-4507: add whitespace after header.
---
 examples/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index f7cb133..0e4c553 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -12,7 +12,8 @@
 # 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.
+
 cmake_minimum_required(VERSION 3.4)
 project(examples)
 
-add_subdirectory(cpp)
\ No newline at end of file
+add_subdirectory(cpp)

-- 
To stop receiving notification emails like this one, please contact
echobr...@apache.org.


[geode-native] branch develop updated: GEODE-4507: Add top level CMake file

2018-02-08 Thread echobravo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new d5b1876  GEODE-4507: Add top level CMake file
d5b1876 is described below

commit d5b1876c31055d75feae549477be614f4ba6dd59
Author: Ernie Burghardt 
AuthorDate: Thu Feb 8 11:40:25 2018 -0800

GEODE-4507: Add top level CMake file
---
 .../{cpp/customserializable => }/CMakeLists.txt| 25 +++-
 .../cpp/{customserializable => }/CMakeLists.txt| 27 --
 examples/cpp/customserializable/CMakeLists.txt |  2 +-
 3 files changed, 9 insertions(+), 45 deletions(-)

diff --git a/examples/cpp/customserializable/CMakeLists.txt 
b/examples/CMakeLists.txt
similarity index 62%
copy from examples/cpp/customserializable/CMakeLists.txt
copy to examples/CMakeLists.txt
index dcc9d2d..f7cb133 100644
--- a/examples/cpp/customserializable/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -12,26 +12,7 @@
 # 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.
+cmake_minimum_required(VERSION 3.4)
+project(examples)
 
-cmake_minimum_required(VERSION 3.5)
-
-project(customserializer)
-
-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)
-set(CMAKE_CXX_STANDARD 11)
-
-if(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
-add_compile_options(-m64)
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
-endif()
-
-find_package(geode-native REQUIRED)
-
-add_executable(${PROJECT_NAME}
-main.cpp
-Order.cpp)
-
-target_link_libraries(${PROJECT_NAME}
-PUBLIC
-apache.geode::cpp
-)
+add_subdirectory(cpp)
\ No newline at end of file
diff --git a/examples/cpp/customserializable/CMakeLists.txt 
b/examples/cpp/CMakeLists.txt
similarity index 62%
copy from examples/cpp/customserializable/CMakeLists.txt
copy to examples/cpp/CMakeLists.txt
index dcc9d2d..012ff1f 100644
--- a/examples/cpp/customserializable/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -12,26 +12,9 @@
 # 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.
+cmake_minimum_required(VERSION 3.4)
+project(examples)
 
-cmake_minimum_required(VERSION 3.5)
-
-project(customserializer)
-
-set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)
-set(CMAKE_CXX_STANDARD 11)
-
-if(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
-add_compile_options(-m64)
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
-endif()
-
-find_package(geode-native REQUIRED)
-
-add_executable(${PROJECT_NAME}
-main.cpp
-Order.cpp)
-
-target_link_libraries(${PROJECT_NAME}
-PUBLIC
-apache.geode::cpp
-)
+add_subdirectory(customserializable)
+add_subdirectory(customserializer)
+add_subdirectory(put-get-remove)
\ No newline at end of file
diff --git a/examples/cpp/customserializable/CMakeLists.txt 
b/examples/cpp/customserializable/CMakeLists.txt
index dcc9d2d..9ca93a9 100644
--- a/examples/cpp/customserializable/CMakeLists.txt
+++ b/examples/cpp/customserializable/CMakeLists.txt
@@ -15,7 +15,7 @@
 
 cmake_minimum_required(VERSION 3.5)
 
-project(customserializer)
+project(customserializable)
 
 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)
 set(CMAKE_CXX_STANDARD 11)

-- 
To stop receiving notification emails like this one, please contact
echobr...@apache.org.


[geode] branch develop updated: GEODE-4588: remove call of getAnyInstance (#1394)

2018-02-08 Thread dschneider
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new f848621  GEODE-4588: remove call of getAnyInstance (#1394)
f848621 is described below

commit f848621fe5258b87fcf04ceb4af7997359ed0330
Author: Darrel Schneider 
AuthorDate: Thu Feb 8 11:20:29 2018 -0800

GEODE-4588: remove call of getAnyInstance (#1394)

Now an InternalDistributedSystem is passed in to the TXLockServiceImpl
constructor. Note that this service depends on the distributed system
instead of the cache.
---
 .../internal/cache/DistTXPrecommitMessage.java |  3 ++-
 .../geode/internal/cache/TXCommitMessage.java  |  5 ++--
 .../apache/geode/internal/cache/TXLockRequest.java | 13 +-
 .../org/apache/geode/internal/cache/TXState.java   |  4 ++--
 .../geode/internal/cache/locks/TXLockService.java  |  5 ++--
 .../internal/cache/locks/TXLockServiceImpl.java|  4 +---
 .../geode/internal/cache/tx/ClientTXStateStub.java |  2 +-
 .../cache/locks/TXLockServiceDUnitTest.java| 28 +++---
 8 files changed, 33 insertions(+), 31 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXPrecommitMessage.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXPrecommitMessage.java
index e732c38..ecaac7e 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXPrecommitMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXPrecommitMessage.java
@@ -88,7 +88,8 @@ public class DistTXPrecommitMessage extends TXMessage {
 // should not be commited before
 assert (!txMgr.isHostedTxRecentlyCompleted(txId));
 // @see TXCommitMessage.process(DistributionManager)
-TXLockService.createDTLS(); // fix bug 38843; no-op if already created
+TXLockService.createDTLS(cache.getInternalDistributedSystem()); // fix bug 
38843; no-op if
+// already 
created
 final TXStateProxy txStateProxy = txMgr.getTXState();
 boolean precommitSuccess = true;
 TreeMap entryStateSortedMap =
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
index 8e5c210..443027f 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXCommitMessage.java
@@ -536,7 +536,7 @@ public class TXCommitMessage extends 
PooledDistributionMessage
 }
 
 if (this.processorId != 0) {
-  TXLockService.createDTLS(); // fix bug 38843; no-op if already created
+  TXLockService.createDTLS(this.dm.getSystem()); // fix bug 38843; no-op 
if already created
   synchronized (this) {
 // Handle potential origin departure
 this.dm.addMembershipListener(this);
@@ -2078,7 +2078,8 @@ public class TXCommitMessage extends 
PooledDistributionMessage
*/
   private void updateLockMembers() {
 if (this.lockNeedsUpdate && this.lockId != null) {
-  TXLockService.createDTLS().updateParticipants(this.lockId, 
this.msgMap.keySet());
+  
TXLockService.createDTLS(this.dm.getSystem()).updateParticipants(this.lockId,
+  this.msgMap.keySet());
 }
   }
 
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXLockRequest.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXLockRequest.java
index 919597d..5958830 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXLockRequest.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXLockRequest.java
@@ -18,6 +18,7 @@ package org.apache.geode.internal.cache;
 import java.util.*;
 
 import org.apache.geode.cache.*;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.cache.locks.*;
 
 /**
@@ -74,13 +75,13 @@ public class TXLockRequest {
 this.distLocks.add(req);
   }
 
-  public void obtain() throws CommitConflictException {
+  public void obtain(InternalDistributedSystem system) throws 
CommitConflictException {
 if (this.localLocks != null && !this.localLocks.isEmpty()) {
   txLocalLock(this.localLocks);
   this.localLockHeld = true;
 }
 if (this.distLocks != null && !this.distLocks.isEmpty()) {
-  this.distLockId = TXLockService.createDTLS().txLock(this.distLocks, 
this.otherMembers);
+  this.distLockId = 
TXLockService.createDTLS(system).txLock(this.distLocks, this.otherMembers);
 }
   }
 
@@ -97,10 +98,10 @@ public class TXLockRequest {
   /**
* Release any distributed locks obtained by this request
*/
-  public void releaseDistributed() {
+  public void 

[geode] branch develop updated: GEODE-4629: Ignore tests that assume non-approximate LRU (#1417)

2018-02-08 Thread nreich
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 24601a6  GEODE-4629: Ignore tests that assume non-approximate LRU 
(#1417)
24601a6 is described below

commit 24601a6a97acc97083bfa46b2942f9c5a2f39b8a
Author: Nick Reich 
AuthorDate: Thu Feb 8 11:12:20 2018 -0800

GEODE-4629: Ignore tests that assume non-approximate LRU (#1417)
---
 .../src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java 
b/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java
index fec5b26..4ee8bbb 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java
@@ -23,6 +23,7 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.Set;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -67,6 +68,7 @@ import org.apache.geode.test.junit.categories.DistributedTest;
  *
  * @since GemFire 3.2
  */
+@Ignore
 @Category(DistributedTest.class)
 public class DiskRegionDUnitTest extends JUnit4CacheTestCase {
 

-- 
To stop receiving notification emails like this one, please contact
nre...@apache.org.


[geode] branch develop updated: GEODE-4320: Reconcile disparity between Banner and AbstractConfig

2018-02-08 Thread prhomberg
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new a39394e  GEODE-4320: Reconcile disparity between Banner and 
AbstractConfig
a39394e is described below

commit a39394e082029c0c2bfdd24bc77da8d2dc1afdf1
Author: Patrick Rhomberg 
AuthorDate: Thu Feb 8 10:29:13 2018 -0800

GEODE-4320: Reconcile disparity between Banner and AbstractConfig
---
 .../cli/commands/GfshStartLocatorLogTest.java  |   3 +-
 .../LogsAreFullyRedactedAcceptanceTest.java| 126 +++
 geode-assembly/src/test/resources/security.json|  45 +++
 .../internal/locator/LocatorStatusResponse.java|   3 +-
 .../internal/DistributionConfigImpl.java   |   6 -
 .../distributed/internal/FlowControlParams.java|   4 -
 .../org/apache/geode/internal/AbstractConfig.java  | 380 +
 .../geode/internal/util/ArgumentRedactor.java  |  27 +-
 .../InternalDistributedSystemJUnitTest.java|  35 +-
 .../geode/internal/AbstractConfigJUnitTest.java|  91 -
 .../internal/util/ArgumentRedactorJUnitTest.java   | 134 +---
 .../geode/test/junit/rules/GfshCommandRule.java|   3 +-
 12 files changed, 481 insertions(+), 376 deletions(-)

diff --git 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/GfshStartLocatorLogTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/GfshStartLocatorLogTest.java
index 9ef8839..dc9fc3b 100644
--- 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/GfshStartLocatorLogTest.java
+++ 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/GfshStartLocatorLogTest.java
@@ -24,7 +24,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.internal.AbstractConfig;
 import org.apache.geode.test.junit.categories.AcceptanceTest;
 import org.apache.geode.test.junit.rules.gfsh.GfshExecution;
 import org.apache.geode.test.junit.rules.gfsh.GfshRule;
@@ -44,7 +43,7 @@ public class GfshStartLocatorLogTest {
 
   @Test
   public void startupConfigsOnlyLogsOnce() throws Exception {
-final String startupConfigs = 
AbstractConfig.GEM_FIRE_PROPERTIES_USING_DEFAULT_VALUES;
+final String startupConfigs = "### GemFire Properties using default values 
###";
 String lines = getExecutionLogs();
 
assertThat(lines.indexOf(startupConfigs)).isEqualTo(lines.lastIndexOf(startupConfigs));
   }
diff --git 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LogsAreFullyRedactedAcceptanceTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LogsAreFullyRedactedAcceptanceTest.java
new file mode 100644
index 000..e9bfc05
--- /dev/null
+++ 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/LogsAreFullyRedactedAcceptanceTest.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.management.internal.cli.commands;
+
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static 
org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.Scanner;
+
+import org.apache.commons.io.FileUtils;
+import org.assertj.core.api.SoftAssertions;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.examples.security.ExampleSecurityManager;
+import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
+import org.apache.geode.test.junit.categories.AcceptanceTest;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.util.test.TestUtil;
+
+/**
+ * This test class expects a "security.json" file to be visible on 

[geode] branch develop updated: GEODE-4435 Move queueSize stat increment to after writing to disk. (#1397)

2018-02-08 Thread lgallinat
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new ff215d4  GEODE-4435 Move queueSize stat increment to after writing to 
disk. (#1397)
ff215d4 is described below

commit ff215d4c8cb55f071f70553f4410df446aaec6d8
Author: lgallinat 
AuthorDate: Thu Feb 8 10:08:56 2018 -0800

GEODE-4435 Move queueSize stat increment to after writing to disk. (#1397)

* GEODE-4435 Move queueSize stat increment to after writing to disk.

* Changes for review comments.
---
 .../apache/geode/internal/cache/DiskRegion.java|   2 +-
 .../apache/geode/internal/cache/DiskStoreImpl.java | 206 -
 .../cache/DiskStoreImplIntegrationTest.java|  49 +
 .../geode/internal/cache/FlusherThreadTest.java|  77 
 .../geode/internal/cache/OplogFlushTest.java   |  10 +-
 .../geode/internal/cache/OplogJUnitTest.java   |   4 +-
 .../internal/cache/SimpleDiskRegionJUnitTest.java  |   2 +-
 7 files changed, 256 insertions(+), 94 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskRegion.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskRegion.java
index 161c583..18d6072 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskRegion.java
@@ -535,7 +535,7 @@ public class DiskRegion extends AbstractDiskRegion {
* returns the active child
*/
   Oplog testHook_getChild() {
-return getDiskStore().persistentOplogs.getChild();
+return getDiskStore().getPersistentOplogs().getChild();
   }
 
   /** For Testing * */
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index f0959b8..0ad8310 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -320,7 +320,7 @@ public class DiskStoreImpl implements DiskStore {
   private final AtomicReference diskException =
   new AtomicReference();
 
-  PersistentOplogSet persistentOplogs = new PersistentOplogSet(this);
+  private PersistentOplogSet persistentOplogs = new PersistentOplogSet(this);
 
   OverflowOplogSet overflowOplogs = new OverflowOplogSet(this);
 
@@ -667,19 +667,19 @@ public class DiskStoreImpl implements DiskStore {
 
   private OplogSet getOplogSet(DiskRegionView drv) {
 if (drv.isBackup()) {
-  return persistentOplogs;
+  return getPersistentOplogs();
 } else {
   return overflowOplogs;
 }
   }
 
   public PersistentOplogSet getPersistentOplogSet() {
-return persistentOplogs;
+return getPersistentOplogs();
   }
 
   PersistentOplogSet getPersistentOplogSet(DiskRegionView drv) {
 assert drv.isBackup();
-return persistentOplogs;
+return getPersistentOplogs();
   }
 
   /**
@@ -695,7 +695,7 @@ public class DiskStoreImpl implements DiskStore {
   throws RegionClearedException {
 DiskRegion dr = region.getDiskRegion();
 DiskId id = entry.getDiskId();
-long start = async ? this.stats.startFlush() : this.stats.startWrite();
+long start = async ? getStats().startFlush() : getStats().startWrite();
 if (!async) {
   dr.getStats().startWrite();
 }
@@ -751,9 +751,9 @@ public class DiskStoreImpl implements DiskStore {
   }
 } finally {
   if (async) {
-this.stats.endFlush(start);
+getStats().endFlush(start);
   } else {
-dr.getStats().endWrite(start, this.stats.endWrite(start));
+dr.getStats().endWrite(start, getStats().endWrite(start));
 dr.getStats().incWrittenBytes(id.getValueLength());
   }
 }
@@ -1079,10 +1079,10 @@ public class DiskStoreImpl implements DiskStore {
   // Entry will not be found in diskRegion.
   // So if reference has changed, do nothing.
   if (!dr.didClearCountChange()) {
-long start = this.stats.startRemove();
+long start = getStats().startRemove();
 OplogSet oplogSet = getOplogSet(dr);
 oplogSet.remove(region, entry, async, isClear);
-dr.getStats().endRemove(start, this.stats.endRemove(start));
+dr.getStats().endRemove(start, getStats().endRemove(start));
   } else {
 throw new RegionClearedException(
 
LocalizedStrings.DiskRegion_CLEAR_OPERATION_ABORTING_THE_ONGOING_ENTRY_DESTRUCTION_OPERATION_FOR_ENTRY_WITH_DISKID_0
@@ -1188,7 +1188,7 @@ public class DiskStoreImpl implements DiskStore {
   }
 
   public void forceRoll() {
-persistentOplogs.forceRoll(null);
+getPersistentOplogs().forceRoll(null);
   }
 
   /**
@@ -1290,29 +1290,29 @@ public class 

[geode] branch develop updated: GEODE-4607: Remove protobuf Request and Response objects, renumber message types (#1389)

2018-02-08 Thread wirebaron
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new fe31227  GEODE-4607: Remove protobuf Request and Response objects, 
renumber message types (#1389)
fe31227 is described below

commit fe3122782d947ed5db12e1c076de03f4d3ec2b9f
Author: Brian Rowe 
AuthorDate: Thu Feb 8 09:38:42 2018 -0800

GEODE-4607: Remove protobuf Request and Response objects, renumber message 
types (#1389)
---
 .../geode/experimental/driver/ProtobufDriver.java  | 17 ++---
 .../geode/experimental/driver/ProtobufRegion.java  | 38 --
 .../src/main/proto/v1/clientProtocol.proto | 53 ++
 .../protobuf/v1/ProtobufOperationContext.java  | 20 +++---
 .../protocol/protobuf/v1/ProtobufOpsProcessor.java | 10 +--
 .../protobuf/v1/ProtobufStreamProcessor.java   |  8 +--
 .../AuthenticationRequestOperationHandler.java |  2 -
 .../registry/ProtobufOperationContextRegistry.java | 66 -
 .../v1/utilities/ProtobufRequestUtilities.java | 18 ++---
 .../protobuf/v1/utilities/ProtobufUtilities.java   | 33 ++---
 .../protobuf/v1/AuthenticationIntegrationTest.java | 82 +-
 .../protobuf/v1/AuthorizationIntegrationTest.java  | 58 +++
 .../v1/FunctionExecutionIntegrationTest.java   | 44 +---
 .../internal/protocol/protobuf/v1/MessageUtil.java | 19 ++---
 .../v1/acceptance/CacheConnectionJUnitTest.java| 15 ++--
 .../v1/acceptance/CacheMaxConnectionJUnitTest.java | 10 ++-
 .../v1/acceptance/CacheOperationsJUnitTest.java| 67 --
 .../LocatorConnectionAuthenticationDUnitTest.java  | 33 -
 .../v1/acceptance/LocatorConnectionDUnitTest.java  | 32 +++--
 .../GetRegionRequestOperationHandlerJUnitTest.java |  4 --
 .../RemoveRequestOperationHandlerJUnitTest.java|  2 +-
 21 files changed, 252 insertions(+), 379 deletions(-)

diff --git 
a/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufDriver.java
 
b/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufDriver.java
index 5f5185f..f0c3cc9 100644
--- 
a/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufDriver.java
+++ 
b/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufDriver.java
@@ -83,13 +83,12 @@ public class ProtobufDriver implements Driver {
 
 final OutputStream outputStream = socket.getOutputStream();
 ClientProtocol.Message.newBuilder()
-.setRequest(ClientProtocol.Request.newBuilder()
-
.setGetRegionNamesRequest(RegionAPI.GetRegionNamesRequest.newBuilder()))
-.build().writeDelimitedTo(outputStream);
+
.setGetRegionNamesRequest(RegionAPI.GetRegionNamesRequest.newBuilder()).build()
+.writeDelimitedTo(outputStream);
 
 final InputStream inputStream = socket.getInputStream();
-final RegionAPI.GetRegionNamesResponse getRegionNamesResponse = 
ClientProtocol.Message
-
.parseDelimitedFrom(inputStream).getResponse().getGetRegionNamesResponse();
+final RegionAPI.GetRegionNamesResponse getRegionNamesResponse =
+
ClientProtocol.Message.parseDelimitedFrom(inputStream).getGetRegionNamesResponse();
 for (int i = 0; i < getRegionNamesResponse.getRegionsCount(); ++i) {
   regionNames.add(getRegionNamesResponse.getRegions(i));
 }
@@ -143,12 +142,10 @@ public class ProtobufDriver implements Driver {
 }
 
 ClientProtocol.Message.newBuilder()
-.setRequest(ClientProtocol.Request.newBuilder()
-.setGetServerRequest(LocatorAPI.GetServerRequest.newBuilder()))
-.build().writeDelimitedTo(outputStream);
+
.setGetServerRequest(LocatorAPI.GetServerRequest.newBuilder()).build()
+.writeDelimitedTo(outputStream);
 
-ClientProtocol.Response response =
-
ClientProtocol.Message.parseDelimitedFrom(inputStream).getResponse();
+ClientProtocol.Message response = 
ClientProtocol.Message.parseDelimitedFrom(inputStream);
 ClientProtocol.ErrorResponse errorResponse = 
response.getErrorResponse();
 
 if (errorResponse != null && errorResponse.hasError()) {
diff --git 
a/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufRegion.java
 
b/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufRegion.java
index c8a9ce2..7021f40 100644
--- 
a/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufRegion.java
+++ 
b/geode-experimental-driver/src/main/java/org/apache/geode/experimental/driver/ProtobufRegion.java
@@ -61,10 +61,9 @@ public class ProtobufRegion implements Region {
 this.socket = socket;
   }
 
-  private ClientProtocol.Response 

[geode] branch develop updated: GEODE-4631: need a public class to mock (#1413)

2018-02-08 Thread jasonhuynh
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new cd92f9a  GEODE-4631: need a public class to mock (#1413)
cd92f9a is described below

commit cd92f9a3d378f30eb7e93cbaa05be139bbbcefc6
Author: Xiaojian Zhou 
AuthorDate: Thu Feb 8 09:09:04 2018 -0800

GEODE-4631: need a public class to mock (#1413)
---
 .../org/apache/geode/cache/query/internal/types/TypeUtilsJUnitTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilsJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilsJUnitTest.java
index eaa27df..b9fc40f 100644
--- 
a/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilsJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilsJUnitTest.java
@@ -955,7 +955,7 @@ public class TypeUtilsJUnitTest {
   /**
* Test class that implements the Comparable interface.
*/
-  class ComparableObject implements Comparable {
+  public class ComparableObject implements Comparable {
 Integer id;
 
 public ComparableObject(Integer id) {

-- 
To stop receiving notification emails like this one, please contact
jasonhu...@apache.org.


[geode-native] branch develop updated: GEODE-4632: Fixes compile error on .NET.

2018-02-08 Thread jbarrett
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 7edebdf  GEODE-4632: Fixes compile error on .NET.
7edebdf is described below

commit 7edebdf0f613934e9c3e5c159576db98131ec468
Author: Jacob Barrett 
AuthorDate: Thu Feb 8 16:16:29 2018 +

GEODE-4632: Fixes compile error on .NET.
---
 clicache/src/UserFunctionExecutionException.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clicache/src/UserFunctionExecutionException.cpp 
b/clicache/src/UserFunctionExecutionException.cpp
index ec5d84d..74cd122 100644
--- a/clicache/src/UserFunctionExecutionException.cpp
+++ b/clicache/src/UserFunctionExecutionException.cpp
@@ -64,7 +64,7 @@ namespace Apache
 try
 {
   auto value = m_nativeptr->get()->getMessage();
-  return marshal_as(value->toString());
+  return marshal_as(value);
 }
 finally
 {
@@ -81,7 +81,7 @@ namespace Apache
 try
 {
   auto value = m_nativeptr->get()->getName();
-  return marshal_as(value->toString());
+  return marshal_as(value);
 }
 finally
 {

-- 
To stop receiving notification emails like this one, please contact
jbarr...@apache.org.


[geode-native] branch develop updated: GEODE-4632: Replace CacheableString with std::string. (#215)

2018-02-08 Thread jbarrett
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 5933abc  GEODE-4632: Replace CacheableString with std::string. (#215)
5933abc is described below

commit 5933abccf2b34fd73369af9ece498f2fdaf34ad4
Author: Jacob Barrett 
AuthorDate: Thu Feb 8 07:36:07 2018 -0800

GEODE-4632: Replace CacheableString with std::string. (#215)
---
 .../geode/UserFunctionExecutionException.hpp   | 78 +-
 .../integration-test/testThinClientPdxTests.cpp|  6 +-
 .../testThinClientPoolExecuteFunction.cpp  |  5 +-
 .../testThinClientPoolExecuteFunctionPrSHOP.cpp|  5 +-
 ...hinClientPoolExecuteFunctionThrowsException.cpp |  2 +-
 .../testThinClientSecurityAuthorizationMU.cpp  |  4 +-
 cppcache/src/ThinClientRegion.cpp  |  4 +-
 cppcache/src/UserFunctionExecutionException.cpp|  3 -
 8 files changed, 30 insertions(+), 77 deletions(-)

diff --git a/cppcache/include/geode/UserFunctionExecutionException.hpp 
b/cppcache/include/geode/UserFunctionExecutionException.hpp
index 91671eb..94e9d70 100644
--- a/cppcache/include/geode/UserFunctionExecutionException.hpp
+++ b/cppcache/include/geode/UserFunctionExecutionException.hpp
@@ -20,9 +20,8 @@
 #ifndef GEODE_USERFUNCTIONEXECUTIONEXCEPTION_H_
 #define GEODE_USERFUNCTIONEXECUTIONEXCEPTION_H_
 
-
-
 #include 
+#include 
 
 #include "CacheableString.hpp"
 #include "Serializable.hpp"
@@ -32,93 +31,52 @@ namespace geode {
 namespace client {
 
 class UserFunctionExecutionException;
-class CacheableString;
 class DataInput;
 class DataOutput;
 
 /**
  * @brief UserFunctionExecutionException class is used to encapsulate geode
- *sendException in case of Function execution.
- **/
+ * sendException in case of Function execution.
+ */
 class UserFunctionExecutionException : public Serializable {
  public:
-  /**
-   * @brief constructors
-   */
-  explicit UserFunctionExecutionException(std::shared_ptr 
msg);
+  explicit UserFunctionExecutionException(std::string message)
+  : m_message(std::move(message)) {}
   UserFunctionExecutionException(const UserFunctionExecutionException& other) =
   delete;
   void operator=(const UserFunctionExecutionException& other) = delete;
 
-  /**
-   * @brief destructor
-   */
-  virtual ~UserFunctionExecutionException() = default;
+  ~UserFunctionExecutionException() override = default;
 
-  /**
-   *@brief serialize this object
-   * @throws IllegalStateException If this api is called from User code.
-   **/
   void toData(DataOutput& output) const override;
 
-  /**
-   *@brief deserialize this object, typical implementation should return
-   * the 'this' pointer.
-   * @throws IllegalStateException If this api is called from User code.
-   **/
   virtual void fromData(DataInput& input) override;
 
-  /**
-   *@brief Return the classId of the instance being serialized.
-   * This is used by deserialization to determine what instance
-   * type to create and deserialize into.
-   *
-   * The classId must be unique within an application suite.
-   * Using a negative value may result in undefined behavior.
-   * @throws IllegalStateException If this api is called from User code.
-   */
   virtual int32_t classId() const override;
 
-  /**
-   *@brief return the size in bytes of the instance being serialized.
-   * This is used to determine whether the cache is using up more
-   * physical memory than it has been configured to use. The method can
-   * return zero if the user does not require the ability to control
-   * cache memory utilization.
-   * Note that you must implement this only if you use the HeapLRU feature.
-   * @throws IllegalStateException If this api is called from User code.
-   */
   virtual size_t objectSize() const override;
 
-  /**
-   *@brief return the typeId byte of the instance being serialized.
-   * This is used by deserialization to determine what instance
-   * type to create and deserialize into.
-   *
-   * Note that this should not be overridden by custom implementations
-   * and is reserved only for builtin types.
-   */
   virtual int8_t typeId() const override;
 
   /**
-   *@brief return as std::shared_ptr the Exception message
-   *returned from geode sendException api.
-   **/
-  std::shared_ptr getMessage() { return m_message; }
+   * @brief return as std::string the Exception message returned from geode
+   * sendException api.
+   */
+  const std::string& getMessage() const { return m_message; }
+
+  std::string toString() const override { return this->getMessage(); }
 
   /**
-   *@brief return as std::shared_ptr the Exception name
-   *returned from geode sendException api.
-   **/
-  std::shared_ptr getName() {
-static const auto name =
-CacheableString::create("UserFunctionExecutionException");
+   * @brief 

[geode-native] branch develop updated: GEODE-4425: Replaces ACE map with std::unordered_map. (#214)

2018-02-08 Thread jbarrett
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 647ad26  GEODE-4425: Replaces ACE map with std::unordered_map. (#214)
647ad26 is described below

commit 647ad26d38237f0ffa3360c89d76aa1da3579cac
Author: Jacob Barrett 
AuthorDate: Thu Feb 8 07:19:59 2018 -0800

GEODE-4425: Replaces ACE map with std::unordered_map. (#214)
---
 cppcache/include/geode/CacheableKey.hpp |  21 +++--
 cppcache/include/geode/Properties.hpp   |  20 ++---
 cppcache/src/Properties.cpp | 138 +---
 3 files changed, 56 insertions(+), 123 deletions(-)

diff --git a/cppcache/include/geode/CacheableKey.hpp 
b/cppcache/include/geode/CacheableKey.hpp
index f979334..cad90c9 100644
--- a/cppcache/include/geode/CacheableKey.hpp
+++ b/cppcache/include/geode/CacheableKey.hpp
@@ -109,17 +109,16 @@ class _GEODE_EXPORT CacheableKey : public Cacheable {
 
 using namespace apache::geode::client::internal;
 
-typedef std::unordered_map,
-   dereference_equal_to>
-HashMapOfCacheable;
-
-typedef std::unordered_set,
-   dereference_equal_to>
-HashSetOfCacheableKey;
-
+using HashMapOfCacheable =
+std::unordered_map,
+   dereference_equal_to>;
+
+using HashSetOfCacheableKey =
+std::unordered_set,
+   dereference_equal_to>;
 
 }  // namespace client
 }  // namespace geode
diff --git a/cppcache/include/geode/Properties.hpp 
b/cppcache/include/geode/Properties.hpp
index b08bb6c..4b09fb2 100644
--- a/cppcache/include/geode/Properties.hpp
+++ b/cppcache/include/geode/Properties.hpp
@@ -26,11 +26,11 @@
 
 #include 
 #include 
+#include 
 
 #include "internal/geode_globals.hpp"
-#include "Serializable.hpp"
-#include "Serializable.hpp"
 #include "internal/chrono/duration.hpp"
+#include "CacheableKey.hpp"
 
 namespace apache {
 namespace geode {
@@ -40,16 +40,13 @@ using namespace apache::geode::internal::chrono::duration;
 
 class DataInput;
 class DataOutput;
-class CacheableKey;
 class CacheableString;
 
 /**
  * @class Properties Properties.hpp
  * Contains a set of (key, value) pair properties with key being the name of
  * the property; value, the value of the property.
- *
  */
-
 class _GEODE_EXPORT Properties : public Serializable {
  public:
   class Visitor {
@@ -161,17 +158,14 @@ class _GEODE_EXPORT Properties : public Serializable {
 return 0;  // don't care to set the right value
   }
 
-  /** destructor. */
-  ~Properties() noexcept;
+  ~Properties() override = default;
+  Properties(const Properties&) = delete;
+  Properties& operator=(const Properties&) = delete;
 
  private:
-  Properties();
+  HashMapOfCacheable m_map;
 
-  void* m_map;
-
- private:
-  Properties(const Properties&);
-  const Properties& operator=(const Properties&);
+  Properties() = default;
 
   _GEODE_FRIEND_STD_SHARED_PTR(Properties)
 };
diff --git a/cppcache/src/Properties.cpp b/cppcache/src/Properties.cpp
index 10d3a84..219bed4 100644
--- a/cppcache/src/Properties.cpp
+++ b/cppcache/src/Properties.cpp
@@ -15,13 +15,6 @@
  * limitations under the License.
  */
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
 #include 
 #include 
 #include 
@@ -30,42 +23,10 @@
 #include 
 #include 
 
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-template <>
-class ACE_Hash {
- public:
-  u_long operator()(
-  const std::shared_ptr& key) {
-return key->hashcode();
-  }
-};
-
-template <>
-class ACE_Equal_To {
- public:
-  int operator()(
-  const std::shared_ptr& lhs,
-  const std::shared_ptr& rhs) const {
-return (*lhs.get() == *rhs.get());
-  }
-};
-ACE_END_VERSIONED_NAMESPACE_DECL
-
 namespace apache {
 namespace geode {
 namespace client {
 
-typedef ACE_Hash_Map_Manager_Ex<
-std::shared_ptr, std::shared_ptr,
-ACE_Hash,
-ACE_Equal_To, ACE_Recursive_Thread_Mutex>
-CacheableKeyCacheableMap;
-
-typedef ACE_Guard CacheableKeyCacheableMapGuard;
-
-#define MAP ((CacheableKeyCacheableMap*)m_map)
-
 class PropertiesFile {
   Properties& m_props;
   std::string m_fileName;
@@ -77,92 +38,73 @@ class PropertiesFile {
   void readFile(const std::string& fileName);
   char* nextBufferLine(char** cursor, char* bufbegin, size_t totalLen);
 };

[geode-native] branch develop updated: GEODE-4619: removing strip components

2018-02-08 Thread echobravo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new afb54f2  GEODE-4619: removing strip components
afb54f2 is described below

commit afb54f2a18681fc4070115d768ef2a49baa20e07
Author: Ernest Burghardt 
AuthorDate: Thu Feb 8 05:55:32 2018 -0700

GEODE-4619: removing strip components
---
 packer/rhel/install-gemfire.sh| 2 +-
 packer/solaris/install-gemfire.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/packer/rhel/install-gemfire.sh b/packer/rhel/install-gemfire.sh
index 4f3e155..64382af 100644
--- a/packer/rhel/install-gemfire.sh
+++ b/packer/rhel/install-gemfire.sh
@@ -18,5 +18,5 @@
 set -x -e -o pipefail
 
 mkdir /gemfire
-tar -zxf gemfire.tar.gz --strip-components=1 -C /gemfire
+tar -zxf gemfire.tar.gz -C /gemfire
 rm gemfire.tar.gz
diff --git a/packer/solaris/install-gemfire.sh 
b/packer/solaris/install-gemfire.sh
index 92d4aa2..a9d18b4 100755
--- a/packer/solaris/install-gemfire.sh
+++ b/packer/solaris/install-gemfire.sh
@@ -18,5 +18,5 @@
 set -x -e -o pipefail
 
 mkdir /gemfire
-gtar -xzvf gemfire.tar.gz --strip-components=1 -C /gemfire
+gtar -xzvf gemfire.tar.gz -C /gemfire
 rm gemfire.tar.gz

-- 
To stop receiving notification emails like this one, please contact
echobr...@apache.org.