ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-17190. Logfeeder ignore same error log to specific time (Hayat Behlim via oleewere)
Date Wed, 15 Jun 2016 17:51:41 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 28622c00e -> c1782023d


AMBARI-17190. Logfeeder ignore same error log to specific time (Hayat Behlim via oleewere)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c1782023
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c1782023
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c1782023

Branch: refs/heads/branch-2.4
Commit: c1782023d7d61acbcc6472cb3bc85c7346d0813e
Parents: 28622c0
Author: oleewere <oleewere@gmail.com>
Authored: Wed Jun 15 19:49:49 2016 +0200
Committer: oleewere <oleewere@gmail.com>
Committed: Wed Jun 15 19:51:05 2016 +0200

----------------------------------------------------------------------
 .../ambari/logfeeder/logconfig/FetchConfigFromSolr.java       | 7 +++++--
 .../main/java/org/apache/ambari/logfeeder/util/SolrUtil.java  | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c1782023/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
index 1f86dd0..f2d074a 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
@@ -48,8 +48,11 @@ public class FetchConfigFromSolr extends Thread {
   @Override
   public void run() {
     String zkHosts = LogFeederUtil.getStringProperty("logfeeder.solr.zkhosts");
-    if( zkHosts == null || zkHosts.trim().length() == 0 ) {
-      logger.warn("Solr ZKHosts for UserConfig/History is not set. Won't look for level configuration
from Solr.");
+    String solrUrl = LogFeederUtil.getStringProperty("logfeeder.solr.url");
+    if ((zkHosts == null || zkHosts.trim().length() == 0)
+        && (solrUrl == null || solrUrl.trim().length() == 0)) {
+      logger
+          .warn("Solr ZKHosts or solrUrl for UserConfig/History is not set. Won't look for
level configuration from Solr.");
       return;
     }
     solrConfigInterval = LogFeederUtil.getIntProperty("logfeeder.solr.config.interval", solrConfigInterval);

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1782023/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
index 200a603..29feef7 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
@@ -143,7 +143,7 @@ public class SolrUtil {
             + solrDetail + ", response=" + response);
           break;
         } else {
-          logger.warn("Solr is not not reachable yet. getCollections() attempt count=" +
pingCount
+          logger.warn("Solr is not reachable yet. getCollections() attempt count=" + pingCount
             + ". Will sleep for " + waitIntervalMS + " ms and try again." + " solr=" + solrDetail
             + ", response=" + response);
 
@@ -194,7 +194,10 @@ public class SolrUtil {
         }
       }
     } catch (Exception e) {
-      logger.error("Error getting config", e);
+      final String logMessageKey = this.getClass().getSimpleName()
+          + "_FETCH_FILTER_CONFIG_ERROR";
+      LogFeederUtil.logErrorMessageByInterval(logMessageKey,
+          "Error getting filter config from solr", e, logger, Level.ERROR);
     }
     return configMap;
   }


Mime
View raw message