Search in sources :

Example 1 with PipeListener

use of co.cask.cdap.filetailer.PipeListener in project cdap-ingest by caskdata.

the class PollingListenerImpl method setupPipe.

/**
   * Pipe setup
   *
   * @throws IOException if can not setup pipe
   */
private Pipe setupPipe(File file) throws IOException {
    PipeConfiguration pipeConfiguration = observerConf.getPipeConfiguration(file.getName());
    FileTailerQueue queue = new FileTailerQueue(pipeConfiguration.getQueueSize());
    StreamWriter writer = getStreamWriterForPipe(pipeConfiguration);
    FileTailerStateProcessor stateProcessor = new FileTailerStateProcessorImpl(observerConf.getDaemonDir(), pipeConfiguration.getStateFile());
    PipeListener pipeListener = new PipeListenerImpl(pipeConfiguration.getSourceConfiguration().getWorkDir(), file.getAbsolutePath(), observerConf.getDaemonDir() + "/" + pipeConfiguration.getStateFile());
    Pipe pipe = new Pipe(new LogTailer(pipeConfiguration, queue, stateProcessor, metricsProcessor, pipeListener), new FileTailerSink(queue, writer, SinkStrategy.LOADBALANCE, stateProcessor, metricsProcessor, pipeListener, pipeConfiguration.getSinkConfiguration().getPackSize()));
    pipeListener.setPipe(pipe);
    return pipe;
}
Also used : FileTailerStateProcessorImpl(co.cask.cdap.filetailer.state.FileTailerStateProcessorImpl) PipeConfiguration(co.cask.cdap.filetailer.config.PipeConfiguration) FileTailerQueue(co.cask.cdap.filetailer.queue.FileTailerQueue) LogTailer(co.cask.cdap.filetailer.tailer.LogTailer) FileTailerSink(co.cask.cdap.filetailer.sink.FileTailerSink) StreamWriter(co.cask.cdap.client.StreamWriter) PipeListener(co.cask.cdap.filetailer.PipeListener) Pipe(co.cask.cdap.filetailer.Pipe) FileTailerStateProcessor(co.cask.cdap.filetailer.state.FileTailerStateProcessor)

Aggregations

StreamWriter (co.cask.cdap.client.StreamWriter)1 Pipe (co.cask.cdap.filetailer.Pipe)1 PipeListener (co.cask.cdap.filetailer.PipeListener)1 PipeConfiguration (co.cask.cdap.filetailer.config.PipeConfiguration)1 FileTailerQueue (co.cask.cdap.filetailer.queue.FileTailerQueue)1 FileTailerSink (co.cask.cdap.filetailer.sink.FileTailerSink)1 FileTailerStateProcessor (co.cask.cdap.filetailer.state.FileTailerStateProcessor)1 FileTailerStateProcessorImpl (co.cask.cdap.filetailer.state.FileTailerStateProcessorImpl)1 LogTailer (co.cask.cdap.filetailer.tailer.LogTailer)1