Package com.cloudera.flume.handlers.debug

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


  @Test
  public void testEmptyBatches() throws FlumeSpecException, IOException,
      InterruptedException {
    BatchingDecorator<EventSink> snk = new BatchingDecorator<EventSink>(
        new ConsoleEventSink(), 2, 100000);
    snk.open();

    for (int i = 0; i < 10; i++) {
      if (i % 4 == 0) {
        snk.append(new EventImpl(("test " + i).getBytes()));
View Full Code Here


public class TestReorderDecorator {
  // first version for me to see the order
  @Test
  public void testReorderDecorator() throws IOException, InterruptedException {
    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

      InterruptedException {

    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

    }
    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

    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

    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

   */
  @Test
  public void checkSynth() throws IOException, InterruptedException {
    EventSource src = new SynthSource(5, 10, 1337);
    Event e = null;
    EventSink snk = new ConsoleEventSink(new AvroJsonOutputFormat());
    MemorySinkSource mem = new MemorySinkSource();
    while ((e = src.next()) != null) {
      snk.append(e); // visual inspection
      mem.append(e); // testing
    }

    mem.open();
    int i = 0;
View Full Code Here

   */
  @Test
  public void checkAttrSynth() throws IOException, InterruptedException {
    EventSource src = new AttrSynthSource(5, 10, 20, 15, 1337);
    Event e = null;
    EventSink snk = new ConsoleEventSink(new AvroJsonOutputFormat());
    MemorySinkSource mem = new MemorySinkSource();
    while ((e = src.next()) != null) {
      snk.append(e); // visual inspection
      mem.append(e); // testing
    }

    mem.open();
    int i = 0;
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.