ST
- The data type of the solution set.WT
- The data type of the workset (the feedback data set).@Deprecated @Public public class DeltaIteration<ST,WT> extends Object
DataSet.iterateDelta(DataSet, int, int...)
method.限定符和类型 | 类和说明 |
---|---|
static class |
DeltaIteration.SolutionSetPlaceHolder<ST>
已过时。
A
DataSet that acts as a placeholder for the solution set during the iteration. |
static class |
DeltaIteration.WorksetPlaceHolder<WT>
已过时。
A
DataSet that acts as a placeholder for the workset during the iteration. |
构造器和说明 |
---|
DeltaIteration(ExecutionEnvironment context,
org.apache.flink.api.common.typeinfo.TypeInformation<ST> type,
DataSet<ST> solutionSet,
DataSet<WT> workset,
org.apache.flink.api.common.operators.Keys<ST> keys,
int maxIterations)
已过时。
|
限定符和类型 | 方法和说明 |
---|---|
DataSet<ST> |
closeWith(DataSet<ST> solutionSetDelta,
DataSet<WT> newWorkset)
已过时。
Closes the delta iteration.
|
org.apache.flink.api.common.aggregators.AggregatorRegistry |
getAggregators()
已过时。
Gets the registry for aggregators for the iteration.
|
DataSet<ST> |
getInitialSolutionSet()
已过时。
Gets the initial solution set.
|
DataSet<WT> |
getInitialWorkset()
已过时。
Gets the initial workset.
|
org.apache.flink.api.common.operators.ResourceSpec |
getMinResources()
已过时。
Gets the minimum resources from this iteration.
|
String |
getName()
已过时。
Gets the name from this iteration.
|
int |
getParallelism()
已过时。
Gets the iteration's parallelism.
|
org.apache.flink.api.common.operators.ResourceSpec |
getPreferredResources()
已过时。
Gets the preferred resources from this iteration.
|
DeltaIteration.SolutionSetPlaceHolder<ST> |
getSolutionSet()
已过时。
Gets the solution set of the delta iteration.
|
DeltaIteration.WorksetPlaceHolder<WT> |
getWorkset()
已过时。
Gets the working set of the delta iteration.
|
boolean |
isSolutionSetUnManaged()
已过时。
gets whether the solution set is in managed or unmanaged memory.
|
DeltaIteration<ST,WT> |
name(String name)
已过时。
Sets the name for the iteration.
|
DeltaIteration<ST,WT> |
parallelism(int parallelism)
已过时。
Sets the parallelism for the iteration.
|
<X extends org.apache.flink.types.Value> |
registerAggregationConvergenceCriterion(String name,
org.apache.flink.api.common.aggregators.Aggregator<X> aggregator,
org.apache.flink.api.common.aggregators.ConvergenceCriterion<X> convergenceCheck)
已过时。
Registers an
Aggregator for the iteration together with a ConvergenceCriterion . |
DeltaIteration<ST,WT> |
registerAggregator(String name,
org.apache.flink.api.common.aggregators.Aggregator<?> aggregator)
已过时。
Registers an
Aggregator for the iteration. |
void |
setSolutionSetUnManaged(boolean solutionSetUnManaged)
已过时。
Sets whether to keep the solution set in managed memory (safe against heap exhaustion) or
unmanaged memory (objects on heap).
|
public DataSet<ST> closeWith(DataSet<ST> solutionSetDelta, DataSet<WT> newWorkset)
solutionSetDelta
- The delta for the solution set. The delta will be merged into the
solution set at the end of each iteration.newWorkset
- The new workset (feedback data set) that will be fed back to the next
iteration.DataSet.iterateDelta(DataSet, int, int...)
public DataSet<ST> getInitialSolutionSet()
Consider the following example:
DataSet<MyType> solutionSetData = ...;
DataSet<AnotherType> worksetData = ...;
DeltaIteration<MyType, AnotherType> iteration = solutionSetData.iteratorDelta(worksetData, 10, ...);
The solutionSetData would be the data set returned by iteration.getInitialSolutionSet();
.
public DataSet<WT> getInitialWorkset()
Consider the following example:
DataSet<MyType> solutionSetData = ...;
DataSet<AnotherType> worksetData = ...;
DeltaIteration<MyType, AnotherType> iteration = solutionSetData.iteratorDelta(worksetData, 10, ...);
The worksetData would be the data set returned by iteration.getInitialWorkset();
.
public DeltaIteration.SolutionSetPlaceHolder<ST> getSolutionSet()
public DeltaIteration.WorksetPlaceHolder<WT> getWorkset()
public DeltaIteration<ST,WT> name(String name)
name
- The name for the iteration.public String getName()
public DeltaIteration<ST,WT> parallelism(int parallelism)
parallelism
- The parallelism.public int getParallelism()
ExecutionConfig.PARALLELISM_DEFAULT
if not
set.@PublicEvolving public org.apache.flink.api.common.operators.ResourceSpec getMinResources()
@PublicEvolving public org.apache.flink.api.common.operators.ResourceSpec getPreferredResources()
@PublicEvolving public DeltaIteration<ST,WT> registerAggregator(String name, org.apache.flink.api.common.aggregators.Aggregator<?> aggregator)
Aggregator
for 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.
name
- The name under which the aggregator is registered.aggregator
- The aggregator class.@PublicEvolving public <X extends org.apache.flink.types.Value> DeltaIteration<ST,WT> registerAggregationConvergenceCriterion(String name, org.apache.flink.api.common.aggregators.Aggregator<X> aggregator, org.apache.flink.api.common.aggregators.ConvergenceCriterion<X> convergenceCheck)
Aggregator
for the iteration together with a ConvergenceCriterion
. For a general description of aggregators, see registerAggregator(String, Aggregator)
and Aggregator
. At the end of each
iteration, the convergence criterion takes the aggregator's global aggregate value and
decides 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.name
- The name under which the aggregator is registered.aggregator
- The aggregator class.convergenceCheck
- The convergence criterion.@PublicEvolving public org.apache.flink.api.common.aggregators.AggregatorRegistry getAggregators()
public void setSolutionSetUnManaged(boolean solutionSetUnManaged)
solutionSetUnManaged
- True to keep the solution set in unmanaged memory, false to keep
it in managed memory.isSolutionSetUnManaged()
public boolean isSolutionSetUnManaged()
setSolutionSetUnManaged(boolean)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.