Package com.cloudera.flume.core

Examples of com.cloudera.flume.core.EventImpl


   */
  @Test
  public void testAgentDFOCollector() throws IOException, FlumeSpecException,
      InterruptedException {
    String agentCollector = "{diskFailover(1000) => roll (100000) { null } }";
    Event e = new EventImpl("foo".getBytes());
    EventSink agent = FlumeBuilder.buildSink(LogicalNodeContext
        .testingContext(), agentCollector);
    agent.open();
    agent.append(e);

View Full Code Here


        .testingContext(), "collectorSource(34568)");
    EventSink snk = FlumeBuilder.buildSink(new Context(),
        "rpcSink(\"localhost\", 34568)");
    src.open();
    snk.open();
    snk.append(new EventImpl("foo".getBytes()));
    src.next();
    snk.close();
    src.close();

  }
View Full Code Here

    EventSink es = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), snk);

    es.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("test message " + i).getBytes());
      System.out.println("initial append: " + e);
      es.append(e);
      Clock.sleep(100);
    }
    Clock.sleep(5000);
View Full Code Here

          }
        }, 250, FlumeNode.getInstance().getCollectorAckListener());

    sink.open();
    sink.append(new EventImpl(new byte[0]));
    sink.close();
    File f = new File("/tmp/flume-test-correct-filename/actual-file-tag");
    f.deleteOnExit();
    assertTrue("Expected filename does not exists " + f.getAbsolutePath(), f
        .exists());
View Full Code Here

    MemorySinkSource ackedmem = new MemorySinkSource();
    // simulate the stream coming from an e2e acking agent.
    AckChecksumInjector<EventSink> inj = new AckChecksumInjector<EventSink>(
        ackedmem);
    inj.open();
    inj.append(new EventImpl("foo 1".getBytes()));
    inj.close();

    inj = new AckChecksumInjector<EventSink>(ackedmem);
    inj.open();
    inj.append(new EventImpl("foo 2".getBytes()));
    inj.close();

    inj = new AckChecksumInjector<EventSink>(ackedmem);
    inj.open();
    inj.append(new EventImpl("foo 3".getBytes()));
    inj.close();
    return ackedmem;
  }
View Full Code Here

    final CountDownLatch done = new CountDownLatch(1);

    Thread t = new Thread("append thread") {
      public void run() {
        Event e = new EventImpl("foo".getBytes());
        try {
          snk.open();

          snk.append(e);
        } catch (IOException e1) {
View Full Code Here

    final CountDownLatch started = new CountDownLatch(1);
    final CountDownLatch done = new CountDownLatch(1);

    Thread t = new Thread("append thread") {
      public void run() {
        Event e = new EventImpl("foo".getBytes());
        try {
          snk.open();
          started.countDown();
          snk.append(e);
        } catch (IOException e1) {
View Full Code Here

    final CountDownLatch started = new CountDownLatch(1);
    final CountDownLatch done = new CountDownLatch(1);

    Thread t = new Thread("append thread") {
      public void run() {
        Event e = new EventImpl("foo".getBytes());
        try {
          snk.open();
          started.countDown();
          snk.append(e);
        } catch (IOException e1) {
View Full Code Here

      InterruptedException {
    String spec = "collector(5000) { [ counter(\"foo\"), counter(\"bar\") ] }";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), spec);
    snk.open();
    snk.append(new EventImpl("this is a test".getBytes()));
    snk.close();
    ReportEvent rpta = ReportManager.get().getReportable("foo").getMetrics();
    assertEquals(1, (long) rpta.getLongMetric("foo"));
    ReportEvent rptb = ReportManager.get().getReportable("bar").getMetrics();
    assertEquals(1, (long) rptb.getLongMetric("bar"));
View Full Code Here

            .getAgentAckQueuer(), 1000);

    // open and send data.
    wal.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("test message " + i).getBytes());
      wal.append(e);
      if (i % 5 == 4) {
        wal.rotate();
      }
    }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.core.EventImpl

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.