Package com.cloudera.flume.core

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


    String path = "file://" + f + "/%Y-%m-%d/";
    EventSink snk = new HiveNotifyingDfsSink(path, "file-%{host}", "hivetable",
        new AvroJsonOutputFormat(), hfrh);

    snk.open();
    long day_millis = 1000 * 60 * 60 * 24;
    Event e1 = new EventImpl(new byte[0], Clock.unixTime(), Priority.INFO, 0,
        "localhost");
    Event e2 = new EventImpl(new byte[0], e1.getTimestamp() + day_millis,
        Priority.INFO, 0, "localhost");
View Full Code Here


    String path = "file://" + f + "/%Y-%m-%d/";
    EventSink snk = new HiveNotifyingDfsSink(path, "file-%{host}", "hivetable",
        new AvroJsonOutputFormat(), hfrh);

    snk.open();
    snk.append(e1);
    snk.append(e2);
    snk.append(e3);
    snk.close();
View Full Code Here

    // TODO (jon) fix this sink's open close has a problem. here just
    // instantiating a new one
    snk = new HiveNotifyingDfsSink(path, "file-%{host}", "hivetable",
        new AvroJsonOutputFormat(), hfrh);
    snk.open();
    snk.append(e1);
    snk.append(e2);
    snk.append(e3);
    snk.close();
View Full Code Here

    String custom = "text(\""
        + StringEscapeUtils.escapeJava(f.getAbsolutePath())
        + "\", \"avrodata\")";
    LOG.info("sink to parse: " + custom);
    EventSink snk = FlumeBuilder.buildSink(new Context(), custom);
    snk.open();
    mem.open();
    EventUtil.dumpAll(mem, snk);
    snk.close();

    mem.open();
View Full Code Here

      // copy all events into memory
      EventSource src = MemorySinkSource.bufferize(ent.getValue());
      EventSink snk = createDecoratorBenchmarkSink(ent.getKey() + "," + deco,
          deco);
      src.open();
      snk.open();
      EventUtil.dumpAll(src, snk);
      src.close();
      snk.close();
      dumpReports();
      cleanupLocalWriteDir();
View Full Code Here

      InterruptedException {
    String src2 = "collectorSink(\"file:///tmp/test\",\"testfilename\")";

    for (int i = 0; i < 100; i++) {
      EventSink snk = FlumeBuilder.buildSink(new Context(), src2);
      snk.open();
      snk.close();
    }
  }

  /**
 
View Full Code Here

    EventSource ackedmem = setupAckRoll();
    Pair<RollSink, EventSink> p = setupSink(node, tmpdir);
    EventSink snk = p.getRight();
    RollSink roll = p.getLeft();
    snk.open();

    String tag1 = roll.getCurrentTag();
    LOG.info(tag1);
    snk.append(ackedmem.next()); // ack beg
    snk.append(ackedmem.next()); // data
View Full Code Here

    String snk = " { ackedWriteAhead(100) => [console,  counter(\"" + rpt
        + "\") ] } ";
    for (int i = 0; i < 100; i++) {
      EventSink es = FlumeBuilder.buildSink(
          LogicalNodeContext.testingContext(), snk);
      es.open();
      es.close();
    }

  }
View Full Code Here

    EventSource ackedmem = setupAckRoll();
    Pair<RollSink, EventSink> p = setupSink(node, tmpdir);
    EventSink snk = p.getRight();
    RollSink roll = p.getLeft();
    snk.open();

    String tag1 = roll.getCurrentTag();
    LOG.info(tag1);
    snk.append(ackedmem.next()); // ack beg
    snk.append(ackedmem.next()); // data
View Full Code Here

    String snk = " { ackedWriteAhead(1000) => { ackChecker => counter(\"" + rpt
        + "\") } }  ";

    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());
      es.append(e);
    }
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.