Package com.cloudera.flume.conf.SourceFactory

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


    return new Pair<String, DelimMode>(delimRegex, delimMode);

  }

  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{," + C_TRUNCATE + "=false})");
        int port = Integer.parseInt(argv[0]);
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

  public String toString() {
    return "SeqfileEventSource name=" + fname;
  }

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

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

  /**
   * Builder takes one optional argument: the port to start on
   */
  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length <= 1, "usage: scribe[(port={"
            + FlumeConfiguration.DEFAULT_SCRIBE_SOURCE_PORT + "})]");
        int port = FlumeConfiguration.get().getScribeSourcePort();
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: thriftSource(port{, " + C_TRUNCATE + "=false)");
View Full Code Here

      return e;
    }
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions
            .checkArgument(argv.length >= 1 && argv.length <= 4, USAGE);
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.