Class IterativeDataSet<T>
- java.lang.Object
-
- org.apache.flink.api.java.DataSet<OUT>
-
- org.apache.flink.api.java.operators.Operator<OUT,O>
-
- org.apache.flink.api.java.operators.SingleInputOperator<T,T,IterativeDataSet<T>>
-
- org.apache.flink.api.java.operators.IterativeDataSet<T>
-
- Type Parameters:
T- The data type of set that is the input and feedback of the iteration.
@Deprecated @Public public class IterativeDataSet<T> extends SingleInputOperator<T,T,IterativeDataSet<T>>
Deprecated.All Flink DataSet APIs are deprecated since Flink 1.18 and will be removed in a future Flink major version. You can still build your application in DataSet, but you should move to either the DataStream and/or Table API.The IterativeDataSet represents the start of an iteration. It is created from the DataSet that represents the initial solution set via theDataSet.iterate(int)method.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.api.java.operators.Operator
minResources, name, parallelism, preferredResources
-
-
Constructor Summary
Constructors Constructor Description IterativeDataSet(ExecutionEnvironment context, org.apache.flink.api.common.typeinfo.TypeInformation<T> type, DataSet<T> input, int maxIterations)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DataSet<T>closeWith(DataSet<T> iterationResult)Deprecated.Closes the iteration.DataSet<T>closeWith(DataSet<T> iterationResult, DataSet<?> terminationCriterion)Deprecated.Closes the iteration and specifies a termination criterion.org.apache.flink.api.common.aggregators.AggregatorRegistrygetAggregators()Deprecated.Gets the registry for aggregators.intgetMaxIterations()Deprecated.Gets the maximum number of iterations.<X extends org.apache.flink.types.Value>
IterativeDataSet<T>registerAggregationConvergenceCriterion(String name, org.apache.flink.api.common.aggregators.Aggregator<X> aggregator, org.apache.flink.api.common.aggregators.ConvergenceCriterion<X> convergenceCheck)Deprecated.Registers anAggregatorfor the iteration together with aConvergenceCriterion.IterativeDataSet<T>registerAggregator(String name, org.apache.flink.api.common.aggregators.Aggregator<?> aggregator)Deprecated.Registers anAggregatorfor the iteration.protected org.apache.flink.api.common.operators.SingleInputOperator<T,T,?>translateToDataFlow(org.apache.flink.api.common.operators.Operator<T> input)Deprecated.Translates this operation to a data flow operator of the common data flow API.-
Methods inherited from class org.apache.flink.api.java.operators.SingleInputOperator
getInput, getInputType
-
Methods inherited from class org.apache.flink.api.java.operators.Operator
getMinResources, getName, getParallelism, getPreferredResources, getResultType, name, setParallelism
-
Methods inherited from class org.apache.flink.api.java.DataSet
aggregate, checkSameExecutionContext, clean, coGroup, collect, combineGroup, count, cross, crossWithHuge, crossWithTiny, distinct, distinct, distinct, distinct, fillInType, filter, first, flatMap, fullOuterJoin, fullOuterJoin, getExecutionEnvironment, getType, groupBy, groupBy, groupBy, iterate, iterateDelta, join, join, joinWithHuge, joinWithTiny, leftOuterJoin, leftOuterJoin, map, mapPartition, max, maxBy, min, minBy, output, partitionByHash, partitionByHash, partitionByHash, partitionByRange, partitionByRange, partitionByRange, partitionCustom, partitionCustom, partitionCustom, print, print, printOnTaskManager, printToErr, printToErr, project, rebalance, reduce, reduceGroup, rightOuterJoin, rightOuterJoin, runOperation, sortPartition, sortPartition, sortPartition, sum, union, write, write, writeAsCsv, writeAsCsv, writeAsCsv, writeAsCsv, writeAsFormattedText, writeAsFormattedText, writeAsText, writeAsText
-
-
-
-
Constructor Detail
-
IterativeDataSet
public IterativeDataSet(ExecutionEnvironment context, org.apache.flink.api.common.typeinfo.TypeInformation<T> type, DataSet<T> input, int maxIterations)
Deprecated.
-
-
Method Detail
-
closeWith
public DataSet<T> closeWith(DataSet<T> iterationResult)
Deprecated.Closes the iteration. This method defines the end of the iterative program part.- Parameters:
iterationResult- The data set that will be fed back to the next iteration.- Returns:
- The DataSet that represents the result of the iteration, after the computation has terminated.
- See Also:
DataSet.iterate(int)
-
closeWith
public DataSet<T> closeWith(DataSet<T> iterationResult, DataSet<?> terminationCriterion)
Deprecated.Closes the iteration and specifies a termination criterion. This method defines the end of the iterative program part.The termination criterion is a means of dynamically signaling the iteration to halt. It is expressed via a data set that will trigger to halt the loop as soon as the data set is empty. A typical way of using the termination criterion is to have a filter that filters out all elements that are considered non-converged. As soon as no more such elements exist, the iteration finishes.
- Parameters:
iterationResult- The data set that will be fed back to the next iteration.terminationCriterion- The data set that being used to trigger halt on operation once it is empty.- Returns:
- The DataSet that represents the result of the iteration, after the computation has terminated.
- See Also:
DataSet.iterate(int)
-
getMaxIterations
public int getMaxIterations()
Deprecated.Gets the maximum number of iterations.- Returns:
- The maximum number of iterations.
-
registerAggregator
@PublicEvolving public IterativeDataSet<T> registerAggregator(String name, org.apache.flink.api.common.aggregators.Aggregator<?> aggregator)
Deprecated.Registers anAggregatorfor the iteration. Aggregators can be used to maintain simple statistics during the iteration, such as number of elements processed. The aggregators compute global aggregates: After each iteration step, the values are globally aggregated to produce one aggregate that represents statistics across all parallel instances. The value of an aggregator can be accessed in the next iteration.Aggregators can be accessed inside a function via the
AbstractRichFunction.getIterationRuntimeContext()method.- Parameters:
name- The name under which the aggregator is registered.aggregator- The aggregator class.- Returns:
- The IterativeDataSet itself, to allow chaining function calls.
-
registerAggregationConvergenceCriterion
@PublicEvolving public <X extends org.apache.flink.types.Value> IterativeDataSet<T> registerAggregationConvergenceCriterion(String name, org.apache.flink.api.common.aggregators.Aggregator<X> aggregator, org.apache.flink.api.common.aggregators.ConvergenceCriterion<X> convergenceCheck)
Deprecated.Registers anAggregatorfor the iteration together with aConvergenceCriterion. For a general description of aggregators, seeregisterAggregator(String, Aggregator)andAggregator. At the end of each iteration, the convergence criterion takes the aggregator's global aggregate value and decided whether the iteration should terminate. A typical use case is to have an aggregator that sums up the total error of change in an iteration step and have to have a convergence criterion that signals termination as soon as the aggregate value is below a certain threshold.- Parameters:
name- The name under which the aggregator is registered.aggregator- The aggregator class.convergenceCheck- The convergence criterion.- Returns:
- The IterativeDataSet itself, to allow chaining function calls.
-
getAggregators
@PublicEvolving public org.apache.flink.api.common.aggregators.AggregatorRegistry getAggregators()
Deprecated.Gets the registry for aggregators. On the registry, one can addAggregators and an aggregator-basedConvergenceCriterion. This method offers an alternative way to registering the aggregators viaregisterAggregator(String, Aggregator)andregisterAggregationConvergenceCriterion(String, Aggregator, ConvergenceCriterion).- Returns:
- The registry for aggregators.
-
translateToDataFlow
protected org.apache.flink.api.common.operators.SingleInputOperator<T,T,?> translateToDataFlow(org.apache.flink.api.common.operators.Operator<T> input)
Deprecated.Description copied from class:SingleInputOperatorTranslates this operation to a data flow operator of the common data flow API.- Specified by:
translateToDataFlowin classSingleInputOperator<T,T,IterativeDataSet<T>>- Parameters:
input- The data flow operator that produces this operation's input data.- Returns:
- The translated data flow operator.
-
-