Package com.cloudera.flume.core

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


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

  @Test
  public void testRollRollNoConflict() throws IOException, FlumeSpecException, InterruptedException {
View Full Code Here


    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.
  }

  @Test
  public void testRollRollNoBork() throws IOException, FlumeSpecException, InterruptedException {
View Full Code Here

  @Test
  public void testRollRollNoBork() throws IOException, FlumeSpecException, InterruptedException {
    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.
  }

  // This used to trigger an exception but now that the rolltag is suppressed it
  // should no longer.
View Full Code Here

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

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

  public void testSyslogConsole() throws FlumeSpecException, IOException,
      InterruptedException {

    EventSink snk = FlumeBuilder
        .buildSink(new Context(), "console(\"syslog\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

      public void run() {
        try {
          Event e;

          source.open();
          sink.open();

          e = null;

          do {
            e = source.next();
View Full Code Here

  public void testDefaultConsole() throws FlumeSpecException, IOException,
      InterruptedException {

    EventSink snk = FlumeBuilder.buildSink(new Context(),
        "console(\"default\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

  @Test
  public void testLog4jConsole() throws FlumeSpecException, IOException,
      InterruptedException {

    EventSink snk = FlumeBuilder.buildSink(new Context(), "console(\"log4j\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

  @Test
  public void testJsonConsole() throws FlumeSpecException, IOException,
      InterruptedException {

    EventSink snk = FlumeBuilder.buildSink(new Context(), "console(\"json\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
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.