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 18:14:58 UTC

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

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



##########
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:
       This null check is redundant, since it's implicitly included in the `instanceof` check.




----------------------------------------------------------------
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