summaryrefslogtreecommitdiff
path: root/ambari-logsearch/ambari-logsearch-logfeeder
diff options
context:
space:
mode:
authoroleewere <oleewere@gmail.com>2016-06-15 19:57:33 +0200
committeroleewere <oleewere@gmail.com>2016-06-15 19:58:58 +0200
commit7ec8b68a67043b16239681dcc68de49604166657 (patch)
tree2a0cfdb19e6340a6a8fddd034ed7cbd525be0a97 /ambari-logsearch/ambari-logsearch-logfeeder
parentc1782023d7d61acbcc6472cb3bc85c7346d0813e (diff)
AMBARI-17246. Ignore logs for performance testing of grok patters (Hayat Behlim via oleewere)
Diffstat (limited to 'ambari-logsearch/ambari-logsearch-logfeeder')
-rw-r--r--ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputDevNull.java37
-rw-r--r--ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json3
2 files changed, 40 insertions, 0 deletions
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputDevNull.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputDevNull.java
new file mode 100644
index 0000000000..b6188cb35f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputDevNull.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ambari.logfeeder.output;
+
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.log4j.Logger;
+
+/**
+ * Output that just ignore the logs
+ *
+ */
+public class OutputDevNull extends Output {
+
+ private static Logger logger = Logger.getLogger(OutputDevNull.class);
+
+ @Override
+ public void write(String block, InputMarker inputMarker) throws Exception {
+ // just ignore the logs
+ logger.trace("Ignore log block: " + block);
+ }
+}
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json
index d8a239a6e8..a55b348ff5 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json
@@ -37,6 +37,9 @@
},
"kafka": {
"klass": "org.apache.ambari.logfeeder.output.OutputKafka"
+ },
+ "dev_null": {
+ "klass": "org.apache.ambari.logfeeder.output.OutputDevNull"
}
}
} \ No newline at end of file