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(String... argv) {
        Preconditions.checkArgument(argv.length == 1, "usage: text(filename)");
        return new TextFileSource(argv[0]);
View Full Code Here


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

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

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

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(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(String... argv) {
        int size = 150;
        long count = 0;
        if (argv.length > 2) {
View Full Code Here

      return e;
    }
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(String... argv) throws IllegalArgumentException {
        if (argv.length == 2) {
        Preconditions.checkArgument(argv.length >= 1 && argv.length <= 2,
          "usage: tailDir(dir, regex, lastModifiedTime) ");
View Full Code Here

  public void open() throws IOException {
    sock = new DatagramSocket(port);
  }

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

      @Override
      public EventSource build(String... argv) {
        int port = SYSLOG_UDP_PORT; // default udp port, need root permissions
        // for this.
View Full Code Here

   * the entire output as the body of a event. It takes two arguments - the
   * command to run, and a time period to sleep in millis before executing
   * again.
   */
  public static SourceBuilder buildPeriodic() {
    return new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        Preconditions.checkArgument(argv.length == 2,
            "execPeriodic(\"cmdline \",period)");
        String command = argv[0];
View Full Code Here

   * each line of input as the body of an event. It takes one arguemnt, the
   * command to run. If the command exits, the exec source returns null signally
   * end of records.
   */
  public static SourceBuilder buildStream() {
    return new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        Preconditions.checkArgument(argv.length == 1,
            "execStream(\"cmdline \")");
        String command = argv[0];
View Full Code Here

    Socket client = sock.accept();
    is = new DataInputStream(client.getInputStream());
  }

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

      @Override
      public EventSource build(String... argv) {
        int port = SYSLOG_TCP_PORT; // default udp port, need root permissions
        // for this.
View Full Code Here

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

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

      @Override
      public EventSource build(String... argv) {
        if (argv.length != 1 && argv.length != 2) {
          throw new IllegalArgumentException(
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.