Package com.cloudera.flume.core.connector

Examples of com.cloudera.flume.core.connector.DirectDriver.stop()


    Clock.sleep(1000);

    assertEquals(1000, cnt.getCount());

    drv.stop();
    FileUtil.rmr(tmpdir);
  }

  @Test
  public void testExistingFiles() throws IOException, InterruptedException {
View Full Code Here


    drv.start();
    Clock.sleep(1000);
    assertEquals(1000, cnt.getCount());

    drv.stop();
    FileUtil.rmr(tmpdir);
  }

  /**
   * Same as existing files test but has a directory included (that should be
View Full Code Here

    drv.start();
    Clock.sleep(1000);
    assertEquals(1000, cnt.getCount());

    drv.stop();
    FileUtil.rmr(tmpdir);

    // only did 10 files, ignored the dir.
    assertEquals(Long.valueOf(10),
        src.getMetrics().getLongMetric(TailDirSource.A_FILESADDED));
View Full Code Here

    // more files show up
    genFiles(tmpdir, "foo", 10, 100);
    Clock.sleep(1000);
    assertEquals(2000, cnt.getCount());

    drv.stop();
    FileUtil.rmr(tmpdir);

  }

  @Test
View Full Code Here

    FileUtil.rmr(tmpdir);

    Clock.sleep(1000);
    assertEquals(1000, cnt.getCount());

    drv.stop();
    FileUtil.rmr(tmpdir);
  }

  /**
   * This is a tailDir source that starts from the end of files.
View Full Code Here

    genFiles(tmpdir, "bar", 10, 100);

    Clock.sleep(1000);
    assertEquals(10 * 10 + 1000, cnt.getCount());

    drv.stop();
    FileUtil.rmr(tmpdir);

    // in total 20 files were added
    assertEquals(Long.valueOf(20),
        src.getMetrics().getLongMetric(TailDirSource.A_FILESADDED));
View Full Code Here

    genFiles(subDirL2, "2tail-new2", 10, 100);
    Clock.sleep(1000);
    expEventsCount += 10 * 100;
    assertEquals(expEventsCount, cnt.getCount());

    drv.stop();
    FileUtil.rmr(tmpdir);

    ReportEvent report = src.getMetrics();
    assertEquals(Long.valueOf(80),
        report.getLongMetric(TailDirSource.A_FILESADDED));
View Full Code Here

    assertEquals(rpt.getLongMetric(TailDirSource.A_FILESADDED),
        rpt.getLongMetric(TailDirSource.A_FILESDELETED));
    assertEquals(Long.valueOf(0),
        rpt.getLongMetric(TailDirSource.A_FILESPRESENT));

    drv.stop();
    FileUtil.rmr(tmpdir);
  }
}
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.