You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by jo...@apache.org on 2023/02/13 13:48:44 UTC

[incubator-eventmesh] branch master updated: [ISSUE #3101] Added final modifier for lines 34,36,38,44 (#3128)

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

jonyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new e4f2355ee [ISSUE #3101] Added final modifier for lines 34,36,38,44 (#3128)
e4f2355ee is described below

commit e4f2355eef5325fb5b128f45869399763d26f2fb
Author: Kirill Saied <38...@users.noreply.github.com>
AuthorDate: Mon Feb 13 16:48:37 2023 +0300

    [ISSUE #3101] Added final modifier for lines 34,36,38,44 (#3128)
    
    * [ISSUE #3101] Added final modifier for lines 34,36,38,44
    
    * [ISSUE #3101] Merged loggers with lombok Slf4f
    
    * [ISSUE #3101] Removed redundant imports
    
    * [ISSUE #3101] Optimized imports
---
 .../core/protocol/grpc/retry/GrpcRetryer.java      | 28 ++++++++++------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/retry/GrpcRetryer.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/retry/GrpcRetryer.java
index 2ad6cce02..034b0db1d 100644
--- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/retry/GrpcRetryer.java
+++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/retry/GrpcRetryer.java
@@ -26,22 +26,18 @@ import java.util.concurrent.DelayQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import lombok.extern.slf4j.Slf4j;
 
+@Slf4j
 public class GrpcRetryer {
 
-    private Logger retryLogger = LoggerFactory.getLogger("retry");
-
-    private Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    private EventMeshGrpcConfiguration grpcConfiguration;
+    private final EventMeshGrpcConfiguration grpcConfiguration;
 
     public GrpcRetryer(EventMeshGrpcServer eventMeshGrpcServer) {
         this.grpcConfiguration = eventMeshGrpcServer.getEventMeshGrpcConfiguration();
     }
 
-    private DelayQueue<DelayRetryable> failed = new DelayQueue<DelayRetryable>();
+    private final DelayQueue<DelayRetryable> failed = new DelayQueue<DelayRetryable>();
 
     private ThreadPoolExecutor pool;
 
@@ -49,7 +45,7 @@ public class GrpcRetryer {
 
     public void pushRetry(DelayRetryable delayRetryable) {
         if (failed.size() >= grpcConfiguration.getEventMeshServerRetryBlockQueueSize()) {
-            retryLogger.error("[RETRY-QUEUE] is full!");
+            log.error("[RETRY-QUEUE] is full!");
             return;
         }
         failed.offer(delayRetryable);
@@ -72,20 +68,20 @@ public class GrpcRetryer {
                     pool.execute(() -> {
                         try {
                             delayRetryable.retry();
-                            if (retryLogger.isDebugEnabled()) {
-                                retryLogger.debug("retryObj : {}", delayRetryable);
+                            if (log.isDebugEnabled()) {
+                                log.debug("retryObj : {}", delayRetryable);
                             }
                         } catch (Exception e) {
-                            retryLogger.error("grpc-retry-dispatcher error!", e);
+                            log.error("grpc-retry-dispatcher error!", e);
                         }
                     });
                 }
             } catch (Exception e) {
-                retryLogger.error("grpc-retry-dispatcher error!", e);
+                log.error("grpc-retry-dispatcher error!", e);
             }
         }, "grpc-retry-dispatcher");
         dispatcher.setDaemon(true);
-        logger.info("GrpcRetryer inited......");
+        log.info("GrpcRetryer inited......");
     }
 
     public int size() {
@@ -95,11 +91,11 @@ public class GrpcRetryer {
     public void shutdown() {
         dispatcher.interrupt();
         pool.shutdown();
-        logger.info("GrpcRetryer shutdown......");
+        log.info("GrpcRetryer shutdown......");
     }
 
     public void start() throws Exception {
         dispatcher.start();
-        logger.info("GrpcRetryer started......");
+        log.info("GrpcRetryer started......");
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org