You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ak...@apache.org on 2019/07/16 22:41:12 UTC
[incubator-pinot] branch master updated: [TE] Renamed some classes
to making it accurate and consistent (#4439)
This is an automated email from the ASF dual-hosted git repository.
akshayrai09 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 625482a [TE] Renamed some classes to making it accurate and consistent (#4439)
625482a is described below
commit 625482aa8bef8497e2a607bec93ece8ff52117d9
Author: Akshay Rai <ak...@gmail.com>
AuthorDate: Tue Jul 16 15:41:07 2019 -0700
[TE] Renamed some classes to making it accurate and consistent (#4439)
---
...rmatter.java => MetricAnomaliesEmailContentFormatter.java} | 11 ++++-------
.../thirdeye/anomaly/alert/util/AnomalyReportGenerator.java | 2 +-
.../pinot/thirdeye/anomaly/alert/v2/AlertTaskRunnerV2.java | 2 +-
.../detection/alert/scheme/DetectionEmailAlerter.java | 2 +-
...liday-anomaly-report.ftl => metric-anomalies-template.ftl} | 0
.../alert/commons/TestEmailContentFormatterFactory.java | 6 +++---
.../TestHierarchicalAnomaliesEmailContentFormatter.java | 2 +-
...ter.java => TestMetricAnomaliesEmailContentFormatter.java} | 6 +++---
....html => test-hierarchical-metric-anomalies-template.html} | 0
...ent-formatter.html => test-metric-anomalies-template.html} | 0
10 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/alert/content/MultipleAnomaliesEmailContentFormatter.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/alert/content/MetricAnomaliesEmailContentFormatter.java
similarity index 94%
rename from thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/alert/content/MultipleAnomaliesEmailContentFormatter.java
rename to thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/alert/content/MetricAnomaliesEmailContentFormatter.java
index 80c8bc2..385fe95 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/alert/content/MultipleAnomaliesEmailContentFormatter.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/alert/content/MetricAnomaliesEmailContentFormatter.java
@@ -24,11 +24,9 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import org.apache.pinot.thirdeye.anomaly.alert.util.EmailScreenshotHelper;
-import org.apache.pinot.thirdeye.anomaly.events.EventType;
import org.apache.pinot.thirdeye.anomalydetection.context.AnomalyFeedback;
import org.apache.pinot.thirdeye.anomalydetection.context.AnomalyResult;
import org.apache.pinot.thirdeye.datalayer.bao.DetectionConfigManager;
-import org.apache.pinot.thirdeye.datalayer.bao.EventManager;
import org.apache.pinot.thirdeye.datalayer.dto.DetectionConfigDTO;
import org.apache.pinot.thirdeye.datalayer.dto.EventDTO;
import org.apache.pinot.thirdeye.datalayer.dto.MergedAnomalyResultDTO;
@@ -42,7 +40,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.concurrent.TimeUnit;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,16 +48,16 @@ import org.slf4j.LoggerFactory;
/**
* This email formatter lists the anomalies by their functions or metric.
*/
-public class MultipleAnomaliesEmailContentFormatter extends BaseEmailContentFormatter{
- private static final Logger LOG = LoggerFactory.getLogger(MultipleAnomaliesEmailContentFormatter.class);
+public class MetricAnomaliesEmailContentFormatter extends BaseEmailContentFormatter{
+ private static final Logger LOG = LoggerFactory.getLogger(MetricAnomaliesEmailContentFormatter.class);
public static final String EMAIL_TEMPLATE = "emailTemplate";
- public static final String DEFAULT_EMAIL_TEMPLATE = "holiday-anomaly-report.ftl";
+ public static final String DEFAULT_EMAIL_TEMPLATE = "metric-anomalies-template.ftl";
private DetectionConfigManager configDAO = null;
- public MultipleAnomaliesEmailContentFormatter(){
+ public MetricAnomaliesEmailContentFormatter(){
}
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/AnomalyReportGenerator.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/AnomalyReportGenerator.java
index 5ad03ee..ccdb8b5 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/AnomalyReportGenerator.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/AnomalyReportGenerator.java
@@ -83,7 +83,7 @@ public class AnomalyReportGenerator {
private static final AnomalyReportGenerator INSTANCE = new AnomalyReportGenerator();
private static final String DATE_PATTERN = "MMM dd, HH:mm";
- private static final String MULTIPLE_ANOMALIES_EMAIL_TEMPLATE = "holiday-anomaly-report.ftl";
+ private static final String MULTIPLE_ANOMALIES_EMAIL_TEMPLATE = "metric-anomalies-template.ftl";
private static final long EVENT_TIME_TOLERANCE = TimeUnit.DAYS.toMillis(2);
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/v2/AlertTaskRunnerV2.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/v2/AlertTaskRunnerV2.java
index 98ca4c2..42ffac7 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/v2/AlertTaskRunnerV2.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/v2/AlertTaskRunnerV2.java
@@ -110,7 +110,7 @@ public class AlertTaskRunnerV2 implements TaskRunner {
private static final Logger LOG = LoggerFactory.getLogger(AlertTaskRunnerV2.class);
public static final TimeZone DEFAULT_TIME_ZONE = TimeZone.getTimeZone("America/Los_Angeles");
- public static final String DEFAULT_EMAIL_FORMATTER_TYPE = "MultipleAnomaliesEmailContentFormatter";
+ public static final String DEFAULT_EMAIL_FORMATTER_TYPE = "MetricAnomaliesEmailContentFormatter";
public static final String CHARSET = "UTF-8";
public static final String EMAIL_WHITELIST_KEY = "emailWhitelist";
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/scheme/DetectionEmailAlerter.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/scheme/DetectionEmailAlerter.java
index fd18322..1f963df 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/scheme/DetectionEmailAlerter.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/alert/scheme/DetectionEmailAlerter.java
@@ -60,7 +60,7 @@ public class DetectionEmailAlerter extends DetectionAlertScheme {
private static final Comparator<AnomalyResult> COMPARATOR_DESC =
(o1, o2) -> -1 * Long.compare(o1.getStartTime(), o2.getStartTime());
- private static final String DEFAULT_EMAIL_FORMATTER_TYPE = "MultipleAnomaliesEmailContentFormatter";
+ private static final String DEFAULT_EMAIL_FORMATTER_TYPE = "MetricAnomaliesEmailContentFormatter";
private static final String ENTITY_REPORT_FORMATTER_TYPE = "EntityContentFormatter";
private static final String EMAIL_WHITELIST_KEY = "emailWhitelist";
private static final String PROP_EMAIL_SCHEME = "emailScheme";
diff --git a/thirdeye/thirdeye-pinot/src/main/resources/org/apache/pinot/thirdeye/detector/holiday-anomaly-report.ftl b/thirdeye/thirdeye-pinot/src/main/resources/org/apache/pinot/thirdeye/detector/metric-anomalies-template.ftl
similarity index 100%
rename from thirdeye/thirdeye-pinot/src/main/resources/org/apache/pinot/thirdeye/detector/holiday-anomaly-report.ftl
rename to thirdeye/thirdeye-pinot/src/main/resources/org/apache/pinot/thirdeye/detector/metric-anomalies-template.ftl
diff --git a/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/commons/TestEmailContentFormatterFactory.java b/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/commons/TestEmailContentFormatterFactory.java
index 5058147..db89353 100644
--- a/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/commons/TestEmailContentFormatterFactory.java
+++ b/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/commons/TestEmailContentFormatterFactory.java
@@ -18,7 +18,7 @@ package org.apache.pinot.thirdeye.alert.commons;
import org.apache.pinot.thirdeye.alert.content.EmailContentFormatter;
import org.apache.pinot.thirdeye.alert.content.HierarchicalAnomaliesEmailContentFormatter;
-import org.apache.pinot.thirdeye.alert.content.MultipleAnomaliesEmailContentFormatter;
+import org.apache.pinot.thirdeye.alert.content.MetricAnomaliesEmailContentFormatter;
import org.junit.Assert;
import org.testng.annotations.Test;
@@ -28,9 +28,9 @@ public class TestEmailContentFormatterFactory {
@Test
public void testGetEmailContentFormatter() throws Exception{
EmailContentFormatter emailContentFormatter;
- emailContentFormatter = EmailContentFormatterFactory.fromClassName("MultipleAnomaliesEmailContentFormatter");
+ emailContentFormatter = EmailContentFormatterFactory.fromClassName("MetricAnomaliesEmailContentFormatter");
Assert.assertNotNull(emailContentFormatter);
- Assert.assertTrue(emailContentFormatter instanceof MultipleAnomaliesEmailContentFormatter);
+ Assert.assertTrue(emailContentFormatter instanceof MetricAnomaliesEmailContentFormatter);
emailContentFormatter = EmailContentFormatterFactory.fromClassName("HierarchicalAnomaliesEmailContentFormatter");
Assert.assertNotNull(emailContentFormatter);
diff --git a/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestHierarchicalAnomaliesEmailContentFormatter.java b/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestHierarchicalAnomaliesEmailContentFormatter.java
index 4e48fc0..72ccb1b 100644
--- a/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestHierarchicalAnomaliesEmailContentFormatter.java
+++ b/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestHierarchicalAnomaliesEmailContentFormatter.java
@@ -157,7 +157,7 @@ public class TestHierarchicalAnomaliesEmailContentFormatter {
EmailEntity emailEntity = contentFormatter.getEmailEntity(alertConfigDTO, recipients, TEST,
null, "", anomalies, null);
- String htmlPath = ClassLoader.getSystemResource("test-hierarchical-anomalies-email-content-formatter.html").getPath();
+ String htmlPath = ClassLoader.getSystemResource("test-hierarchical-metric-anomalies-template.html").getPath();
BufferedReader br = new BufferedReader(new FileReader(htmlPath));
StringBuilder htmlContent = new StringBuilder();
for(String line = br.readLine(); line != null; line = br.readLine()) {
diff --git a/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestMultipleAnomaliesEmailContentFormatter.java b/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestMetricAnomaliesEmailContentFormatter.java
similarity index 96%
rename from thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestMultipleAnomaliesEmailContentFormatter.java
rename to thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestMetricAnomaliesEmailContentFormatter.java
index 2f06564..bcc3808 100644
--- a/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestMultipleAnomaliesEmailContentFormatter.java
+++ b/thirdeye/thirdeye-pinot/src/test/java/org/apache/pinot/thirdeye/alert/content/TestMetricAnomaliesEmailContentFormatter.java
@@ -54,7 +54,7 @@ import org.testng.annotations.Test;
import static org.apache.pinot.thirdeye.anomaly.SmtpConfiguration.*;
-public class TestMultipleAnomaliesEmailContentFormatter {
+public class TestMetricAnomaliesEmailContentFormatter {
private static final String TEST = "test";
private int id = 0;
private String dashboardHost = "http://localhost:8080/dashboard";
@@ -131,14 +131,14 @@ public class TestMultipleAnomaliesEmailContentFormatter {
AlertConfigDTO alertConfigDTO = DaoTestUtils.getTestAlertConfiguration("Test Config");
- EmailContentFormatter contentFormatter = new MultipleAnomaliesEmailContentFormatter();
+ EmailContentFormatter contentFormatter = new MetricAnomaliesEmailContentFormatter();
contentFormatter.init(new Properties(), EmailContentFormatterConfiguration.fromThirdEyeAnomalyConfiguration(thirdeyeAnomalyConfig));
DetectionAlertFilterRecipients recipients = new DetectionAlertFilterRecipients(
EmailUtils.getValidEmailAddresses("a@b.com"));
EmailEntity emailEntity = contentFormatter.getEmailEntity(alertConfigDTO, recipients, TEST,
null, "", anomalies, null);
- String htmlPath = ClassLoader.getSystemResource("test-multiple-anomalies-email-content-formatter.html").getPath();
+ String htmlPath = ClassLoader.getSystemResource("test-metric-anomalies-template.html").getPath();
BufferedReader br = new BufferedReader(new FileReader(htmlPath));
StringBuilder htmlContent = new StringBuilder();
for(String line = br.readLine(); line != null; line = br.readLine()) {
diff --git a/thirdeye/thirdeye-pinot/src/test/resources/test-hierarchical-anomalies-email-content-formatter.html b/thirdeye/thirdeye-pinot/src/test/resources/test-hierarchical-metric-anomalies-template.html
similarity index 100%
rename from thirdeye/thirdeye-pinot/src/test/resources/test-hierarchical-anomalies-email-content-formatter.html
rename to thirdeye/thirdeye-pinot/src/test/resources/test-hierarchical-metric-anomalies-template.html
diff --git a/thirdeye/thirdeye-pinot/src/test/resources/test-multiple-anomalies-email-content-formatter.html b/thirdeye/thirdeye-pinot/src/test/resources/test-metric-anomalies-template.html
similarity index 100%
rename from thirdeye/thirdeye-pinot/src/test/resources/test-multiple-anomalies-email-content-formatter.html
rename to thirdeye/thirdeye-pinot/src/test/resources/test-metric-anomalies-template.html
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org