/** * Creates a grouped reduce data flow operator. * * @param udf The class representing the parameterless user-defined function. * @param operatorInfo The type information, describing input and output types of the reduce function. * @param keyPositions The positions of the key fields, in the common data model (flattened). * @param name The name of the operator (for logging and messages). */ public ReduceOperatorBase(Class<? extends FT> udf, UnaryOperatorInformation<T, T> operatorInfo, int[] keyPositions, String name) { super(new UserCodeClassWrapper<FT>(udf), operatorInfo, keyPositions, name); }
@Test public void testFieldListAdds() { check(new FieldList().addField(1).addField(2), 1, 2); check(FieldList.EMPTY_LIST.addField(3).addField(2), 3, 2); check(new FieldList(13).addFields(new FieldList(17, 31, 42)), 13, 17, 31, 42); check(new FieldList(14).addFields(new FieldList(17)), 14, 17); check(new FieldList(3).addFields(2, 8, 5, 7), 3, 2, 8, 5, 7); }
/** * Creates a non-grouped reduce data flow operator (all-reduce). * * @param udf The user-defined function, as a function object. * @param operatorInfo The type information, describing input and output types of the reduce function. * @param name The name of the operator (for logging and messages). */ public ReduceOperatorBase(FT udf, UnaryOperatorInformation<T, T> operatorInfo, String name) { super(new UserCodeObjectWrapper<FT>(udf), operatorInfo, name); }
protected OperatorDescriptorSingle(FieldSet keys) { this.keys = keys; this.keyList = keys == null ? null : keys.toFieldList(); }
/** * Adds, to the existing information, field(s) that are read in * the source record(s). * * @param readFields the position(s) in the source record(s) */ public void addReadFields(FieldSet readFields) { if (this.readFields == null) { this.readFields = readFields; } else { this.readFields = this.readFields.addFields(readFields); } }
@Override public boolean isValidSubset(FieldSet set) { if (set instanceof FieldList) { return (isValidSubset((FieldList) set)); } else { return false; } }
/** * Creates a non-grouped reduce data flow operator (all-reduce). * * @param udf The class representing the parameterless user-defined function. * @param operatorInfo The type information, describing input and output types of the reduce function. * @param name The name of the operator (for logging and messages). */ public ReduceOperatorBase(Class<? extends FT> udf, UnaryOperatorInformation<T, T> operatorInfo, String name) { super(new UserCodeClassWrapper<FT>(udf), operatorInfo, name); }
public OuterJoinOperatorBase(FT udf, BinaryOperatorInformation<IN1, IN2, OUT> operatorInfo, int[] keyPositions1, int[] keyPositions2, String name, OuterJoinType outerJoinType) { super(new UserCodeObjectWrapper<FT>(udf), operatorInfo, keyPositions1, keyPositions2, name); this.outerJoinType = outerJoinType; }
public OuterJoinOperatorBase(Class<? extends FT> udf, BinaryOperatorInformation<IN1, IN2, OUT> operatorInfo, int[] keyPositions1, int[] keyPositions2, String name, OuterJoinType outerJoinType) { super(new UserCodeClassWrapper<FT>(udf), operatorInfo, keyPositions1, keyPositions2, name); this.outerJoinType = outerJoinType; }
/** * Creates a grouped reduce data flow operator. * * @param udf The user-defined function, as a function object. * @param operatorInfo The type information, describing input and output types of the reduce function. * @param keyPositions The positions of the key fields, in the common data model (flattened). * @param name The name of the operator (for logging and messages). */ public ReduceOperatorBase(FT udf, UnaryOperatorInformation<T, T> operatorInfo, int[] keyPositions, String name) { super(new UserCodeObjectWrapper<FT>(udf), operatorInfo, keyPositions, name); }
/** * Creates a new Union operator. */ public Union(BinaryOperatorInformation<T, T, T> operatorInfo, String unionLocationName) { // we pass it an AbstractFunction, because currently all operators expect some form of UDF super(new UserCodeClassWrapper<AbstractRichFunction>(AbstractRichFunction.class), operatorInfo, "Union at "+unionLocationName); }
public NoOpUnaryUdfOp() { // pass null here because we override getOutputType to return type // of input operator super(new UserCodeClassWrapper<NoOpFunction>(NoOpFunction.class), null, ""); }
public InnerJoinOperatorBase(Class<? extends FT> udf, BinaryOperatorInformation<IN1, IN2, OUT> operatorInfo, int[] keyPositions1, int[] keyPositions2, String name) { super(new UserCodeClassWrapper<FT>(udf), operatorInfo, keyPositions1, keyPositions2, name); }