本文整理匯總了Java中org.apache.flink.api.common.operators.base.DeltaIterationBase.setNextWorkset方法的典型用法代碼示例。如果您正苦於以下問題:Java DeltaIterationBase.setNextWorkset方法的具體用法?Java DeltaIterationBase.setNextWorkset怎麽用?Java DeltaIterationBase.setNextWorkset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.flink.api.common.operators.base.DeltaIterationBase
的用法示例。
在下文中一共展示了DeltaIterationBase.setNextWorkset方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: translateDeltaIteration
import org.apache.flink.api.common.operators.base.DeltaIterationBase; //導入方法依賴的package包/類
private <D, W> DeltaIterationBase<D, W> translateDeltaIteration(DeltaIterationResultSet<?, ?> untypedIterationEnd) {
@SuppressWarnings("unchecked")
DeltaIterationResultSet<D, W> iterationEnd = (DeltaIterationResultSet<D, W>) untypedIterationEnd;
DeltaIteration<D, W> iterationHead = iterationEnd.getIterationHead();
String name = iterationHead.getName() == null ? "Unnamed Delta Iteration" : iterationHead.getName();
DeltaIterationBase<D, W> iterationOperator = new DeltaIterationBase<>(new BinaryOperatorInformation<>(iterationEnd.getType(), iterationEnd.getWorksetType(), iterationEnd.getType()),
iterationEnd.getKeyPositions(), name);
iterationOperator.setMaximumNumberOfIterations(iterationEnd.getMaxIterations());
if (iterationHead.getParallelism() > 0) {
iterationOperator.setParallelism(iterationHead.getParallelism());
}
DeltaIteration.SolutionSetPlaceHolder<D> solutionSetPlaceHolder = iterationHead.getSolutionSet();
DeltaIteration.WorksetPlaceHolder<W> worksetPlaceHolder = iterationHead.getWorkset();
translated.put(solutionSetPlaceHolder, iterationOperator.getSolutionSet());
translated.put(worksetPlaceHolder, iterationOperator.getWorkset());
Operator<D> translatedSolutionSet = translate(iterationEnd.getNextSolutionSet());
Operator<W> translatedWorkset = translate(iterationEnd.getNextWorkset());
iterationOperator.setNextWorkset(translatedWorkset);
iterationOperator.setSolutionSetDelta(translatedSolutionSet);
iterationOperator.setInitialSolutionSet(translate(iterationHead.getInitialSolutionSet()));
iterationOperator.setInitialWorkset(translate(iterationHead.getInitialWorkset()));
// register all aggregators
iterationOperator.getAggregators().addAll(iterationHead.getAggregators());
iterationOperator.setSolutionSetUnManaged(iterationHead.isSolutionSetUnManaged());
return iterationOperator;
}
示例2: translateDeltaIteration
import org.apache.flink.api.common.operators.base.DeltaIterationBase; //導入方法依賴的package包/類
private <D, W> DeltaIterationBase<D, W> translateDeltaIteration(DeltaIterationResultSet<?, ?> untypedIterationEnd) {
@SuppressWarnings("unchecked")
DeltaIterationResultSet<D, W> iterationEnd = (DeltaIterationResultSet<D, W>) untypedIterationEnd;
DeltaIteration<D, W> iterationHead = iterationEnd.getIterationHead();
String name = iterationHead.getName() == null ? "Unnamed Delta Iteration" : iterationHead.getName();
DeltaIterationBase<D, W> iterationOperator = new DeltaIterationBase<D, W>(new BinaryOperatorInformation<D, W, D>(iterationEnd.getType(), iterationEnd.getWorksetType(), iterationEnd.getType()),
iterationEnd.getKeyPositions(), name);
iterationOperator.setMaximumNumberOfIterations(iterationEnd.getMaxIterations());
if (iterationHead.getParallelism() > 0) {
iterationOperator.setDegreeOfParallelism(iterationHead.getParallelism());
}
DeltaIteration.SolutionSetPlaceHolder<D> solutionSetPlaceHolder = iterationHead.getSolutionSet();
DeltaIteration.WorksetPlaceHolder<W> worksetPlaceHolder = iterationHead.getWorkset();
translated.put(solutionSetPlaceHolder, iterationOperator.getSolutionSet());
translated.put(worksetPlaceHolder, iterationOperator.getWorkset());
Operator<D> translatedSolutionSet = translate(iterationEnd.getNextSolutionSet());
Operator<W> translatedWorkset = translate(iterationEnd.getNextWorkset());
iterationOperator.setNextWorkset(translatedWorkset);
iterationOperator.setSolutionSetDelta(translatedSolutionSet);
iterationOperator.setInitialSolutionSet(translate(iterationHead.getInitialSolutionSet()));
iterationOperator.setInitialWorkset(translate(iterationHead.getInitialWorkset()));
// register all aggregators
iterationOperator.getAggregators().addAll(iterationHead.getAggregators());
iterationOperator.setSolutionSetUnManaged(iterationHead.isSolutionSetUnManaged());
return iterationOperator;
}