Package com.cloudera.flume.core

Examples of com.cloudera.flume.core.CompositeSink


  @Test
  public void testTailSource() throws IOException, FlumeSpecException,
      InterruptedException {
    File f = File.createTempFile("temp", ".tmp");
    f.deleteOnExit();
    final CompositeSink snk = new CompositeSink(new ReportTestingContext(),
        "{ delay(50) => counter(\"count\") }");
    final EventSource src = TailSource.builder().build(f.getAbsolutePath());
    final CountDownLatch done = new CountDownLatch(1);
    final int count = 30;
    runDriver(src, snk, done, count);
View Full Code Here


    File f = File.createTempFile("temp", ".tmp");
    f.deleteOnExit();
    File f2 = File.createTempFile("moved", ".tmp");
    f2.delete();
    f2.deleteOnExit();
    final CompositeSink snk = new CompositeSink(new ReportTestingContext(),
        "{ delay(50) => counter(\"count\") }");
    final EventSource src = TailSource.builder().build(f.getAbsolutePath());
    final CountDownLatch done = new CountDownLatch(1);
    final int count = 30;
    runDriver(src, snk, done, count);
View Full Code Here

      InterruptedException {
    File f = File.createTempFile("multitemp1", ".tmp");
    f.deleteOnExit();
    File f2 = File.createTempFile("multitemp2", ".tmp");
    f2.deleteOnExit();
    final CompositeSink snk = new CompositeSink(new ReportTestingContext(),
        "{ delay(50) => counter(\"count\") }");
    final EventSource src = TailSource.multiTailBuilder().build(
        f.getAbsolutePath(), f2.getAbsolutePath());
    final CountDownLatch done = new CountDownLatch(1);
    final int count = 60;
View Full Code Here

      fw.append("Line " + i + "\n");
      fw.flush();
    }
    fw.close();

    final CompositeSink snk = new CompositeSink(new ReportTestingContext(),
        "{ delay(50) => counter(\"count\") }");
    // Test start from end.
    final TailSource src = (TailSource) TailSource.builder().build(
        f.getAbsolutePath(), "true");
    final CountDownLatch done = new CountDownLatch(1);
View Full Code Here

    assertEquals("second", Attributes.readString(e2, "duped"));
  }

  @Test(expected = IllegalArgumentException.class)
  public void testRollRollConflict() throws IOException, FlumeSpecException {
    EventSink snk = new CompositeSink(new Context(),
        "{value(\"rolltag\",\"foofoo\") =>   roll(10000) {null} } ");
    Event e = new EventImpl("foo".getBytes());
    snk.open();
    snk.append(e); // should bork.
  }
View Full Code Here

    snk.append(e); // should bork.
  }

  @Test(expected = IllegalArgumentException.class)
  public void testRollRollBork() throws IOException, FlumeSpecException {
    EventSink snk = new CompositeSink(new Context(),
        "roll(10000) { roll(10000) { null } } ");
    Event e = new EventImpl("foo".getBytes());
    snk.open();
    snk.append(e); // should bork.
  }
View Full Code Here

    snk.append(e); // should bork.
  }

  @Test
  public void testRollRollNoConflict() throws IOException, FlumeSpecException {
    EventSink snk = new CompositeSink(new Context(),
        "{value(\"rolltag\",\"foofoo\") =>  "
            + "{ mask(\"rolltag\")=>  roll(10000) { null}}} ");

    Event e = new EventImpl("foo".getBytes());
    snk.open();
    snk.append(e); // should not bork.
  }
View Full Code Here

    snk.append(e); // should not bork.
  }

  @Test
  public void testRollRollNoBork() throws IOException, FlumeSpecException {
    EventSink snk = new CompositeSink(new Context(),
        "roll(10000) {{ mask(\"rolltag\") => roll(10000) {null} }} ");
    Event e = new EventImpl("foo".getBytes());
    snk.open();
    snk.append(e); // should not bork.
  }
View Full Code Here

  public void testAgentCollector() throws FlumeSpecException, IOException {
    BenchmarkHarness.setupLocalWriteDir();
    File path = File.createTempFile("collector", ".tmp");
    path.deleteOnExit();

    EventSink snk = new CompositeSink(new Context(),
        "{ ackedWriteAhead => roll(1000) { dfs(\"file://" + path + "\") } }");
    Event e = new EventImpl("foo".getBytes());
    snk.open();
    snk.append(e); // should not bork.
    snk.close();
    BenchmarkHarness.cleanupLocalWriteDir();
  }
View Full Code Here

  public void testAgentCollectorFixed() throws FlumeSpecException, IOException {
    BenchmarkHarness.setupLocalWriteDir();
    File path = File.createTempFile("collector", ".tmp");
    path.deleteOnExit();

    EventSink snk = new CompositeSink(new Context(),
        "{ ackedWriteAhead => { mask(\"rolltag\") => roll(1000) { dfs(\"file://"
            + path + "\") } } }");
    Event e = new EventImpl("foo".getBytes());
    snk.open();
    snk.append(e); // should not bork.
    snk.close();
    BenchmarkHarness.cleanupLocalWriteDir();
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.core.CompositeSink

Copyright © 2018 www.massapicom. 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.