Package com.cloudera.flume.conf.SourceFactory

Examples of com.cloudera.flume.conf.SourceFactory.SourceBuilder


    this.cur = 0;
    LOG.info("File " + fname + " opened");
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {

      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length == 1, "usage: text(filename)");
        return new TextFileSource(argv[0]);
View Full Code Here


    count = 0;
    rand.setSeed(seed);
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        int minSize = 0;
        int maxSize = 10;
        long total = 0;
View Full Code Here

    return e;
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        int size = 150;
        long count = 0;
        if (argv.length > 2) {
View Full Code Here

  public int getPort() {
    return port;
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        // accept 0 or 1 argument.
        Preconditions.checkArgument(argv.length <= 1,
            "usage: collectorSource[(port={"
View Full Code Here

   */
  @Test
  public void testFailOpenSource() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SourceFactoryImpl srcfact = new SourceFactoryImpl();
    srcfact.setSource("failOpen", new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        return new EventSource.Base() {
          @Override
          public void open() throws IOException {
View Full Code Here

  @Test
  public void testFailNextSource() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SourceFactoryImpl srcfact = new SourceFactoryImpl();
    srcfact.setSource("failNext", new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        return new EventSource.Base() {
          @Override
          public Event next() throws IOException {
View Full Code Here

  @Test
  public void testFailCloseSource() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SourceFactoryImpl srcfact = new SourceFactoryImpl();
    srcfact.setSource("failClose", new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        return new EventSource.Base() {
          @Override
          public void close() throws IOException {
View Full Code Here

   *
   * @throws InterruptedException
   */
  @Test
  public void testReportPoller() throws FlumeSpecException, IOException, InterruptedException {
    SourceBuilder bld = PollingSource.reporterPollBuilder();
    EventSource src = bld.build("50");
    EventSink snk =
        new CompositeSink(new ReportTestingContext(), "[ console , counter(\"count\") ]");
    src.open();
    snk.open();
    for (int i = 0; i < 10; i++) {
View Full Code Here

  @Override
  public void open() throws IOException {
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length == 0, "usage: null");
        return new NullSource();
      }
View Full Code Here

      throw new IOException(e);
    }
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length == 4,
            "usage: ircSource(server, port, nick, chan)");
        String server = argv[0];
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.SourceFactory.SourceBuilder

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.