/** * Sets the order of the elements within a group for the second input. * * @param order The order for the elements in a group. */ public void setGroupOrderForInputTwo(Ordering order) { setGroupOrder(1, order); }
/** * Sets the order of the elements within a group for the first input. * * @param order The order for the elements in a group. */ public void setGroupOrderForInputOne(Ordering order) { setGroupOrder(0, order); }
/** * Sets the given input as the initial solution set. * * @param input The contract to set the initial solution set. */ public void setInitialSolutionSet(Operator<ST> input) { setFirstInput(input); }
/** * @param criterion */ public <X> void setTerminationCriterion(Operator<X> criterion) { TypeInformation<X> type = criterion.getOperatorInfo().getOutputType(); FlatMapOperatorBase<X, X, TerminationCriterionMapper<X>> mapper = new FlatMapOperatorBase<X, X, TerminationCriterionMapper<X>>( new TerminationCriterionMapper<X>(), new UnaryOperatorInformation<X, X>(type, type), "Termination Criterion Aggregation Wrapper"); mapper.setInput(criterion); this.terminationCriterion = mapper; this.getAggregators().registerAggregationConvergenceCriterion(TERMINATION_CRITERION_AGGREGATOR_NAME, new TerminationCriterionAggregator(), new TerminationCriterionAggregationConvergence()); }
/** * @param name */ public BulkIterationBase(UnaryOperatorInformation<T, T> operatorInfo, String name) { super(new UserCodeClassWrapper<AbstractRichFunction>(AbstractRichFunction.class), operatorInfo, name); inputPlaceHolder = new PartialSolutionPlaceHolder<T>(this, this.getOperatorInfo()); }
@Override public void flatMap(X in, Collector<X> out) { aggregator.aggregate(1L); } }
public CrossOperatorBase(UserCodeWrapper<FT> udf, BinaryOperatorInformation<IN1, IN2, OUT> operatorInfo, String name) { super(udf, operatorInfo, name); if (this instanceof CrossWithSmall) { setCrossHint(CrossHint.SECOND_IS_SMALL); } else if (this instanceof CrossWithLarge) { setCrossHint(CrossHint.FIRST_IS_SMALL); } }
@Test public void testFullOuterJoinWithPartialMatchingKeys() throws Exception { final List<String> leftInput = Arrays.asList("foo", "bar", "foobar"); final List<String> rightInput = Arrays.asList("bar", "foo", "barfoo"); baseOperator.setOuterJoinType(OuterJoinOperatorBase.OuterJoinType.FULL); List<String> expected = Arrays.asList("bar,bar", "null,barfoo", "foo,foo", "foobar,null"); testOuterJoin(leftInput, rightInput, expected); }
/** * Gets the order of elements within a group for the second input. * If no such order has been set, this method returns null. * * @return The group order for the second input. */ public Ordering getGroupOrderForInputTwo() { return getGroupOrder(1); }
/** * Gets the order of elements within a group for the first input. * If no such order has been set, this method returns null. * * @return The group order for the first input. */ public Ordering getGroupOrderForInputOne() { return getGroupOrder(0); }
/** * Returns the initial solution set input, or null, if none is set. * * @return The iteration's initial solution set input. */ public Operator<ST> getInitialSolutionSet() { return getFirstInput(); }
/** * Returns the initial workset input, or null, if none is set. * * @return The iteration's workset input. */ public Operator<WT> getInitialWorkset() { return getSecondInput(); }
/** * Sets the given input as the initial workset. * * @param input The contract to set as the initial workset. */ public void setInitialWorkset(Operator<WT> input) { setSecondInput(input); }
@Override public Iterator<IN> iterator() { return new SimpleListIterator<IN>(values, serializer); }
@Test public void testRightOuterJoin() throws Exception { final List<String> leftInput = Arrays.asList("foo", "foo", "foo", "bar","bar", "foobar", "foobar"); final List<String> rightInput = Arrays.asList("foo", "foo", "bar", "bar", "bar", "barfoo", "barfoo"); baseOperator.setOuterJoinType(OuterJoinOperatorBase.OuterJoinType.RIGHT); List<String> expected = Arrays.asList("bar,bar", "bar,bar", "bar,bar", "bar,bar", "bar,bar", "bar,bar", "null,barfoo", "null,barfoo", "foo,foo", "foo,foo", "foo,foo", "foo,foo", "foo,foo", "foo,foo"); testOuterJoin(leftInput, rightInput, expected); }
/** * Sets the order of the elements within a group for the first input. * * @param order The order for the elements in a group. */ public void setGroupOrderForInputOne(Ordering order) { setGroupOrder(0, order); }
/** * Sets the order of the elements within a group for the second input. * * @param order The order for the elements in a group. */ public void setGroupOrderForInputTwo(Ordering order) { setGroupOrder(1, order); }
/** * Gets the order of elements within a group for the first input. * If no such order has been set, this method returns null. * * @return The group order for the first input. */ public Ordering getGroupOrderForInputOne() { return getGroupOrder(0); }
/** * Gets the order of elements within a group for the second input. * If no such order has been set, this method returns null. * * @return The group order for the second input. */ public Ordering getGroupOrderForInputTwo() { return getGroupOrder(1); }
@Test public void testFullOuterJoinWithoutMatchingPartners() throws Exception { final List<String> leftInput = Arrays.asList("foo", "bar", "foobar"); final List<String> rightInput = Arrays.asList("oof", "rab", "raboof"); baseOperator.setOuterJoinType(OuterJoinOperatorBase.OuterJoinType.FULL); List<String> expected = Arrays.asList("bar,null", "foo,null", "foobar,null", "null,oof", "null,rab", "null,raboof"); testOuterJoin(leftInput, rightInput, expected); }