You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xh...@apache.org on 2019/06/10 20:19:46 UTC

[incubator-pinot] branch master updated: [TE] Several small changes (#4296)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 28f3828  [TE] Several small changes (#4296)
28f3828 is described below

commit 28f38286cb03a5f88ff4977512334d81e33f6b40
Author: Xiaohui Sun <xh...@linkedin.com>
AuthorDate: Mon Jun 10 13:19:39 2019 -0700

    [TE] Several small changes (#4296)
    
    * Changed session timeout to 24 hours.
     * Reverted the changes for adding additional delays when scheduling the tasks.
---
 .../thirdeye/dashboard/resources/v2/AuthResource.java     |  2 +-
 .../pinot/thirdeye/detection/DetectionPipelineJob.java    | 15 ++-------------
 .../pinot/thirdeye/detection/alert/DetectionAlertJob.java | 15 ++-------------
 3 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/AuthResource.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/AuthResource.java
index d2fe7d6..f4eb47d 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/AuthResource.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/AuthResource.java
@@ -107,7 +107,7 @@ public class AuthResource {
       sessionDTO.setSessionKey(sessionKey);
       sessionDTO.setPrincipalType(SessionBean.PrincipalType.USER);
       sessionDTO.setPrincipal(principal.getName());
-      sessionDTO.setExpirationTime(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(8));
+      sessionDTO.setExpirationTime(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(24));
       this.sessionDAO.save(sessionDTO);
 
       NewCookie cookie =
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipelineJob.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipelineJob.java
index 99f2708..e712e9b 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipelineJob.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipelineJob.java
@@ -83,19 +83,8 @@ public class DetectionPipelineJob implements Job {
     taskDTO.setStatus(TaskConstants.TaskStatus.WAITING);
     taskDTO.setTaskInfo(taskInfoJson);
 
-    // 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 {
-      int sleepTime =  random.nextInt(5000);
-      LOG.info("Wait for " + sleepTime + " milliseconds.");
-      Thread.sleep(sleepTime);
-      long taskId = taskDAO.save(taskDTO);
-      LOG.info("Created detection pipeline task {} with taskId {}", taskDTO, taskId);
-    } catch (InterruptedException e) {
-      LOG.error(e.toString());
-    }
+    long taskId = taskDAO.save(taskDTO);
+    LOG.info("Created detection pipeline task {} with taskId {}", taskDTO, taskId);
   }
 
   private Long getIdFromJobKey(String jobKey) {
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertJob.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertJob.java
index 41ebcd5..8a86170 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertJob.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertJob.java
@@ -92,19 +92,8 @@ public class DetectionAlertJob implements Job {
     taskDTO.setStatus(TaskConstants.TaskStatus.WAITING);
     taskDTO.setTaskInfo(taskInfoJson);
 
-    // 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 {
-      int sleepTime = random.nextInt(5000);
-      LOG.info("Wait for " + sleepTime + " milliseconds.");
-      Thread.sleep(sleepTime);
-      long taskId = taskDAO.save(taskDTO);
-      LOG.info("Created subscription task {} with settings {}", taskId, taskDTO);
-    } catch (InterruptedException e) {
-      LOG.error(e.toString());
-    }
+    long taskId = taskDAO.save(taskDTO);
+    LOG.info("Created subscription task {} with settings {}", taskId, taskDTO);
   }
 
   private Long getIdFromJobKey(String jobKey) {


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