Package com.cloudera.flume.handlers.text.output

Examples of com.cloudera.flume.handlers.text.output.OutputFormat


    return new OutputFormatBuilder() {
      @Override
      public OutputFormat build(String... args) {
        Preconditions.checkArgument(args.length == 0, "usage: avro");

        OutputFormat format = new AvroNativeFileOutputFormat();
        format.setBuilder(this);

        return format;
      }

      @Override
View Full Code Here


      @Override
      public OutputFormat build(String... args) {
        Preconditions.checkArgument(args.length == 0, "usage: avrodata");

        OutputFormat format = new AvroDataFileOutputFormat();
        format.setBuilder(this);

        return format;
      }

      @Override
View Full Code Here

        int year = Calendar.getInstance().get(Calendar.YEAR);
        if (args.length >= 1) {
          year = Integer.parseInt(args[0]);
        }

        OutputFormat format = new SyslogEntryFormat(year);
        format.setBuilder(this);

        return format;
      }

      @Override
View Full Code Here

      @Override
      public EventSink build(Context context, String... argv) {
        Preconditions.checkArgument(argv.length <= 1,
            "usage: console[(format)]");
        OutputFormat fmt = DebugOutputFormat.builder().build();
        if (argv.length >= 1) {
          // TODO (jon) handle formats with arguments. Requires language update.
          try {
            fmt = FormatFactory.get().getOutputFormat(argv[0]);
          } catch (FlumeSpecException e) {
View Full Code Here

          throw new IllegalArgumentException(
              "usage: customdfs(\"[(hdfs|file|s3n|...)://namenode[:port]]/path\", \"format\")");
        }

        String format = (args.length == 1) ? null : args[1];
        OutputFormat fmt;
        try {
          fmt = FormatFactory.get().getOutputFormat(format);
        } catch (FlumeSpecException e) {
          LOG.error("failed to load format " + format, e);
          throw new IllegalArgumentException("failed to load format " + format);
View Full Code Here

        String format = FlumeConfiguration.get().getDefaultOutputFormat();
        if (args.length >= 3) {
          format = args[2];
        }

        OutputFormat o;
        try {
          o = FormatFactory.get().getOutputFormat(format);
        } catch (FlumeSpecException e) {
          LOG.warn("Illegal format type " + format + ".", e);
          o = null;
View Full Code Here

      @Override
      public OutputFormat build(String... args) {
        Preconditions.checkArgument(args.length == 0, "usage: avrojson");

        OutputFormat format = new AvroJsonOutputFormat();
        format.setBuilder(this);

        return format;
      }

      @Override
View Full Code Here

    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... args) {
        Preconditions.checkArgument(args.length >= 1 && args.length <= 2,
            "usage: text(filename[,format])");
        OutputFormat fmt = DebugOutputFormat.builder().build();
        String val = null;
        if (args.length >= 2) {
          val = args[1];
        } else {
          val = context.getValue("format");
View Full Code Here

        String hivetable = args[1];
        if (args.length >= 3) {
          format = args[2];
        }

        OutputFormat o;
        try {
          o = FormatFactory.get().getOutputFormat(format);
        } catch (FlumeSpecException e) {
          LOG.warn("Illegal format type " + format + ".", e);
          o = null;
View Full Code Here

    // setup sink.
    File f = FileUtil.createTempFile("avrodata", ".avro");
    f.deleteOnExit();
    FileOutputStream fos = new FileOutputStream(f);
    LOG.info("filename before escaping: " + f.getAbsolutePath());
    OutputFormat out = FormatFactory.get().getOutputFormat("avrodata", args);
    mem.open();
    Event e = mem.next();
    while (e != null) {
      out.format(fos, e);
      e = mem.next();
    }

    mem.open();
    DatumReader<EventImpl> dtm = new ReflectDatumReader<EventImpl>(
View Full Code Here

TOP

Related Classes of com.cloudera.flume.handlers.text.output.OutputFormat

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.