geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [geode] branch feature/GEODE-3940 updated: GEODE-3940: prevent warning when processing message by sender
Date Wed, 08 Nov 2017 18:26:34 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/feature/GEODE-3940 by this push:
     new d55e6d6  GEODE-3940: prevent warning when processing message by sender
d55e6d6 is described below

commit d55e6d6cae348fedb9f1341a9abde2096be3bead
Author: Kirk Lund <klund@apache.org>
AuthorDate: Wed Nov 8 10:25:07 2017 -0800

    GEODE-3940: prevent warning when processing message by sender
    
    Prevents logging warning when processing these message types by sender:
    
    * FinishBackupRequest, FlushToDiskRequest, PrepareBackupRequest
---
 .../org/apache/geode/admin/internal/FinishBackupRequest.java     | 9 ++-------
 .../java/org/apache/geode/admin/internal/FlushToDiskRequest.java | 8 +++++++-
 .../org/apache/geode/admin/internal/PrepareBackupRequest.java    | 4 ++--
 .../org/apache/geode/admin/internal/FinishBackupRequestTest.java | 7 ++++---
 .../org/apache/geode/admin/internal/FlushToDiskRequestTest.java  | 5 +++--
 .../apache/geode/admin/internal/PrepareBackupRequestTest.java    | 7 ++++---
 6 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java
b/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java
index 5da68c6..ec19fbb 100644
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java
@@ -105,7 +105,7 @@ public class FinishBackupRequest extends CliLegacyMessage {
 
     // adding local member to the results
     response.setSender(dm.getDistributionManagerId());
-    replyProcessor.process(response);
+    replyProcessor.process(response, false);
     return replyProcessor.getResults();
   }
 
