Package com.cloudera.flume.conf.SinkFactory

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


    return ReportEvent.createLegacyHtmlReport(name, report);
  }

  public static SinkBuilder builder() {
    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        Preconditions.checkArgument(argv.length <= 2,
            "usage: counterHistory(name[, period_ms])");
        String name = argv[0];
View Full Code Here


    rpt.setLongMetric(ReportEvent.A_COUNT, count);
    return rpt;
  }

  public static SinkBuilder builder() {
    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();
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

  public EventSink getSink() {
    return snk;
  }

  public static SinkBuilder builder() {
    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        Preconditions.checkArgument(argv.length <= 2 && argv.length >= 0,
            "usage: collector[(rollmillis)] { subsink }");
        String snkSpec = argv[0];
View Full Code Here

      }
    };
  }

  public static SinkBuilder hdfsBuilder() {
    return new SinkBuilder() {
      @Override
      public EventSink build(Context context, String... argv) {
        Preconditions.checkArgument(argv.length <= 3 && argv.length >= 2,
            "usage: collectorSink[(dfsdir,path[,rollmillis])]");
        String logdir = FlumeConfiguration.get().getCollectorDfsDir(); // default
View Full Code Here

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

   *
   * 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

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.