You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2019/04/24 17:19:44 UTC

[incubator-pinot] branch master updated: [TE] fix detection alert filter recipients class casting issue (#4158)

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

jihao 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 3b51d7a  [TE] fix detection alert filter recipients class casting issue (#4158)
3b51d7a is described below

commit 3b51d7ae2dcbbce1f7107923c15b60a2f27821f8
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Wed Apr 24 10:19:39 2019 -0700

    [TE] fix detection alert filter recipients class casting issue (#4158)
    
    A runtime casting exception will be thrown when running PerUserDimensionAlertFilter. This PR fixes the issue.
---
 .../detection/alert/DetectionAlertFilterRecipients.java    | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertFilterRecipients.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertFilterRecipients.java
index c18b09a..1815b6d 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertFilterRecipients.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/DetectionAlertFilterRecipients.java
@@ -20,13 +20,11 @@
 package org.apache.pinot.thirdeye.detection.alert;
 
 import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Sets;
 import java.util.Arrays;
-import java.util.Collections;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.Objects;
 import java.util.Set;
-import javax.validation.constraints.NotNull;
 
 
 /**
@@ -37,10 +35,10 @@ public class DetectionAlertFilterRecipients {
   Set<String> cc;
   Set<String> bcc;
 
-  public DetectionAlertFilterRecipients(Set<String> to, Set<String> cc, Set<String> bcc) {
-    this.to = to;
-    this.cc = cc;
-    this.bcc = bcc;
+  public DetectionAlertFilterRecipients(Collection<String> to, Collection<String> cc, Collection<String> bcc) {
+    this.to = new HashSet<>(to);
+    this.cc = new HashSet<>(cc);
+    this.bcc = new HashSet<>(bcc);
   }
 
   public DetectionAlertFilterRecipients(Set<String> to) {


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