Package com.cloudera.flume.conf.SinkFactory

Examples of com.cloudera.flume.conf.SinkFactory.SinkBuilder


   *
   * TODO(jon) Need to reimplement/check this to make sure it still works in
   * light of the changes to disk log management mechanisms.
   */
  public static SinkBuilder dfoBuilder() {
    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        Preconditions
            .checkArgument(argv.length >= 1,
                "usage: agentDFOChain(\"machine1[:port]\" [, \"machine2[:port]\" [,...]])");
View Full Code Here


   * The first argument is required, but all failovers are optional.
   *
   * agentBEChain("machine1[:port]" [, "machine2[:port]" [,...]])
   */
  public static SinkBuilder beBuilder() {
    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        Preconditions
            .checkArgument(argv.length >= 1,
                "usage: agentBEChain(\"machine1[:port]\" [, \"machine2[:port]\" [,...]])");
View Full Code Here

        this.argv = argv;
      }
    }

    SinkFactoryImpl sf = new SinkFactoryImpl();
    sf.setSink("context", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new ContextSink(context, argv);
      }
    });
View Full Code Here

  public String getTag() {
    return tag;
  }

  public static SinkBuilder builder() {
    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... args) {
        Preconditions.checkArgument(args.length == 1,
            "usage: seqfile(filename)");
        try {
View Full Code Here

  @Test
  public void testFailOpenSink() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SinkFactoryImpl snkfact = new SinkFactoryImpl();
    snkfact.setSink("failOpen", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
          public void open() throws IOException {
View Full Code Here

  @Test
  public void testFailAppendSink() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SinkFactoryImpl snkfact = new SinkFactoryImpl();
    snkfact.setSink("failAppend", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
          public void append(Event e) throws IOException {
View Full Code Here

  @Test
  public void testFailCloseSink() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SinkFactoryImpl snkfact = new SinkFactoryImpl();
    snkfact.setSink("failClose", new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        return new EventSink.Base() {
          @Override
          public void open() throws IOException {
View Full Code Here

    }
    return codec;
  }

  public static SinkBuilder builder() {
    return new SinkBuilder() {
      @Override
      public EventSink create(Context context, Object... args) {
        if (args.length != 2 && args.length != 1) {
          // TODO (jon) make this message easier.
          throw new IllegalArgumentException(
View Full Code Here

    rpt.setLongMetric(A_SENTBYTES, transport.getSentBytes());
    return rpt;
  }

  public static SinkBuilder builder() {
    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... args) {
        if (args.length > 2) {
          throw new IllegalArgumentException(
              "usage: avroSink([hostname, [portno]]) ");
View Full Code Here

      writer = openWriter(absolutePath);
    }
  }

  public static SinkBuilder builder() {
    return new SinkBuilder() {
      @Override
      public EventSink create(Context context, Object... args) {
        Preconditions.checkArgument(args.length >= 1 && args.length <= 3,
            "usage: escapedCustomDfs(\"[(hdfs|file|s3n|...)://namenode[:port]]/path\""
                + "[, file [,outputformat ]])");
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.SinkFactory.SinkBuilder

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.