當前位置: 首頁>>代碼示例>>Java>>正文


Java DeltaIterationBase.setNextWorkset方法代碼示例

本文整理匯總了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;
}
 
開發者ID:axbaretto,項目名稱:flink,代碼行數:39,代碼來源:OperatorTranslation.java

示例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;
}
 
開發者ID:citlab,項目名稱:vs.msc.ws14,代碼行數:39,代碼來源:OperatorTranslation.java


注:本文中的org.apache.flink.api.common.operators.base.DeltaIterationBase.setNextWorkset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。