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


Java TaskConfig.setGateIterativeWithNumberOfEventsUntilInterrupt方法代碼示例

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


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

示例1: createSync

import org.apache.flink.runtime.operators.util.TaskConfig; //導入方法依賴的package包/類
public static AbstractJobVertex createSync(JobGraph jobGraph, int parallelism) {
	AbstractJobVertex sync = new AbstractJobVertex("BulkIterationSync");
	jobGraph.addVertex(sync);
	
	sync.setInvokableClass(IterationSynchronizationSinkTask.class);
	sync.setParallelism(1);
	
	TaskConfig syncConfig = new TaskConfig(sync.getConfiguration());
	syncConfig.setGateIterativeWithNumberOfEventsUntilInterrupt(0, parallelism);
	return sync;
}
 
開發者ID:citlab,項目名稱:vs.msc.ws14,代碼行數:12,代碼來源:JobGraphUtils.java

示例2: createJobGraphUnifiedTails

import org.apache.flink.runtime.operators.util.TaskConfig; //導入方法依賴的package包/類
public JobGraph createJobGraphUnifiedTails(
		String verticesPath, String edgesPath, String resultPath, int numSubTasks, int maxIterations)
{
	// -- init -------------------------------------------------------------------------------------------------
	final TypeSerializerFactory<?> serializer = RecordSerializerFactory.get();
	@SuppressWarnings("unchecked")
	final TypeComparatorFactory<?> comparator =
		new RecordComparatorFactory(new int[] { 0 }, new Class[] { LongValue.class }, new boolean[] { true });
	final TypePairComparatorFactory<?, ?> pairComparator = RecordPairComparatorFactory.get();

	JobGraph jobGraph = new JobGraph("Connected Components (Unified Tails)");

	// -- invariant vertices -----------------------------------------------------------------------------------
	InputFormatVertex vertices = createVerticesInput(jobGraph, verticesPath, numSubTasks, serializer, comparator);
	InputFormatVertex edges = createEdgesInput(jobGraph, edgesPath, numSubTasks, serializer, comparator);
	AbstractJobVertex head = createIterationHead(jobGraph, numSubTasks, serializer, comparator, pairComparator);

	AbstractJobVertex intermediate = createIterationIntermediate(jobGraph, numSubTasks, serializer, comparator);
	TaskConfig intermediateConfig = new TaskConfig(intermediate.getConfiguration());

	OutputFormatVertex output = createOutput(jobGraph, resultPath, numSubTasks, serializer);
	AbstractJobVertex sync = createSync(jobGraph, numSubTasks, maxIterations);

	// --------------- the tail (solution set join) ---------------
	AbstractJobVertex tail = JobGraphUtils.createTask(IterationTailPactTask.class, "IterationTail", jobGraph, numSubTasks);
	TaskConfig tailConfig = new TaskConfig(tail.getConfiguration());
	{
		tailConfig.setIterationId(ITERATION_ID);

		tailConfig.setIsWorksetIteration();
		tailConfig.setIsWorksetUpdate();

		tailConfig.setIsSolutionSetUpdate();
		tailConfig.setIsSolutionSetUpdateWithoutReprobe();

		// inputs and driver
		tailConfig.addInputToGroup(0);
		tailConfig.setInputSerializer(serializer, 0);

		// output
		tailConfig.setOutputSerializer(serializer);

		// the driver
		tailConfig.setDriver(JoinWithSolutionSetSecondDriver.class);
		tailConfig.setDriverStrategy(DriverStrategy.HYBRIDHASH_BUILD_SECOND);
		tailConfig.setDriverComparator(comparator, 0);
		tailConfig.setDriverPairComparator(pairComparator);
		
		tailConfig.setStubWrapper(new UserCodeClassWrapper<UpdateComponentIdMatch>(UpdateComponentIdMatch.class));
	}

	// -- edges ------------------------------------------------------------------------------------------------
	JobGraphUtils.connect(vertices, head, ChannelType.NETWORK, DistributionPattern.BIPARTITE);
	JobGraphUtils.connect(edges, head, ChannelType.NETWORK, DistributionPattern.BIPARTITE);
	JobGraphUtils.connect(vertices, head, ChannelType.NETWORK, DistributionPattern.BIPARTITE);

	JobGraphUtils.connect(head, intermediate, ChannelType.NETWORK, DistributionPattern.BIPARTITE);
	intermediateConfig.setGateIterativeWithNumberOfEventsUntilInterrupt(0, numSubTasks);

	JobGraphUtils.connect(intermediate, tail, ChannelType.IN_MEMORY, DistributionPattern.POINTWISE);
	tailConfig.setGateIterativeWithNumberOfEventsUntilInterrupt(0, 1);

	JobGraphUtils.connect(head, output, ChannelType.IN_MEMORY, DistributionPattern.POINTWISE);

	JobGraphUtils.connect(head, sync, ChannelType.NETWORK, DistributionPattern.POINTWISE);

	SlotSharingGroup sharingGroup = new SlotSharingGroup();
	vertices.setSlotSharingGroup(sharingGroup);
	edges.setSlotSharingGroup(sharingGroup);
	head.setSlotSharingGroup(sharingGroup);
	intermediate.setSlotSharingGroup(sharingGroup);
	tail.setSlotSharingGroup(sharingGroup);
	output.setSlotSharingGroup(sharingGroup);
	sync.setSlotSharingGroup(sharingGroup);
	
	intermediate.setStrictlyCoLocatedWith(head);
	tail.setStrictlyCoLocatedWith(head);

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


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