use of co.cask.cdap.filetailer.config.PipeConfiguration in project cdap-ingest by caskdata.
the class FileTailerIT method loadConfig.
private PipeConfiguration loadConfig(File file) throws ConfigurationLoadingException {
ConfigurationLoader loader = new ConfigurationLoaderImpl();
Configuration configuration = loader.load(file);
List<PipeConfiguration> pipeConfig = configuration.getPipeConfigurations();
return pipeConfig.get(0);
}
use of co.cask.cdap.filetailer.config.PipeConfiguration in project cdap-ingest by caskdata.
the class FileTailerIT method fileTailerBasicIT.
@Test
public void fileTailerBasicIT() throws Exception {
File configFile = getConfigFile();
PipeConfiguration pipeConfig = loadConfig(configFile);
String logFilePath = pipeConfig.getSourceConfiguration().getWorkDir().getAbsolutePath() + "/" + pipeConfig.getSourceConfiguration().getFileName();
Logger logger = getTimeLogger(logFilePath);
writeLogs(logger, ENTRY_NUMBER);
PipeManager manager = new PipeManager(configFile);
mockMetricsProcessor(manager);
long startTime = System.currentTimeMillis();
manager.startAsync();
writeLogs(logger, ENTRY_NUMBER);
Thread.sleep(SLEEP_TIME);
logger.getAppender("File Tailer IT").stop();
manager.stopAsync();
Thread.sleep(SLEEP_TIME);
Assert.assertEquals(read.get(), ingest.get());
checkDeliveredEvents(ENTRY_NUMBER * 2, startTime);
}
Aggregations