This is an automated email from the ASF dual-hosted git repository.

bschuchardt 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 04ecdbb  GEODE-5505 Cache listener not invoked on a retried destroy() 
operation
04ecdbb is described below

commit 04ecdbb809759c704bb3b697a591c876f4feef35
Author: Bruce Schuchardt <[email protected]>
AuthorDate: Wed Aug 22 14:16:47 2018 -0700

    GEODE-5505 Cache listener not invoked on a retried destroy() operation
    
    Using Darrel's stream flow, which is simpler and doesn't need a try/catch.
---
 .../geode/distributed/internal/DistributionAdvisor.java       | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java
index f153326..3cb908d 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java
@@ -26,7 +26,6 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -264,14 +263,8 @@ public class DistributionAdvisor {
     // interval. This allows client caches to retry an operation that might 
otherwise be recovered
     // through the sync operation. Without associated event information this 
could cause the
     // retried operation to be mishandled. See GEODE-5505
-    long delay;
-    try {
-      delay = dr.getGemFireCache().getCacheServers().stream().max(
-          (o1, o2) -> o1.getMaximumTimeBetweenPings() - 
o2.getMaximumTimeBetweenPings()).get()
-          .getMaximumTimeBetweenPings();
-    } catch (NoSuchElementException e) {
-      delay = 0;
-    }
+    final long delay = dr.getGemFireCache().getCacheServers().stream()
+        .mapToLong(o -> o.getMaximumTimeBetweenPings()).max().orElse(0L);
     dr.getGemFireCache().getCCPTimer().schedule(new 
SystemTimer.SystemTimerTask() {
       @Override
       public void run2() {

Reply via email to