本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}