Package com.cloudera.flume.core

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


public class TestHadoopLogData implements ExampleData {

  @Test
  public void testLineCount() throws IOException, InterruptedException {
    EventSource src = new NoNlASCIISynthSource(25, 100, 1);
    src.open();

    SimpleRegexReporterBuilder b = new SimpleRegexReporterBuilder(getClass()
        .getClassLoader().getResource(HADOOP_REGEXES).getFile());
    Collection<RegexGroupHistogramSink> sinks = b.load();
    MultiReporter mr = new MultiReporter("apache_sinks", sinks);
View Full Code Here


    MultiGrepReporterSink<String> snk = new MultiGrepReporterSink<String>(
        "multi grep", aho);
    snk.open();

    EventSource src = new NoNlASCIISynthSource(25, 100, 1);
    src.open();

    EventUtil.dumpAll(src, snk);

    snk.append(new EventImpl(NPE.getBytes()));
    snk.append(new EventImpl(LOST.getBytes()));
View Full Code Here

    MultiGrepReporterSink<String> snk = c.iterator().next();
    snk.open();

    EventSource src = new NoNlASCIISynthSource(25, 100, 1);

    src.open();

    EventUtil.dumpAll(src, snk);
    snk.append(new EventImpl(NPE.getBytes()));
    snk.append(new EventImpl(LOST.getBytes()));
    snk.append(new EventImpl(LOST.getBytes()));
View Full Code Here

      // setup a source of data that will shove a lot of ack laden data into the
      // stream.
      MemorySinkSource mem = new MemorySinkSource();
      EventSource src = new NoNlASCIISynthSource(COUNT, 10);
      src.open();
      Event e;
      while ((e = src.next()) != null) {
        AckChecksumInjector<EventSink> acks = new AckChecksumInjector<EventSink>(
            mem);
        acks.open(); // memory in sink never resets, and just keeps appending
View Full Code Here

    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

      InterruptedException {
    String snkcfg = "agentSink(\"localhost\", 12345)";

    EventSource src = FlumeBuilder.buildSource(
        LogicalNodeContext.testingContext(), "collectorSource(12345)");
    src.open();

    for (int i = 0; i < 20; i++) {
      EventSink snk = FlumeBuilder.buildSink(
          LogicalNodeContext.testingContext(), snkcfg);
      snk.open();
View Full Code Here

      try {
        synchronized (stateSignal) {
          state = DriverState.OPENING;
          stateSignal.notifyAll();
        }
        source.open();
        sink.open();
      } catch (Exception e) {
        // if open is interrupted or has an exception there was a problem.
        LOG.error("Closing down due to exception on open calls");
        errorCleanup(PumperThread.this.getName(), e);
View Full Code Here

    workerThread = new Thread() {

      @Override
      public void run() {
        try {
          eventSource.open();
          eventSink.open();

          EventUtil.dumpN(10, eventSource, eventSink);
          Clock.sleep(500);
          eventSource.close();
View Full Code Here

    final int count = 60;
    Thread t = new Thread() {
      @Override
      public void run() {
        try {
          src.open();
          snk.open();
          EventUtil.dumpN(count, src, snk);
          src.close();
          snk.close();
          done.countDown();
View Full Code Here

      @Override
      public void run() {
        try {
          Event e;

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

          e = null;

          do {
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.