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


Java TaskConfig.setIterationHeadIndexOfSyncOutput方法代碼示例

本文整理匯總了Java中org.apache.flink.runtime.operators.util.TaskConfig.setIterationHeadIndexOfSyncOutput方法的典型用法代碼示例。如果您正苦於以下問題:Java TaskConfig.setIterationHeadIndexOfSyncOutput方法的具體用法?Java TaskConfig.setIterationHeadIndexOfSyncOutput怎麽用?Java TaskConfig.setIterationHeadIndexOfSyncOutput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.flink.runtime.operators.util.TaskConfig的用法示例。


在下文中一共展示了TaskConfig.setIterationHeadIndexOfSyncOutput方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createIterationHead

import org.apache.flink.runtime.operators.util.TaskConfig; //導入方法依賴的package包/類
private static AbstractJobVertex createIterationHead(JobGraph jobGraph, int numSubTasks, TypeSerializerFactory<?> serializer) {
	AbstractJobVertex head = JobGraphUtils.createTask(IterationHeadPactTask.class, "Iteration Head", jobGraph, numSubTasks);

	TaskConfig headConfig = new TaskConfig(head.getConfiguration());
	headConfig.setIterationId(ITERATION_ID);
	
	// initial input / partial solution
	headConfig.addInputToGroup(0);
	headConfig.setIterationHeadPartialSolutionOrWorksetInputIndex(0);
	headConfig.setInputSerializer(serializer, 0);
	
	// back channel / iterations
	headConfig.setRelativeBackChannelMemory(MEMORY_FRACTION_PER_CONSUMER);
	
	// output into iteration. broadcasting the centers
	headConfig.setOutputSerializer(serializer);
	headConfig.addOutputShipStrategy(ShipStrategyType.BROADCAST);
	
	// final output
	TaskConfig headFinalOutConfig = new TaskConfig(new Configuration());
	headFinalOutConfig.setOutputSerializer(serializer);
	headFinalOutConfig.addOutputShipStrategy(ShipStrategyType.FORWARD);
	headConfig.setIterationHeadFinalOutputConfig(headFinalOutConfig);
	
	// the sync
	headConfig.setIterationHeadIndexOfSyncOutput(2);
	
	// the driver 
	headConfig.setDriver(NoOpDriver.class);
	headConfig.setDriverStrategy(DriverStrategy.UNARY_NO_OP);
	
	return head;
}
 
開發者ID:citlab,項目名稱:vs.msc.ws14,代碼行數:34,代碼來源:KMeansIterativeNepheleITCase.java

示例2: createIterationHead

import org.apache.flink.runtime.operators.util.TaskConfig; //導入方法依賴的package包/類
private static AbstractJobVertex createIterationHead(JobGraph jobGraph, int numSubTasks,
		TypeSerializerFactory<?> serializer,
		TypeComparatorFactory<?> comparator,
		TypePairComparatorFactory<?, ?> pairComparator) {

	AbstractJobVertex head = JobGraphUtils.createTask(IterationHeadPactTask.class, "Join With Edges (Iteration Head)", jobGraph, numSubTasks);
	TaskConfig headConfig = new TaskConfig(head.getConfiguration());
	{
		headConfig.setIterationId(ITERATION_ID);

		// initial input / workset
		headConfig.addInputToGroup(0);
		headConfig.setInputSerializer(serializer, 0);
		headConfig.setInputComparator(comparator, 0);
		headConfig.setInputLocalStrategy(0, LocalStrategy.NONE);
		headConfig.setIterationHeadPartialSolutionOrWorksetInputIndex(0);

		// regular plan input (second input to the join)
		headConfig.addInputToGroup(1);
		headConfig.setInputSerializer(serializer, 1);
		headConfig.setInputComparator(comparator, 1);
		headConfig.setInputLocalStrategy(1, LocalStrategy.NONE);
		headConfig.setInputCached(1, true);
		headConfig.setRelativeInputMaterializationMemory(1, MEM_FRAC_PER_CONSUMER);

		// initial solution set input
		headConfig.addInputToGroup(2);
		headConfig.setInputSerializer(serializer, 2);
		headConfig.setInputComparator(comparator, 2);
		headConfig.setInputLocalStrategy(2, LocalStrategy.NONE);
		headConfig.setIterationHeadSolutionSetInputIndex(2);

		headConfig.setSolutionSetSerializer(serializer);
		headConfig.setSolutionSetComparator(comparator);

		// back channel / iterations
		headConfig.setIsWorksetIteration();
		headConfig.setRelativeBackChannelMemory(MEM_FRAC_PER_CONSUMER);
		headConfig.setRelativeSolutionSetMemory(MEM_FRAC_PER_CONSUMER );

		// output into iteration
		headConfig.setOutputSerializer(serializer);
		headConfig.addOutputShipStrategy(ShipStrategyType.PARTITION_HASH);
		headConfig.setOutputComparator(comparator, 0);

		// final output
		TaskConfig headFinalOutConfig = new TaskConfig(new Configuration());
		headFinalOutConfig.setOutputSerializer(serializer);
		headFinalOutConfig.addOutputShipStrategy(ShipStrategyType.FORWARD);
		headConfig.setIterationHeadFinalOutputConfig(headFinalOutConfig);

		// the sync
		headConfig.setIterationHeadIndexOfSyncOutput(2);

		// the driver
		headConfig.setDriver(BuildSecondCachedMatchDriver.class);
		headConfig.setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_SECOND);
		headConfig.setStubWrapper(
			new UserCodeClassWrapper<NeighborWithComponentIDJoin>(NeighborWithComponentIDJoin.class));
		headConfig.setDriverComparator(comparator, 0);
		headConfig.setDriverComparator(comparator, 1);
		headConfig.setDriverPairComparator(pairComparator);
		headConfig.setRelativeMemoryDriver(MEM_FRAC_PER_CONSUMER);

		headConfig.addIterationAggregator(
			WorksetEmptyConvergenceCriterion.AGGREGATOR_NAME, new LongSumAggregator());
	}

	return head;
}
 
開發者ID:citlab,項目名稱:vs.msc.ws14,代碼行數:71,代碼來源:ConnectedComponentsNepheleITCase.java


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