Repository: incubator-eagle Updated Branches: refs/heads/master 164e844c1 -> fbac5c3cc
Minor: metadata dao change have wrong null check Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/fbac5c3c Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/fbac5c3c Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/fbac5c3c Branch: refs/heads/master Commit: fbac5c3cc16150dbdc13d654e3425d197ed74300 Parents: 164e844 Author: Ralph, Su <suliang...@gmail.com> Authored: Wed Nov 16 10:59:56 2016 +0800 Committer: Ralph, Su <suliang...@gmail.com> Committed: Wed Nov 16 10:59:56 2016 +0800 ---------------------------------------------------------------------- .../eagle/alert/metadata/impl/MetadataDaoFactory.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fbac5c3c/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java index 6df99d9..5082e50 100644 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java +++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MetadataDaoFactory.java @@ -16,9 +16,9 @@ */ package org.apache.eagle.alert.metadata.impl; -import org.apache.eagle.alert.metadata.IMetadataDao; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; +import org.apache.eagle.alert.metadata.IMetadataDao; import org.apache.eagle.alert.metadata.MetadataUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,14 +38,14 @@ public class MetadataDaoFactory { private MetadataDaoFactory() { Config config = ConfigFactory.load(); - Config metaDataConfig = config.getConfig(MetadataUtils.META_DATA); - if (metaDataConfig != null) { + if (!config.hasPath(MetadataUtils.META_DATA)) { LOG.warn("metadata is not configured, use in-memory store !!!"); - dao = new InMemMetadataDaoImpl(metaDataConfig); + dao = new InMemMetadataDaoImpl(null); } else { - String clsName = metaDataConfig.getString(MetadataUtils.ALERT_META_DATA_DAO); - Class<?> clz; + Config metaDataConfig = config.getConfig(MetadataUtils.META_DATA); try { + String clsName = metaDataConfig.getString(MetadataUtils.ALERT_META_DATA_DAO); + Class<?> clz; clz = Thread.currentThread().getContextClassLoader().loadClass(clsName); if (IMetadataDao.class.isAssignableFrom(clz)) { Constructor<?> cotr = clz.getConstructor(Config.class);