You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/04/23 08:58:19 UTC

[GitHub] [incubator-doris] wuyunfeng commented on a change in pull request #1003: Support kafka routine load

wuyunfeng commented on a change in pull request #1003: Support kafka routine load
URL: https://github.com/apache/incubator-doris/pull/1003#discussion_r277575515
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/load/routineload/RoutineLoadScheduler.java
 ##########
 @@ -30,58 +35,96 @@
 public class RoutineLoadScheduler extends Daemon {
 
     private static final Logger LOG = LogManager.getLogger(RoutineLoadScheduler.class);
+    private static final int DEFAULT_INTERVAL_SECONDS = 10;
+
+    private RoutineLoadManager routineLoadManager;
 
-    private RoutineLoadManager routineLoadManager = Catalog.getInstance().getRoutineLoadManager();
+    @VisibleForTesting
+    public RoutineLoadScheduler() {
+        super();
+        routineLoadManager = Catalog.getInstance().getRoutineLoadManager();
+    }
+
+    public RoutineLoadScheduler(RoutineLoadManager routineLoadManager) {
+        super("Routine load", DEFAULT_INTERVAL_SECONDS * 1000);
+        this.routineLoadManager = routineLoadManager;
+    }
 
     @Override
     protected void runOneCycle() {
         try {
             process();
         } catch (Throwable e) {
-            LOG.error("failed to schedule jobs with error massage {}", e.getMessage(), e);
+            LOG.warn("Failed to process one round of RoutineLoadScheduler with error message {}", e.getMessage(), e);
 
 Review comment:
   {} placeholder is only one, but appear to params.
   
   e.getMeesage() maybe NULL, will throws NullPointerExcpetion again. This RoutineLoadScheduler will never schedule as expected.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org