Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.ReportTestingContext


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

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


   * Test insistent append metrics
   */
  @Test
  public void testTextFileMetrics() throws JSONException, FlumeSpecException,
      IOException, InterruptedException {
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "text(\"filename\")");
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());
    assertNotNull(rpt.getLongMetric(ReportEvent.A_COUNT));
  }
View Full Code Here

   * @throws InterruptedException
   */
  @Test
  public void testReportSink() throws FlumeSpecException, IOException, InterruptedException {
    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

   * Test insistent append metrics
   */
  @Test
  public void testThriftMetrics() throws JSONException, FlumeSpecException,
      IOException, InterruptedException {
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        "thriftSink");
    ReportEvent rpt = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(rpt).toString());
    assertNotNull(rpt.getLongMetric(ThriftEventSink.A_SENTBYTES));
    assertNotNull(rpt.getStringMetric(ThriftEventSink.A_SERVERHOST));
View Full Code Here

   */
  synchronized public void testingSpawn(String name, String src, String snk)
      throws IOException, FlumeSpecException {
    LogicalNode nd = threads.get(name);
    if (nd == null) {
      Context ctx = new ReportTestingContext(new LogicalNodeContext(
          physicalNode, name));

      LOG.info("creating new logical node " + name);
      nd = new LogicalNode(ctx, name);
      threads.put(nd.getName(), nd);
View Full Code Here

      InterruptedException {
    BenchmarkHarness.setupLocalWriteDir();
    // String spec =
    // "{ benchinject => { benchreport(\"pre\") =>  { diskFailover => [console, counter(\"beforecount\")] } } }";
    String spec = "{ benchinject => { benchreport(\"pre\") =>  { diskFailover => counter(\"beforecount\") } } }";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), spec);

    EventSource src = MemorySinkSource.cannedData("test ", 5);
    snk.open();
    src.open();
View Full Code Here

  @Test
  public void benchmarkAfterFailover() throws FlumeSpecException, IOException,
      InterruptedException {
    BenchmarkHarness.setupLocalWriteDir();
    String spec = "{ benchinject => { diskFailover => { benchreport(\"post\") =>  counter(\"beforecount\") } } }";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), spec);

    EventSource src = MemorySinkSource.cannedData("test ", 5);
    snk.open();
    src.open();
View Full Code Here

  @Test
  public void benchmarkBeforeWriteahead() throws FlumeSpecException,
      IOException, InterruptedException {
    BenchmarkHarness.setupLocalWriteDir();
    String spec = "{ benchinject => { benchreport(\"pre\") =>  { diskFailover => counter(\"beforecount\") } } }";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), spec);

    EventSource src = MemorySinkSource.cannedData("test ", 5);
    snk.open();
    src.open();
View Full Code Here

  public void benchmarkAfterWriteahead() throws FlumeSpecException,
      IOException, InterruptedException {
    BenchmarkHarness.setupLocalWriteDir();

    String spec = "{ benchinject => { ackedWriteAhead => { benchreport(\"post\") =>  counter(\"beforecount\") } } }";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(
        LogicalNodeContext.testingContext()), spec);

    EventSource src = MemorySinkSource.cannedData("test ", 5);
    snk.open();
    src.open();
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void testBloomDecos() throws FlumeSpecException, IOException,
      InterruptedException {
    String spec = "{ bloomGen(10000,2) => { bloomCheck(10000,2) => counter(\"test\")} } ";
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(), spec);
    EventSource src = FlumeBuilder.buildSource(LogicalNodeContext
        .testingContext(), "asciisynth(10000)");
    snk.open();
    src.open();
    EventUtil.dumpAll(src, snk);
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.