当前位置: 首页>>代码示例>>Java>>正文


Java InputFormatVertex.getConfiguration方法代码示例

本文整理汇总了Java中org.apache.flink.runtime.jobgraph.InputFormatVertex.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java InputFormatVertex.getConfiguration方法的具体用法?Java InputFormatVertex.getConfiguration怎么用?Java InputFormatVertex.getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.flink.runtime.jobgraph.InputFormatVertex的用法示例。


在下文中一共展示了InputFormatVertex.getConfiguration方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createEdgesInput

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
private static InputFormatVertex createEdgesInput(JobGraph jobGraph, String edgesPath, int numSubTasks,
		TypeSerializerFactory<?> serializer, TypeComparatorFactory<?> comparator)
{
	// edges
	@SuppressWarnings("unchecked")
	CsvInputFormat edgesInFormat = new CsvInputFormat(' ', LongValue.class, LongValue.class);
	InputFormatVertex edgesInput = JobGraphUtils.createInput(edgesInFormat, edgesPath, "EdgesInput", jobGraph,
		numSubTasks);
	TaskConfig edgesInputConfig = new TaskConfig(edgesInput.getConfiguration());
	{
		edgesInputConfig.setOutputSerializer(serializer);
		edgesInputConfig.addOutputShipStrategy(ShipStrategyType.PARTITION_HASH);
		edgesInputConfig.setOutputComparator(comparator, 0);
	}

	return edgesInput;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:18,代码来源:ConnectedComponentsNepheleITCase.java

示例2: createPointsInput

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
private static InputFormatVertex createPointsInput(JobGraph jobGraph, String pointsPath, int numSubTasks, TypeSerializerFactory<?> serializer) {
	@SuppressWarnings("unchecked")
	CsvInputFormat pointsInFormat = new CsvInputFormat('|', IntValue.class, DoubleValue.class, DoubleValue.class, DoubleValue.class);
	InputFormatVertex pointsInput = JobGraphUtils.createInput(pointsInFormat, pointsPath, "[Points]", jobGraph, numSubTasks);
	{
		TaskConfig taskConfig = new TaskConfig(pointsInput.getConfiguration());
		taskConfig.addOutputShipStrategy(ShipStrategyType.FORWARD);
		taskConfig.setOutputSerializer(serializer);
		
		TaskConfig chainedMapper = new TaskConfig(new Configuration());
		chainedMapper.setDriverStrategy(DriverStrategy.COLLECTOR_MAP);
		chainedMapper.setStubWrapper(new UserCodeObjectWrapper<PointBuilder>(new PointBuilder()));
		chainedMapper.addOutputShipStrategy(ShipStrategyType.FORWARD);
		chainedMapper.setOutputSerializer(serializer);
		
		taskConfig.addChainedTask(ChainedCollectorMapDriver.class, chainedMapper, "Build points");
	}

	return pointsInput;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:21,代码来源:KMeansIterativeNepheleITCase.java

示例3: createCentersInput

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
private static InputFormatVertex createCentersInput(JobGraph jobGraph, String centersPath, int numSubTasks, TypeSerializerFactory<?> serializer) {
	@SuppressWarnings("unchecked")
	CsvInputFormat modelsInFormat = new CsvInputFormat('|', IntValue.class, DoubleValue.class, DoubleValue.class, DoubleValue.class);
	InputFormatVertex modelsInput = JobGraphUtils.createInput(modelsInFormat, centersPath, "[Models]", jobGraph, numSubTasks);

	{
		TaskConfig taskConfig = new TaskConfig(modelsInput.getConfiguration());
		taskConfig.addOutputShipStrategy(ShipStrategyType.FORWARD);
		taskConfig.setOutputSerializer(serializer);

		TaskConfig chainedMapper = new TaskConfig(new Configuration());
		chainedMapper.setDriverStrategy(DriverStrategy.COLLECTOR_MAP);
		chainedMapper.setStubWrapper(new UserCodeObjectWrapper<PointBuilder>(new PointBuilder()));
		chainedMapper.addOutputShipStrategy(ShipStrategyType.FORWARD);
		chainedMapper.setOutputSerializer(serializer);
		
		taskConfig.addChainedTask(ChainedCollectorMapDriver.class, chainedMapper, "Build centers");
	}

	return modelsInput;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:22,代码来源:KMeansIterativeNepheleITCase.java

示例4: createDataSourceVertex

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
private InputFormatVertex createDataSourceVertex(SourcePlanNode node) throws CompilerException {
	final InputFormatVertex vertex = new InputFormatVertex(node.getNodeName());
	final TaskConfig config = new TaskConfig(vertex.getConfiguration());

	vertex.setResources(node.getMinResources(), node.getPreferredResources());
	vertex.setInvokableClass(DataSourceTask.class);
	vertex.setFormatDescription(getDescriptionForUserCode(node.getProgramOperator().getUserCodeWrapper()));

	// set user code
	config.setStubWrapper(node.getProgramOperator().getUserCodeWrapper());
	config.setStubParameters(node.getProgramOperator().getParameters());

	config.setOutputSerializer(node.getSerializer());
	return vertex;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:16,代码来源:JobGraphGenerator.java

示例5: createDataSourceVertex

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
private InputFormatVertex createDataSourceVertex(SourcePlanNode node) throws CompilerException {
	final InputFormatVertex vertex = new InputFormatVertex(node.getNodeName());
	final TaskConfig config = new TaskConfig(vertex.getConfiguration());

	vertex.setInvokableClass(DataSourceTask.class);

	// set user code
	config.setStubWrapper(node.getPactContract().getUserCodeWrapper());
	config.setStubParameters(node.getPactContract().getParameters());

	config.setOutputSerializer(node.getSerializer());
	return vertex;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:14,代码来源:NepheleJobGraphGenerator.java

示例6: createInput

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
private static <T extends InputFormat<?,?>> InputFormatVertex createInput(UserCodeWrapper<T> stub, String name, JobGraph graph,
		int degreeOfParallelism)
{
	InputFormatVertex inputVertex = new InputFormatVertex(name);
	graph.addVertex(inputVertex);
	
	inputVertex.setInvokableClass(DataSourceTask.class);
	inputVertex.setParallelism(degreeOfParallelism);

	TaskConfig inputConfig = new TaskConfig(inputVertex.getConfiguration());
	inputConfig.setStubWrapper(stub);
	
	return inputVertex;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:15,代码来源:JobGraphUtils.java

示例7: createVerticesInput

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
private static InputFormatVertex createVerticesInput(JobGraph jobGraph, String verticesPath, int numSubTasks,
		TypeSerializerFactory<?> serializer, TypeComparatorFactory<?> comparator)
{
	@SuppressWarnings("unchecked")
	CsvInputFormat verticesInFormat = new CsvInputFormat(' ', LongValue.class);
	InputFormatVertex verticesInput = JobGraphUtils.createInput(verticesInFormat, verticesPath, "VerticesInput",
		jobGraph, numSubTasks);
	TaskConfig verticesInputConfig = new TaskConfig(verticesInput.getConfiguration());
	{
		verticesInputConfig.addOutputShipStrategy(ShipStrategyType.FORWARD);
		verticesInputConfig.setOutputSerializer(serializer);

		// chained mapper that duplicates the id
		TaskConfig chainedMapperConfig = new TaskConfig(new Configuration());
		chainedMapperConfig.setStubWrapper(new UserCodeClassWrapper<IdDuplicator>(IdDuplicator.class));
		chainedMapperConfig.setDriverStrategy(DriverStrategy.COLLECTOR_MAP);
		chainedMapperConfig.setInputLocalStrategy(0, LocalStrategy.NONE);
		chainedMapperConfig.setInputSerializer(serializer, 0);

		chainedMapperConfig.setOutputSerializer(serializer);
		chainedMapperConfig.addOutputShipStrategy(ShipStrategyType.PARTITION_HASH);
		chainedMapperConfig.addOutputShipStrategy(ShipStrategyType.PARTITION_HASH);
		chainedMapperConfig.setOutputComparator(comparator, 0);
		chainedMapperConfig.setOutputComparator(comparator, 1);

		verticesInputConfig.addChainedTask(ChainedCollectorMapDriver.class, chainedMapperConfig, "ID Duplicator");
	}

	return verticesInput;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:31,代码来源:ConnectedComponentsNepheleITCase.java

示例8: createPointsInput

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static InputFormatVertex createPointsInput(JobGraph jobGraph, String pointsPath, int numSubTasks, TypeSerializerFactory<?> serializer) {
	CsvInputFormat pointsInFormat = new CsvInputFormat(' ', LongValue.class, LongValue.class, LongValue.class, LongValue.class);
	InputFormatVertex pointsInput = JobGraphUtils.createInput(pointsInFormat, pointsPath, "Input[Points]", jobGraph, numSubTasks);

	{
		TaskConfig taskConfig = new TaskConfig(pointsInput.getConfiguration());
		taskConfig.addOutputShipStrategy(ShipStrategyType.FORWARD);
		taskConfig.setOutputSerializer(serializer);
	}

	return pointsInput;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:14,代码来源:BroadcastVarsNepheleITCase.java

示例9: createModelsInput

import org.apache.flink.runtime.jobgraph.InputFormatVertex; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static InputFormatVertex createModelsInput(JobGraph jobGraph, String pointsPath, int numSubTasks, TypeSerializerFactory<?> serializer) {
	CsvInputFormat modelsInFormat = new CsvInputFormat(' ', LongValue.class, LongValue.class, LongValue.class, LongValue.class);
	InputFormatVertex modelsInput = JobGraphUtils.createInput(modelsInFormat, pointsPath, "Input[Models]", jobGraph, numSubTasks);

	{
		TaskConfig taskConfig = new TaskConfig(modelsInput.getConfiguration());
		taskConfig.addOutputShipStrategy(ShipStrategyType.BROADCAST);
		taskConfig.setOutputSerializer(serializer);
	}

	return modelsInput;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:14,代码来源:BroadcastVarsNepheleITCase.java


注:本文中的org.apache.flink.runtime.jobgraph.InputFormatVertex.getConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。