Package com.cloudera.flume.core

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


   * @throws InterruptedException
   */
  @Test
  public void testAvroSend() throws IOException, InterruptedException {
    EventSource txt = new NoNlASCIISynthSource(25, 100);
    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);
    txt.close();

View Full Code Here


      final int id = i;
      Thread th = new Thread() {
        public void run() {
          try {
            EventSource txt = new NoNlASCIISynthSource(25, 100);
            txt.open();
            MemorySinkSource mem = new MemorySinkSource();
            mem.open();
            EventUtil.dumpAll(txt, mem);
            txt.close();
View Full Code Here

    LOG.info(snk.getMetrics().toText());

    snk.open();
    EventSource src = MemorySinkSource.cannedData("test is a test", 31);
    src.open();
    EventUtil.dumpAll(src, snk);

    int[] ans = { 16, 8, 4, 2, 1 };
    for (int i = 0; i < ans.length; i++) {
      Reportable rptable = ReportManager.get().getReportable(names.get(i));
View Full Code Here

      Reportable rptable = ReportManager.get().getReportable(names.get(i));
      long val = rptable.getMetrics().getLongMetric(names.get(i));
      assertEquals(ans[i], val);
    }

    src.open();
    try {
      // here we finally have all failovers triggered to fail
      snk.append(src.next());
    } catch (IOException ioe) {
      // this should be thrown and caught.
View Full Code Here

    LOG.info(snk.getMetrics().toText());

    snk.open();
    EventSource src = MemorySinkSource.cannedData("test is a test", 31);
    src.open();
    EventUtil.dumpAll(src, snk);

    int[] ans = { 16, 8, 4, 2, 1 };
    for (int i = 0; i < ans.length; i++) {
      Reportable rptable = ReportManager.get().getReportable(names.get(i));
View Full Code Here

    workerThread = new Thread() {

      @Override
      public void run() {
        try {
          eventSource.open();
          eventSink.open();

          EventUtil.dumpN(10, eventSource, eventSink);
          Clock.sleep(500);
          eventSource.close();
View Full Code Here

    final int count = 60;
    Thread t = new Thread() {
      @Override
      public void run() {
        try {
          src.open();
          snk.open();
          EventUtil.dumpN(count, src, snk);
          src.close();
          snk.close();
          done.countDown();
View Full Code Here

      @Override
      public void run() {
        try {
          Event e;

          source.open();
          sink.open();

          e = null;

          do {
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();
View Full Code Here

  }

  public static MemorySinkSource synthInMem(int count, int bodySz, int seed)
      throws IOException, InterruptedException {
    EventSource txt = new NoNlASCIISynthSource(count, bodySz, seed);
    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);
    txt.close();
    return mem;
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.