Package com.cloudera.flume.handlers.debug

Examples of com.cloudera.flume.handlers.debug.ConsoleEventSink


    assertEquals(0, wal.getLoggedTags().size());
    assertEquals(1, wal.getSendingTags().size());

    // read next event
    Event e = null;
    ConsoleEventSink console = new ConsoleEventSink();
    while ((e = curSource.next()) != null) {
      console.append(e);
    }
    curSource.close();
    assertEquals(0, wal.getSendingTags().size());
  }
View Full Code Here


*/
public class TestValueDecorator {
  @Test
  public void testValueDecorator() throws IOException, InterruptedException {
    String value = "value%{nanos}";
    ValueDecorator dec = new ValueDecorator(new ConsoleEventSink(), "attr", value, false);
    dec.open();
    Event e = new EventImpl("body".getBytes(), 1234567L, Event.Priority.INFO, 87654321L, "host");

    dec.append(e);

View Full Code Here

  }

  @Test
  public void testValueDecoratorWithEscape() throws IOException, InterruptedException {
    String value = "value-%{nanos}-%{body}";
    ValueDecorator dec = new ValueDecorator(new ConsoleEventSink(), "attr", value, true);
    dec.open();
    Event e = new EventImpl("bodyString".getBytes(), 1234567L, Event.Priority.INFO, 87654321L, "host");

    dec.append(e);
View Full Code Here

    assertEquals(0, wal.getLoggedTags().size());
    assertEquals(1, wal.getSendingTags().size());

    // read next event
    Event e = null;
    ConsoleEventSink console = new ConsoleEventSink();
    while ((e = curSource.next()) != null) {
      console.append(e);
    }
    curSource.close();
    assertEquals(0, wal.getSendingTags().size());
    assertEquals(1, wal.getSentTags().size());
View Full Code Here

public class TestReorderDecorator {
  // first version for me to see the order
  @Test
  public void testReorderDecorator() throws IOException {
    ReorderDecorator<EventSink> reorder =
        new ReorderDecorator<EventSink>(new ConsoleEventSink(), .5, .5, 0);
    reorder.open();
    for (int i = 0; i < 10; i++) {
      Event e = new EventImpl(new byte[0]);
      e.set("order", ByteBuffer.allocate(4).putInt(i).array());
      reorder.append(e);
View Full Code Here

    int msgs = 5;
    CounterSink cnt = new CounterSink("count");
    AckChecksumInjector<EventSink> aci =
        new AckChecksumInjector<EventSink>(new FanOutSink<EventSink>(cnt,
            new ConsoleEventSink()));

    aci.open();
    for (int i = 0; i < msgs; i++) {
      Event e = new EventImpl(("this is a test " + i).getBytes());
      aci.append(e);
View Full Code Here

    assertEquals(0, wal.getLoggedTags().size());
    assertEquals(1, wal.getSendingTags().size());

    // read next event
    Event e = null;
    ConsoleEventSink console = new ConsoleEventSink();
    while ((e = curSource.next()) != null) {
      console.append(e);
    }
    curSource.close();
    assertEquals(0, wal.getSendingTags().size());
    assertEquals(1, wal.getSentTags().size());
View Full Code Here

    }
    ackinj.close();

    // there now are now 7 events in the mem
    // consume data.
    EventSink es1 = new ConsoleEventSink();
    EventUtil.dumpAll(mem, es1);
    System.out.println("---");

    String rpt = "foo";
    String snk = "  { intervalDroppyAppend(5)  => { ackChecker => [console, counter(\""
View Full Code Here

    // agent side, inject ack messages
    WALAckManager aac = new WALAckManager(svr, new AckListener.Empty(),
        FlumeConfiguration.get().getAgentAckedRetransmit());
    byte[] tag = "canned tag".getBytes();
    AckChecksumInjector<EventSink> inj = new AckChecksumInjector<EventSink>(
        new ConsoleEventSink(), tag, aac.getAgentAckQueuer());

    // send a bunch of messages and then close out.
    inj.open();
    for (int i = 0; i < 10; i++) {
      Event e = new EventImpl(("This is a test " + i).getBytes());
View Full Code Here

    // mock master rpc interface
    MockMasterRPC svr = new MockMasterRPC();

    // collector side, receive acks messages, checks acks, and notifies master.
    AckChecksumChecker<EventSink> chk = new AckChecksumChecker<EventSink>(
        new ConsoleEventSink(), new CollectorAckListener(svr));

    // agent side, inject ack messages
    WALAckManager aac = new WALAckManager(svr, new AckListener.Empty(),
        FlumeConfiguration.get().getAgentAckedRetransmit());
    byte[] tag = "canned tag".getBytes();
View Full Code Here

TOP

Related Classes of com.cloudera.flume.handlers.debug.ConsoleEventSink

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.