Package com.cloudera.flume.core

Examples of com.cloudera.flume.core.EventSource.open()


    f.deleteOnExit();
    FileWriter fw = new FileWriter(f);

    ExecNioSource.Builder builder = new ExecNioSource.Builder();
    EventSource source = builder.build("tail -F " + f.getAbsolutePath());
    source.open();

    fw.write("foo\n");
    fw.flush();
    Event e = source.next();
    assertTrue(Arrays.equals("foo".getBytes(), e.getBody()));
View Full Code Here


    f.deleteOnExit();
    FileWriter fw = new FileWriter(f);

    ExecNioSource.Builder builder = new ExecNioSource.Builder();
    EventSource source = builder.build("tail -F " + f.getAbsolutePath());
    source.open();

    fw.write("foo\n");
    fw.flush();
    Event e = source.next();
    assertTrue(Arrays.equals("foo".getBytes(), e.getBody()));
View Full Code Here

   * @throws InterruptedException
   */
  @Test
  public void testThriftSend() throws IOException, InterruptedException {
    EventSource txt = new NoNlASCIISynthSource(25, 100);
    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);
    txt.close();

View Full Code Here

   *
   */
  @Test
  public void testThriftRawSend() throws IOException, InterruptedException {
    EventSource txt = new NoNlASCIISynthSource(25, 100);
    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);
    txt.close();

View Full Code Here

          try {
            // TODO (jon) this may have different sizes due to the host it is
            // running on . Needs to be fixed.
            EventSource txt = new NoNlASCIISynthSource(25, 100);

            txt.open();
            MemorySinkSource mem = new MemorySinkSource();
            mem.open();
            EventUtil.dumpAll(txt, mem);
            txt.close();
View Full Code Here

    EventSink snk2 = new BenchmarkReportDecorator<EventSink>("report", snk);
    EventSink snk3 = new BenchmarkInjectDecorator<EventSink>(snk2);
    EventSink snk4 = new InMemoryDecorator<EventSink>(snk3);

    DirectDriver connect = new DirectDriver(src, snk4);
    src.open();
    snk4.open();
    connect.start();
    connect.join(Long.MAX_VALUE);
    src.close();
    snk4.close();
View Full Code Here

    EventSink snk = new ConsoleEventSink();
    EventSink snk2 = new BenchmarkReportDecorator<EventSink>("report", snk);
    EventSink snk3 = new BenchmarkInjectDecorator<EventSink>(snk2);

    DirectDriver connect = new DirectDriver(src, snk3);
    src.open();
    snk3.open();
    connect.start();
    connect.join(Long.MAX_VALUE);
    src.close();
    snk3.close();
View Full Code Here

    int latency = 0; // 0 never triggers on time
    GzipDecorator<EventSink> gzip = new GzipDecorator<EventSink>(gunzip);
    BatchingDecorator<EventSink> batch = new BatchingDecorator<EventSink>(gzip,
        evts, latency);

    src.open();
    batch.open();
    EventUtil.dumpAll(src, batch);
    src.close();
    batch.close();
View Full Code Here

public class TestFileSource implements ExampleData {

  @Test
  public void testFileSource() throws IOException, InterruptedException {
    EventSource src = new TextFileSource(TEST);
    src.open();
    int count = 0;
    while (true) {
      Event e = src.next();
      if (e == null)
        break;
View Full Code Here

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), spec);

    EventSource src = MemorySinkSource.cannedData("test ", 5);
    snk.open();
    src.open();
    EventUtil.dumpAll(src, snk);
    src.close();
    snk.close();

    CounterSink cnt = (CounterSink) ReportManager.get().getReportable(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.