Package com.cloudera.flume.core

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


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

    // open changes state
    curSource.open();
    assertEquals(0, wal.getLoggedTags().size());
    assertEquals(1, wal.getSendingTags().size());

    // read next event
    Event e = null;
View Full Code Here


    File commit = new File(tmpdir, "committed");
    commit.deleteOnExit();
    EventSource src = new SeqfileEventSource(corrupt.getAbsolutePath());

    try {
      src.open(); // expect IOException
    } catch (IOException e) {
      throw e;
    } finally {
      FileUtil.rmr(tmpdir);
    }
View Full Code Here

  @Test
  public void testOpenClose() throws IOException, TException,
      InterruptedException {
    EventSource src = ScribeEventSource.builder().build("45872");
    for (int i = 0; i < 10; ++i) {
      src.open();
      src.close();
    }
    src.open();

    // Open the client connection
View Full Code Here

      InterruptedException {
    Context ctx = LogicalNodeContext.testingContext();

    // 25 lines of 100 bytes of ascii
    EventSource src = srcfact.getSource(ctx, "asciisynth", "25", "100");
    src.open();
    Event e = null;
    int cnt = 0;
    while ((e = src.next()) != null) {
      System.out.println(e);
      cnt++;
View Full Code Here

    EventSource src = ScribeEventSource.builder().build("45872");
    for (int i = 0; i < 10; ++i) {
      src.open();
      src.close();
    }
    src.open();

    // Open the client connection
    TTransport transport = new TSocket("localhost", 45872);
    transport = new TFramedTransport(transport);
    // scribe clients do not use strict write
View Full Code Here

    EventSink snk = fact.getSink(ctx, "console");
    snk.open();

    EventSource src = srcfact.getSource(ctx, "asciisynth", "25", "100");
    src.open();

    DirectDriver conn = new DirectDriver(src, snk);
    conn.start();

    conn.join(Long.MAX_VALUE);
View Full Code Here

  @Test
  public void testDecorator() throws IOException, FlumeSpecException,
      InterruptedException {
    Context ctx = LogicalNodeContext.testingContext();
    EventSource src = srcfact.getSource(ctx, "asciisynth", "25", "100");
    src.open();

    EventSinkDecorator<EventSink> deco =

    fact.getDecorator(new Context(), "intervalSampler", "5");
    EventSink snk = fact.getSink(new Context(), "counter", "name");
View Full Code Here

        + " network connection in the middle");
    Context ctx = LogicalNodeContext.testingContext();
    EventSource rpcSrc = srcfact.getSource(ctx, "rpcSource", "31337");
    EventSink rpcSink = fact.getSink(ctx, "rpcSink", "0.0.0.0", "31337");
    // Rpcsrc needs to be started before the Rpcsink can connect to it.
    rpcSrc.open();
    rpcSink.open();

    Thread.sleep(100); // need some time to open the connector.

    EventSink counter = fact.getSink(ctx, "counter", "count");
View Full Code Here

    Thread.sleep(100); // need some time to open the connector.

    EventSink counter = fact.getSink(ctx, "counter", "count");
    EventSource txtsrc = srcfact.getSource(ctx, "asciisynth", "25", "100");
    counter.open();
    txtsrc.open();

    DirectDriver svrconn = new DirectDriver(rpcSrc, counter);
    svrconn.start();

    DirectDriver cliconn = new DirectDriver(txtsrc, rpcSink);
View Full Code Here

            ReportManager.get().add(cnt1);
            // make each parallel instance send a slightly different number of
            // messages.
            EventSource src = new NoNlASCIISynthSource(events + idx, 100);

            src.open();
            snk.open();

            started.countDown();

            EventUtil.dumpAll(src, snk);
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.