Skip to content
Permalink
Browse files
AMBARI-24386 - [Log Search] Input config validator unable to parse an…
…y log entry (#1923)
  • Loading branch information
kasakrisz committed Jul 31, 2018
1 parent 8afee0b commit 35587cab8136f8adbcff535c3756cdb9cc75bdfb
Showing 1 changed file with 10 additions and 2 deletions.
@@ -25,6 +25,7 @@
import java.util.List;
import java.util.Map;

import org.apache.ambari.logfeeder.conf.LogEntryCacheConfig;
import org.apache.ambari.logfeeder.conf.LogFeederProps;
import org.apache.ambari.logfeeder.input.InputFileMarker;
import org.apache.ambari.logfeeder.input.InputManagerImpl;
@@ -82,13 +83,20 @@ public Map<String, Object> parse() throws Exception {
ConfigHandler configHandler = new ConfigHandler(null);
configHandler.setInputManager(new InputManagerImpl());
OutputManagerImpl outputManager = new OutputManagerImpl();
LogFeederProps logFeederProps = new LogFeederProps();
LogEntryCacheConfig logEntryCacheConfig = new LogEntryCacheConfig();
logEntryCacheConfig.setCacheEnabled(false);
logEntryCacheConfig.setCacheSize(0);
logFeederProps.setLogEntryCacheConfig(logEntryCacheConfig);
outputManager.setLogFeederProps(logFeederProps);
LogLevelFilterHandler logLevelFilterHandler = new LogLevelFilterHandler(null);
logLevelFilterHandler.setLogFeederProps(new LogFeederProps());
logLevelFilterHandler.setLogFeederProps(logFeederProps);
outputManager.setLogLevelFilterHandler(logLevelFilterHandler);
configHandler.setOutputManager(outputManager);
Input input = configHandler.getTestInput(inputConfig, logId);
input.init(logFeederProps);
final Map<String, Object> result = new HashMap<>();
input.getFirstFilter().init(new LogFeederProps());
input.getFirstFilter().init(logFeederProps);
input.addOutput(new Output<LogFeederProps, InputFileMarker>() {
@Override
public void init(LogFeederProps logFeederProperties) throws Exception {

0 comments on commit 35587ca

Please sign in to comment.