/** * Closes the iteration. This method defines the end of the iterative * program part that will be fed back to the start of the iteration as * the second input in the {@link ConnectedStreams}. * * @param feedbackStream * {@link DataStream} that will be used as second input to * the iteration head. * @return The feedback stream. * */ public DataStream<F> closeWith(DataStream<F> feedbackStream) { Collection<StreamTransformation<?>> predecessors = feedbackStream.getTransformation().getTransitivePredecessors(); if (!predecessors.contains(this.coFeedbackTransformation)) { throw new UnsupportedOperationException( "Cannot close an iteration with a feedback DataStream that does not originate from said iteration."); } coFeedbackTransformation.addFeedbackEdge(feedbackStream.getTransformation()); return feedbackStream; }
/** * Closes the iteration. This method defines the end of the iterative * program part that will be fed back to the start of the iteration as * the second input in the {@link ConnectedStreams}. * * @param feedbackStream * {@link DataStream} that will be used as second input to * the iteration head. * @return The feedback stream. * */ public DataStream<F> closeWith(DataStream<F> feedbackStream) { Collection<StreamTransformation<?>> predecessors = feedbackStream.getTransformation().getTransitivePredecessors(); if (!predecessors.contains(this.coFeedbackTransformation)) { throw new UnsupportedOperationException( "Cannot close an iteration with a feedback DataStream that does not originate from said iteration."); } coFeedbackTransformation.addFeedbackEdge(feedbackStream.getTransformation()); return feedbackStream; }
/** * Closes the iteration. This method defines the end of the iterative * program part that will be fed back to the start of the iteration as * the second input in the {@link ConnectedStreams}. * * @param feedbackStream * {@link DataStream} that will be used as second input to * the iteration head. * @return The feedback stream. * */ public DataStream<F> closeWith(DataStream<F> feedbackStream) { Collection<StreamTransformation<?>> predecessors = feedbackStream.getTransformation().getTransitivePredecessors(); if (!predecessors.contains(this.coFeedbackTransformation)) { throw new UnsupportedOperationException( "Cannot close an iteration with a feedback DataStream that does not originate from said iteration."); } coFeedbackTransformation.addFeedbackEdge(feedbackStream.getTransformation()); return feedbackStream; }
/** * Closes the iteration. This method defines the end of the iterative * program part that will be fed back to the start of the iteration as * the second input in the {@link ConnectedStreams}. * * @param feedbackStream * {@link DataStream} that will be used as second input to * the iteration head. * @return The feedback stream. * */ public DataStream<F> closeWith(DataStream<F> feedbackStream) { Collection<StreamTransformation<?>> predecessors = feedbackStream.getTransformation().getTransitivePredecessors(); if (!predecessors.contains(this.coFeedbackTransformation)) { throw new UnsupportedOperationException( "Cannot close an iteration with a feedback DataStream that does not originate from said iteration."); } coFeedbackTransformation.addFeedbackEdge(feedbackStream.getTransformation()); return feedbackStream; }