Package com.cloudera.flume.conf.SourceFactory

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


  /**
   * This class will build an AvroEventSource or ThriftEventSource depending on
   * the value of EVENT_RPC_TYPE set in the configuration file.
   */
  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length == 1, "usage: rpcSource(port)");

        int port = Integer.parseInt(argv[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

    this.in = new BufferedReader(new FileReader(fname));
    LOG.info("File " + fname + " opened");
  }

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

      @Override
      public EventSource build(Context ctx, String... argv) {
        if (argv.length != 1) {
          throw new IllegalArgumentException("usage: text(filename)");
View Full Code Here

    }
    rd = new BufferedReader(new InputStreamReader(System.in));
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        return new StdinSource();
      }
    };
View Full Code Here

    // This is unreachable.
    return null;
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        if (argv.length != 1) {
          throw new IllegalArgumentException("usage: log4jfile(filename) ");
        }
View Full Code Here

    thd = new TailThread();
    thd.start();
  }

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

      @Override
      public EventSource build(Context ctx, String... argv) {
        if (argv.length != 1 && argv.length != 2) {
          throw new IllegalArgumentException(
View Full Code Here

      }
    };
  }

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

      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length >= 1,
            "usage: multitail(file1[, file2[, ...]]) ");
View Full Code Here

          + e.getMessage(), e);
    }
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions
            .checkArgument(argv.length == 1, "usage: avroSource(port)");
        int port = Integer.parseInt(argv[0]);
View Full Code Here

  /**
   * This is a source that periodically gets the report from the ReportManager
   */
  public static SourceBuilder reporterPollBuilder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length >= 0 && argv.length <= 1,
            "reportPoller[(periodMs)]");

View Full Code Here

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

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        if (argv.length < 4 || argv.length > 5) {
          throw new IllegalArgumentException(
              "usage: attrsynth(count, attrs, attrSz, valSz[,rseed=curtime]) // count=0 infinite");
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.