You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/09/02 19:35:27 UTC

[GitHub] [geode] boglesby commented on a change in pull request #5494: GEODE-8478: Refactored logThresholdExceededAlerts and modified it to …

boglesby commented on a change in pull request #5494:
URL: https://github.com/apache/geode/pull/5494#discussion_r482347901



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
##########
@@ -1037,24 +1039,32 @@ public void handleSuccessBatchAck(int batchId) {
       }
       eventQueueRemove(events.size());
 
-      final GatewaySenderStats statistics = this.sender.getStatistics();
+      logThresholdExceededAlerts(events);
+    }
+  }
 
-      // Log an alert for each event if necessary
-      if (this.sender.getAlertThreshold() > 0) {
-        Iterator it = events.iterator();
-        long currentTime = System.currentTimeMillis();
-        while (it.hasNext()) {
+  protected void logThresholdExceededAlerts(List<GatewaySenderEventImpl> events) {
+    // Log an alert for each event if necessary
+    if (getSender().getAlertThreshold() > 0) {
+      Iterator it = events.iterator();
+      long currentTime = System.currentTimeMillis();
+      while (it.hasNext()) {
+        try {
           Object o = it.next();
           if (o != null && o instanceof GatewaySenderEventImpl) {

Review comment:
       Thanks for reviewing this change. I tend to not change existing code if I can help it, but since I pulled this method out, I'll refactor it. it could use other work too.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org