Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.ReportTestingContext


   */
  @Test
  public void testBloomReportSink() throws FlumeSpecException, IOException,
      InterruptedException {
    String spec = "{bloomGen(100,2) => {bloomCheck(100,2,\"counter(\\\"test\\\") \")  => counter(\"total\") } } }";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(), spec);
    snk.open();
    snk.append(new EventImpl(new byte[0]));
    snk.append(new EventImpl(new byte[0]));

    CounterSink ctr = (CounterSink) ReportManager.get().getReportable("test");
View Full Code Here


      InterruptedException {
    final int repeat = 7;
    final int msgs = 10;

    String cfg = "{ mult(" + repeat + ") => counter(\"count\") }";
    EventSink s = FlumeBuilder.buildSink(new ReportTestingContext(), cfg);
    s.open();

    for (int i = 0; i < msgs; i++) {
      Event e = new EventImpl(("" + i).getBytes());
      s.append(e);
View Full Code Here

    final int repeat = 3;
    final int msgs = 4;

    String cfg = "{ benchinject => { mult(" + repeat
        + ") => [console, counter(\"count\")] }}";
    EventSink s = FlumeBuilder.buildSink(new ReportTestingContext(), cfg);
    s.open();

    for (int i = 0; i < msgs; i++) {
      Event e = new EventImpl(("" + i).getBytes());
      s.append(e);
View Full Code Here

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

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "insistentOpen one");
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());
    assertNotNull(rpt.getLongMetric(InsistentOpenDecorator.A_ATTEMPTS));
    assertNotNull(rpt.getLongMetric(InsistentOpenDecorator.A_GIVEUPS));
View Full Code Here

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

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "ackChecker one");
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());
    assertNotNull(rpt.getLongMetric(AckChecksumChecker.A_ACK_ENDS));
    assertNotNull(rpt.getLongMetric(AckChecksumChecker.A_ACK_FAILS));
View Full Code Here

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

    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "stubbornAppend one");
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());
    assertNotNull(rpt.getLongMetric(StubbornAppendSink.A_FAILS));
    assertNotNull(rpt.getLongMetric(StubbornAppendSink.A_RECOVERS));
View Full Code Here

    return agent;
  }

  LogicalNode setupColl(long port, String name, String acc) throws IOException,
      RuntimeException, FlumeSpecException {
    Context ctx = new LogicalNodeContext(new ReportTestingContext(), "phys",
        name);
    LogicalNode coll = new LogicalNode(ctx, name);
    FlumeConfigData fcd2 = new FlumeConfigData(0, "rpcSource(" + port + ")",
        "accumulator(\"" + acc + "\")", 1, 1, "flow");
    coll.loadConfig(fcd2);
View Full Code Here

    // in a real situation, there would be a agent sink after the
    // ackedWriteAhead and a collectorSource before the ackChecker block.
    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

  @Test
  public void testMultipleSinks() throws FlumeSpecException, IOException,
      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();
View Full Code Here

    int count = 10;
    String rpt = "foo";
    String snk = " { ackedWriteAhead(500) => { ackChecker => [console,  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());
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.