ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgerg...@apache.org
Subject [1/2] ambari git commit: Revert "AMBARI-2003 LogFeeder Simulator Enhancements for 3000-node cluster testing (mgergely)"
Date Fri, 24 Feb 2017 00:17:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7bbc678c5 -> fc5cbc6e3


Revert "AMBARI-2003 LogFeeder Simulator Enhancements for 3000-node cluster testing (mgergely)"

This reverts commit b68bb74c47ee4a824d1b9d4fc243db31d185eb41.


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

Branch: refs/heads/trunk
Commit: 1f41cc07b2f9ad2f40de37c3c73d9eff58a68fd7
Parents: 7bbc678
Author: Miklos Gergely <mgergely@hortonworks.com>
Authored: Fri Feb 24 01:16:05 2017 +0100
Committer: Miklos Gergely <mgergely@hortonworks.com>
Committed: Fri Feb 24 01:16:05 2017 +0100

----------------------------------------------------------------------
 .../org/apache/ambari/logfeeder/LogFeeder.java  | 13 ++------
 .../ambari/logfeeder/common/ConfigBlock.java    |  2 +-
 .../apache/ambari/logfeeder/filter/Filter.java  |  4 +--
 .../ambari/logfeeder/input/InputSimulate.java   | 31 ++------------------
 4 files changed, 8 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1f41cc07/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
index d584890..24651ba 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
@@ -245,7 +245,7 @@ public class LogFeeder {
 
       // We will only check for is_enabled out here. Down below we will check whether this
output is enabled for the input
       if (output.getBooleanValue("is_enabled", true)) {
-        output.logConfigs(Level.INFO);
+        output.logConfgs(Level.INFO);
         outputManager.add(output);
       } else {
         LOG.info("Output is disabled. So ignoring it. " + output.getShortDescription());
@@ -277,7 +277,7 @@ public class LogFeeder {
         input.setOutputManager(outputManager);
         input.setInputManager(inputManager);
         inputManager.add(input);
-        input.logConfigs(Level.INFO);
+        input.logConfgs(Level.INFO);
       } else {
         LOG.info("Input is disabled. So ignoring it. " + input.getShortDescription());
       }
@@ -311,7 +311,7 @@ public class LogFeeder {
         if (filter.isEnabled()) {
           filter.setOutputManager(outputManager);
           input.addFilter(filter);
-          filter.logConfigs(Level.INFO);
+          filter.logConfgs(Level.INFO);
         } else {
           LOG.debug("Ignoring filter " + filter.getShortDescription() + " for input " + input.getShortDescription());
         }
@@ -371,13 +371,6 @@ public class LogFeeder {
         }
       }
     }
-    
-    // In case of simulation copies of the output are added for each simulation instance,
these must be added to the manager
-    for (Output output : InputSimulate.getSimulateOutputs()) {
-      outputManager.add(output);
-      usedOutputSet.add(output);
-    }
-    
     outputManager.retainUsedOutputs(usedOutputSet);
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f41cc07/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/ConfigBlock.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/ConfigBlock.java
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/ConfigBlock.java
index 68897e8..47ddc51 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/ConfigBlock.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/common/ConfigBlock.java
@@ -223,7 +223,7 @@ public abstract class ConfigBlock {
     logStatForMetric(statMetric, "Stat");
   }
 
-  public boolean logConfigs(Priority level) {
+  public boolean logConfgs(Priority level) {
     if (level.toInt() == Priority.INFO_INT && !LOG.isInfoEnabled()) {
       return false;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f41cc07/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
index afd903e..684f3c4 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
@@ -173,8 +173,8 @@ public abstract class Filter extends ConfigBlock {
   }
 
   @Override
-  public boolean logConfigs(Priority level) {
-    if (!super.logConfigs(level)) {
+  public boolean logConfgs(Priority level) {
+    if (!super.logConfgs(level)) {
       return false;
     }
     LOG.log(level, "input=" + input.getShortDescription());

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f41cc07/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
index 2222f93..be97a52 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
@@ -29,21 +29,17 @@ import java.util.Map;
 import java.util.Random;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.ambari.logfeeder.filter.Filter;
 import org.apache.ambari.logfeeder.filter.FilterJSON;
-import org.apache.ambari.logfeeder.output.Output;
 import org.apache.ambari.logfeeder.util.LogFeederUtil;
-import org.apache.log4j.Logger;
 import org.apache.solr.common.util.Base64;
 
 import com.google.common.base.Joiner;
 
 public class InputSimulate extends Input {
-  private static final Logger LOG = Logger.getLogger(InputSimulate.class);
 
-  private static final String LOG_TEXT_PATTERN = "{ logtime=\"%d\", level=\"%s\", log_message=\"%s\",
host=\"%s\"}";
+  private static final String LOG_TEXT_PATTERN = "{ logtime=\"%d\", level=\"%s\", log_message=\"%s\"}";
   
   private static final Map<String, String> typeToFilePath = new HashMap<>();
   public static void loadTypeToFilePath(List<Map<String, Object>> inputList)
{
@@ -56,13 +52,6 @@ public class InputSimulate extends Input {
   
   private static final Map<String, Integer> typeToLineNumber = new HashMap<>();
   
-  private static final AtomicInteger hostNumber = new AtomicInteger(0);
-  
-  private static final List<Output> simulateOutputs = new ArrayList<>();
-  public static List<Output> getSimulateOutputs() {
-    return simulateOutputs;
-  }
-  
   private final Random random = new Random(System.currentTimeMillis());
   
   private final List<String> types;
@@ -71,7 +60,6 @@ public class InputSimulate extends Input {
   private final int minLogWords;
   private final int maxLogWords;
   private final long sleepMillis;
-  private final String host;
   
   public InputSimulate() throws Exception {
     this.types = getSimulatedLogTypes();
@@ -80,7 +68,6 @@ public class InputSimulate extends Input {
     this.minLogWords = LogFeederUtil.getIntProperty("logfeeder.simulate.min_log_words", 5,
1, 10);
     this.maxLogWords = LogFeederUtil.getIntProperty("logfeeder.simulate.max_log_words", 10,
10, 20);
     this.sleepMillis = LogFeederUtil.getIntProperty("logfeeder.simulate.sleep_milliseconds",
10000);
-    this.host = "#" + hostNumber.incrementAndGet() + "-" + LogFeederUtil.hostName;
     
     Filter filter = new FilterJSON();
     filter.loadConfig(Collections.<String, Object> emptyMap());
@@ -100,20 +87,6 @@ public class InputSimulate extends Input {
   }
 
   @Override
-  public void addOutput(Output output) {
-    try {
-      Class<? extends Output> clazz = output.getClass();
-      Output outputCopy = clazz.newInstance();
-      outputCopy.loadConfig(output.getConfigs());
-      simulateOutputs.add(outputCopy);
-      super.addOutput(outputCopy);
-    } catch (Exception e) {
-      LOG.warn("Could not copy Output class " + output.getClass() + ", using original output");
-      super.addOutput(output);
-    }
-  }
-
-  @Override
   public boolean isReady() {
     return true;
   }
@@ -170,7 +143,7 @@ public class InputSimulate extends Input {
   private String getLine() {
     Date d = new Date();
     String logMessage = createLogMessage();
-    return String.format(LOG_TEXT_PATTERN, d.getTime(), level, logMessage, host);
+    return String.format(LOG_TEXT_PATTERN, d.getTime(), level, logMessage);
   }
   
   private String createLogMessage() {


Mime
View raw message