Ruoyingw commented on a change in pull request #5869:
URL: https://github.com/apache/incubator-pinot/pull/5869#discussion_r471787196



##########
File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/views/CondensedAnomalyTimelinesView.java
##########
@@ -182,9 +183,33 @@ public static CondensedAnomalyTimelinesView 
fromAnomalyTimelinesView(AnomalyTime
    * @return a compressed CondensedAnomalyTimelinesView
    */
   public CondensedAnomalyTimelinesView compress() {
+    if (timeStamps.size() == 0) {
+      return this;
+    }
+    try {
+      if (this.toJsonString().length() > DEFAULT_MAX_LENGTH) {
+        // First try rounding up
+        roundUp();

Review comment:
       Good suggestion. That also avoids some code duplications. At first I 
wanted to avoid putting it in compress(DEFAULT_MAX_LENGTH) since that one is 
called recursively. But now I think it is actually more robust to have this 
roundup every time we do compression. modified. 




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



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

Reply via email to