Repository: ambari Updated Branches: refs/heads/trunk 04511ceae -> 2ab6d0632
AMBARI-17246. Ignore logs for performance testing of grok patters (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/2ab6d063 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2ab6d063 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2ab6d063 Branch: refs/heads/trunk Commit: 2ab6d06326ed28ffb39cf0ab05f4154f763fc59c Parents: 04511ce Author: oleewere <oleew...@gmail.com> Authored: Wed Jun 15 19:57:33 2016 +0200 Committer: oleewere <oleew...@gmail.com> Committed: Wed Jun 15 19:57:33 2016 +0200 ---------------------------------------------------------------------- .../ambari/logfeeder/output/OutputDevNull.java | 37 ++++++++++++++++++++ .../src/main/resources/alias_config.json | 3 ++ 2 files changed, 40 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2ab6d063/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputDevNull.java ---------------------------------------------------------------------- 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 0000000..b6188cb --- /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); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/2ab6d063/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json ---------------------------------------------------------------------- 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 d8a239a..a55b348 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