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

 ##########
 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:
   It will not throw `NullPointerExcpetion `. It will print `with error message 
null`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to