Package cascalog.test

Source Code of cascalog.test.RangeOp

package cascalog.test;

import cascading.flow.FlowProcess;
import cascading.operation.FunctionCall;
import cascading.tuple.Tuple;
import cascading.tuple.TupleEntry;
import cascalog.CascalogFunction;


public class RangeOp extends CascalogFunction {

  @Override
  public void operate(FlowProcess flowProcess, FunctionCall fnCall) {
    TupleEntry args = fnCall.getArguments();
    Number n = (Number) args.get(0);
    for (int i = 1; i <= n.intValue(); i++) {
      fnCall.getOutputCollector().add(new Tuple(i));
    }
  }

}
TOP

Related Classes of cascalog.test.RangeOp

TOP
Copyright © 2018 www.massapi.com. 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.