Package com.cloudera.flume.conf.FlumeBuilder

Examples of com.cloudera.flume.conf.FlumeBuilder.FunctionSpec


    return trigger.getTagger().getTag();
  }

  public static RollTrigger createRollTrigger(Context ctx, long rollmillis) {
    RollTrigger rt = null;
    FunctionSpec fs = ctx.getObj(C_TRIGGER, FunctionSpec.class);
    if (fs == null) {
      rt = new TimeTrigger(new ProcessTagger(), rollmillis);
    } else {
      if ("time".equals(fs.getName())) {
        rt = new TimeTrigger(new ProcessTagger(), rollmillis);
      } else if ("size".equals(fs.getName())) {
        Tagger t = new ProcessTagger();
        Preconditions.checkArgument(fs.getArgs().length == 1,
            "size trigger requires argument");
        long sz = Long.parseLong(fs.getArgs()[0].toString());
        rt = new OrTrigger(t, new TimeTrigger(t, rollmillis), new SizeTrigger(
            sz, t));
      } else {
        throw new IllegalArgumentException("Illegal trigger type specified: "
            + fs.getName());
      }
    }
    return rt;
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.FlumeBuilder.FunctionSpec

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.