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/06/20 01:02:20 UTC

[incubator-pinot] branch master updated: [TE] cleaned up error messages when running in demo mode (#4344)

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 27c2736  [TE] cleaned up error messages when running in demo mode (#4344)
27c2736 is described below

commit 27c27362c8f3eeb692c64a0bd455e49408336941
Author: Xiaohui Sun <xh...@linkedin.com>
AuthorDate: Wed Jun 19 18:02:15 2019 -0700

    [TE] cleaned up error messages when running in demo mode (#4344)
---
 thirdeye/pom.xml                                   |  2 +-
 .../datasource/mock/AutoOnboardMockDataSource.java | 24 +++++++++++++---------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/thirdeye/pom.xml b/thirdeye/pom.xml
index ed53579..dd13876 100644
--- a/thirdeye/pom.xml
+++ b/thirdeye/pom.xml
@@ -54,7 +54,7 @@
     <commons-dbcp2.version>2.1.1</commons-dbcp2.version>
     <commons-conf2.version>2.5</commons-conf2.version>
     <commons-collection4.version>4.1</commons-collection4.version>
-    <reflections.version>0.9.11</reflections.version>
+    <reflections.version>0.9.10</reflections.version>
     <mrunit.version>1.1.0</mrunit.version>
     <slf4j-api.version>1.7.12</slf4j-api.version>
     <jodatime.version>2.7</jodatime.version>
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/mock/AutoOnboardMockDataSource.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/mock/AutoOnboardMockDataSource.java
index c63df38..561d1c8 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/mock/AutoOnboardMockDataSource.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/mock/AutoOnboardMockDataSource.java
@@ -105,20 +105,24 @@ public class AutoOnboardMockDataSource extends AutoOnboard {
 
     // NOTE: save in order as mock datasource expects metric ids first
     for (MetricConfigDTO metricConfig : metricConfigs) {
-      Long id = this.metricDAO.save(metricConfig);
-      if (id != null) {
-        LOG.info("Created metric '{}' with id {}", metricConfig.getAlias(), id);
-      } else {
-        LOG.warn("Could not create metric '{}'", metricConfig.getAlias());
+      if (this.metricDAO.findByMetricAndDataset(metricConfig.getName(), metricConfig.getDataset()) == null) {
+        Long id = this.metricDAO.save(metricConfig);
+        if (id != null) {
+          LOG.info("Created metric '{}' with id {}", metricConfig.getAlias(), id);
+        } else {
+          LOG.warn("Could not create metric '{}'", metricConfig.getAlias());
+        }
       }
     }
 
     for (DatasetConfigDTO datasetConfig : datasetConfigs) {
-      Long id = this.datasetDAO.save(datasetConfig);
-      if (id != null) {
-        LOG.info("Created dataset '{}' with id {}", datasetConfig.getDataset(), id);
-      } else {
-        LOG.warn("Could not create dataset '{}'", datasetConfig.getDataset());
+      if (this.datasetDAO.findByDataset(datasetConfig.getDataset()) == null) {
+        Long id = this.datasetDAO.save(datasetConfig);
+        if (id != null) {
+          LOG.info("Created dataset '{}' with id {}", datasetConfig.getDataset(), id);
+        } else {
+          LOG.warn("Could not create dataset '{}'", datasetConfig.getDataset());
+        }
       }
     }
   }


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