Package com.cloudera.flume.handlers.thrift

Examples of com.cloudera.flume.handlers.thrift.ThriftEventSink


      }
    };
    drain.start(); // drain the sink.
    b.mark("receiver_started");

    final ThriftEventSink snk = new ThriftEventSink("0.0.0.0", conf
        .getCollectorPort());

    Thread t = new Thread() {
      public void run() {
        try {
          snk.open();
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
    };
    t.start();
    b.mark("sink_started");

    EventUtil.dumpAll(mem, snk);
    b.mark("thrift sink to thrift source done");

    Thread.sleep(1000);
    tes.close();
    snk.close();
    t.interrupt();
    drain.interrupt();
    b.done();
  }
View Full Code Here


      }
    };
    drain.start(); // drain the sink.
    b.mark("receiver_started");

    final ThriftEventSink snk = new ThriftEventSink("0.0.0.0", conf
        .getCollectorPort());
    snk.open();
    b.mark("sink_started");

    EventUtil.dumpAll(mem, snk);
    b.mark("thrift sink to thrift source done");

    tes.close();
    snk.close();
    drain.interrupt();
    b.done();
  }
View Full Code Here

    Benchmark b = new Benchmark();

    b.mark("init");
    FlumeConfiguration conf = FlumeConfiguration.get();
    ThriftEventSink tes = new ThriftEventSink(conf.getCollectorHost(), conf
        .getCollectorPort(), false);
    tes.open();

    MemorySinkSource mem = cmd.hasOption("m") ? new MemorySinkSource() : null;

    for (String f : argv) {
      EventSource src = null;
      if (cmd.hasOption("l")) {
        b.mark("log4jtext");
        src = new Log4jTextFileSource(f);
      } else if (cmd.hasOption("t")) {
        b.mark("random access text");
        src = new TextFileSource(f);
      } else {
        b.mark("buffered reader text");
        src = new TextReaderSource(f);
      }
      src.open();

      b.mark("fileread");
      if (mem != null) {

        EventUtil.dumpAll(src, mem);
      } else {
        EventUtil.dumpAll(src, tes);
      }
      src.close();
    }

    b.mark("memdump");
    if (mem != null) {
      EventUtil.dumpAll(mem, tes);
    }

    b.mark("done");

    b.done();
    tes.close();

  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.handlers.thrift.ThriftEventSink

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.