akshayrai commented on a change in pull request #4217: [TE] distribute 
detection and notification tasks
URL: https://github.com/apache/incubator-pinot/pull/4217#discussion_r286112596
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipelineJob.java
 ##########
 @@ -82,9 +83,18 @@ public void execute(JobExecutionContext 
jobExecutionContext) throws JobExecution
     taskDTO.setStatus(TaskConstants.TaskStatus.WAITING);
     taskDTO.setTaskInfo(taskInfoJson);
 
-    long taskId = taskDAO.save(taskDTO);
-    LOG.info("Created detection pipeline task {} with taskId {}", taskDTO, 
taskId);
-
+    // TODO: revisit it after identifying bottlenecks
+    // Here will write the task information to mysql.
+    // Sleep random 0 - 5 seconds to distribute load to mysql.
+    Random random = new Random();
+    try {
+      LOG.info("Wait for " + random + " milliseconds.");
 
 Review comment:
   Nit: Store `random.nextInt(5000)` and then log. Here and below.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to