Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.ReportTestingContext


   * This verifies that the roller's trigger works multiple times, and at about
   * the right frequency.
   */
  @Test
  public void testMultiTimedRoll() throws IOException, InterruptedException {
    RollSink snk = new RollSink(new ReportTestingContext(), "counter(\"foo\")",
        200, 100);
    // 200 ms auto forced roll threshold.

    snk.open();
    Clock.sleep(100); // sleep until about 100 ms; no flush yet.
View Full Code Here


   * This verifies that the roller's trigger works multiple times, and at about
   * the right frequency.
   */
  @Test
  public void testMultiCountRoll() throws IOException, InterruptedException {
    RollSink snk = new RollSink(new ReportTestingContext(), "counter(\"foo\")",
        new SizeTrigger(10, new ProcessTagger()), 100);
    // every 10 body-bytes we should roll

    snk.open();

View Full Code Here

  @Test
  public void testGetRollMetrics() throws JSONException, FlumeSpecException,
      IOException, InterruptedException {
    ReportTestUtils.setupSinkFactory();

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "roll(100) { one } ");
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());
    assertNotNull(rpt.getLongMetric(RollSink.A_ROLLFAILS));
    assertNotNull(rpt.getLongMetric(RollSink.A_ROLLS));
View Full Code Here

    FileUtil.dumbfilecopy(acked, new File(writing,
        "writeahead.00000000.20100204-015814F430-0800.seq"));

    // EventSource src = FlumeBuilder.buildSource("");
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "{ ackedWriteAhead => { ackChecker => counter(\"count\") } }");
    EventSource src = MemorySinkSource.cannedData("foo foo foo ", 5);
    snk.open();
    src.open();
    EventUtil.dumpAll(src, snk);
View Full Code Here

    // /////////////////////
    // This illustrates the problems from the previous test.
    FileUtil.dumbfilecopy(acked, new File(writing, acked.getName()));
    // /////////////////////

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "{ ackedWriteAhead => { ackChecker => counter(\"count\") } }");
    EventSource src = MemorySinkSource.cannedData("foo foo foo ", 5);
    snk.open();
    src.open();
    EventUtil.dumpAll(src, snk);
View Full Code Here

        .getPhysicalNodeName()), "writing");

    writing.mkdirs();
    FileUtil.dumbfilecopy(truncated, new File(writing, truncated.getName()));

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "{ ackedWriteAhead => { ackChecker => counter(\"count\") } }");
    EventSource src = MemorySinkSource.cannedData("foo foo foo ", 5);
    snk.open();
    src.open();
    EventUtil.dumpAll(src, snk);
View Full Code Here

   * Tests to make sure the report sink receives data.
   */
  @Test
  public void testReportSink() throws FlumeSpecException, IOException {
    String spec = "{benchinject(\"foo\") => {benchreport(\"report\", \"[ console , counter(\\\"test\\\") ]\")  => null } }";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(), spec);
    snk.open();
    snk.append(new EventImpl(new byte[0]));
    snk.append(new EventImpl(new byte[0]));
    snk.close();

View Full Code Here

  /**
   * Tests the lazy open through another mechanism, and tests the builder
   */
  @Test
  public void testLazyOpenBuild() throws IOException, FlumeSpecException {
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "{ lazyOpen => counter(\"count\") } ");
    CounterSink cnt = (CounterSink) ReportManager.get().getReportable("count");

    boolean ok = false;
    Event e = new EventImpl("event".getBytes());
View Full Code Here

    final CountDownLatch start = new CountDownLatch(threads);
    final CountDownLatch done = new CountDownLatch(threads);
    final NaiveFileWALManager wal = new NaiveFileWALManager(dir);
    wal.open();

    Context ctx = new ReportTestingContext();
    EventSink cntsnk = new CompositeSink(ctx, "counter(\"total\")");
    // use the same wal, but different counter.
    final EventSink snk = new NaiveFileWALDeco<EventSink>(ctx, cntsnk, wal,
        new TimeTrigger(new ProcessTagger(), 1000000), new AckListener.Empty(),
        1000000);
View Full Code Here

        @Override
        public void run() {
          start.countDown();
          try {
            EventSource src = new NoNlASCIISynthSource(count, 100);
            Context ctx = new ReportTestingContext();
            EventSink snk = new CompositeSink(ctx, "counter(\"total." + idx
                + "\")");
            // use the same wal, but different counter.
            snk = new NaiveFileWALDeco<EventSink>(ctx, snk, wal,
                new TimeTrigger(new ProcessTagger(), 1000000),
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.ReportTestingContext

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.