@@ -155,7 +155,7 @@ public class FinishBackupRequest extends CliLegacyMessage {
 
   static class FinishBackupReplyProcessor extends AdminMultipleReplyProcessor {
 
-    private Map<DistributedMember, Set<PersistentID>> results =
+    private final Map<DistributedMember, Set<PersistentID>> results =
         Collections.synchronizedMap(new HashMap<DistributedMember, Set<PersistentID>>());
 
     FinishBackupReplyProcessor(DM dm, Collection initMembers) {
@@ -190,11 +190,6 @@ public class FinishBackupRequest extends CliLegacyMessage {
       super.process(message, warn);
     }
 
-    @Override
-    protected InternalDistributedMember[] getMembers() {
-      return super.getMembers();
-    }
-
     Map<DistributedMember, Set<PersistentID>> getResults() {
       return results;
     }
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java
b/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java
index f60f29e..1f6090a 100644
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java
@@ -22,6 +22,7 @@ import org.apache.logging.log4j.Logger;
 import org.apache.geode.CancelException;
 import org.apache.geode.cache.DiskStore;
 import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionMessage;
 import org.apache.geode.distributed.internal.ReplyException;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
@@ -80,7 +81,7 @@ public class FlushToDiskRequest extends CliLegacyMessage {
     }
 
     response.setSender(dm.getDistributionManagerId());
-    replyProcessor.process(response);
+    replyProcessor.process(response, false);
   }
 
   @Override
@@ -108,5 +109,10 @@ public class FlushToDiskRequest extends CliLegacyMessage {
     protected boolean stopBecauseOfExceptions() {
       return false;
     }
+
+    @Override
+    protected void process(DistributionMessage message, boolean warn) {
+      super.process(message, warn);
+    }
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java
b/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java
index bf5762a..3679ba8 100644
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java
@@ -90,7 +90,7 @@ public class PrepareBackupRequest extends CliLegacyMessage {
     }
 
     response.setSender(dm.getDistributionManagerId());
-    replyProcessor.process(response);
+    replyProcessor.process(response, false);
     return replyProcessor.getResults();
   }
 
@@ -124,7 +124,7 @@ public class PrepareBackupRequest extends CliLegacyMessage {
 
   static class PrepareBackupReplyProcessor extends AdminMultipleReplyProcessor {
 
-    private Map<DistributedMember, Set<PersistentID>> results =
+    private final Map<DistributedMember, Set<PersistentID>> results =
         Collections.synchronizedMap(new HashMap<DistributedMember, Set<PersistentID>>());
 
     PrepareBackupReplyProcessor(DM dm, Collection initMembers) {
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/FinishBackupRequestTest.java
b/geode-core/src/test/java/org/apache/geode/admin/internal/FinishBackupRequestTest.java
index 6d7f2f3..2bbd90f 100644
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/FinishBackupRequestTest.java
+++ b/geode-core/src/test/java/org/apache/geode/admin/internal/FinishBackupRequestTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.admin.internal;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.mock;
@@ -145,7 +146,7 @@ public class FinishBackupRequestTest {
   public void sendShouldInvokeProcessLocally() throws Exception {
     finishBackupRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(AdminResponse.class));
+    verify(replyProcessor, times(1)).process(any(AdminResponse.class), eq(false));
   }
 
   @Test
@@ -173,7 +174,7 @@ public class FinishBackupRequestTest {
   public void repliesWithFinishBackupResponse() throws Exception {
     finishBackupRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(FinishBackupResponse.class));
+    verify(replyProcessor, times(1)).process(any(FinishBackupResponse.class), eq(false));
   }
 
   @Test
@@ -182,7 +183,7 @@ public class FinishBackupRequestTest {
 
     finishBackupRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(AdminFailureResponse.class));
+    verify(replyProcessor, times(1)).process(any(AdminFailureResponse.class), eq(false));
   }
 
   @Test
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/FlushToDiskRequestTest.java
b/geode-core/src/test/java/org/apache/geode/admin/internal/FlushToDiskRequestTest.java
index 5b3cba9..e16430f 100644
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/FlushToDiskRequestTest.java
+++ b/geode-core/src/test/java/org/apache/geode/admin/internal/FlushToDiskRequestTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.admin.internal;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.mock;
@@ -121,7 +122,7 @@ public class FlushToDiskRequestTest {
   public void sendShouldInvokeProcessLocally() throws Exception {
     flushToDiskRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(AdminResponse.class));
+    verify(replyProcessor, times(1)).process(any(AdminResponse.class), eq(false));
   }
 
   @Test
@@ -148,7 +149,7 @@ public class FlushToDiskRequestTest {
   public void repliesWithFinishBackupResponse() throws Exception {
     flushToDiskRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(FlushToDiskResponse.class));
+    verify(replyProcessor, times(1)).process(any(FlushToDiskResponse.class), eq(false));
   }
 
   @Test
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/PrepareBackupRequestTest.java
b/geode-core/src/test/java/org/apache/geode/admin/internal/PrepareBackupRequestTest.java
index 29ecd69..4be5e5d 100644
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/PrepareBackupRequestTest.java
+++ b/geode-core/src/test/java/org/apache/geode/admin/internal/PrepareBackupRequestTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.admin.internal;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.mock;
@@ -140,7 +141,7 @@ public class PrepareBackupRequestTest {
   public void sendShouldInvokeProcessLocally() throws Exception {
     prepareBackupRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(AdminResponse.class));
+    verify(replyProcessor, times(1)).process(any(AdminResponse.class), eq(false));
   }
 
   @Test
@@ -165,7 +166,7 @@ public class PrepareBackupRequestTest {
   public void repliesWithFinishBackupResponse() throws Exception {
     prepareBackupRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(PrepareBackupResponse.class));
+    verify(replyProcessor, times(1)).process(any(PrepareBackupResponse.class), eq(false));
   }
 
   @Test
@@ -176,7 +177,7 @@ public class PrepareBackupRequestTest {
 
     prepareBackupRequest.send();
 
-    verify(replyProcessor, times(1)).process(any(AdminFailureResponse.class));
+    verify(replyProcessor, times(1)).process(any(AdminFailureResponse.class), eq(false));
   }
 
   @Test

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message