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


Java NonParallelInput类代码示例

本文整理汇总了Java中org.apache.flink.api.common.io.NonParallelInput的典型用法代码示例。如果您正苦于以下问题:Java NonParallelInput类的具体用法?Java NonParallelInput怎么用?Java NonParallelInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NonParallelInput类属于org.apache.flink.api.common.io包,在下文中一共展示了NonParallelInput类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DataSource

import org.apache.flink.api.common.io.NonParallelInput; //导入依赖的package包/类
/**
 * Creates a new data source.
 *
 * @param context The environment in which the data source gets executed.
 * @param inputFormat The input format that the data source executes.
 * @param type The type of the elements produced by this input format.
 */
public DataSource(ExecutionEnvironment context, InputFormat<OUT, ?> inputFormat, TypeInformation<OUT> type, String dataSourceLocationName) {
	super(context, type);

	this.dataSourceLocationName = dataSourceLocationName;

	if (inputFormat == null) {
		throw new IllegalArgumentException("The input format may not be null.");
	}

	this.inputFormat = inputFormat;

	if (inputFormat instanceof NonParallelInput) {
		this.parallelism = 1;
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:23,代码来源:DataSource.java

示例2: createInputSplits

import org.apache.flink.api.common.io.NonParallelInput; //导入依赖的package包/类
@Override
public GenericInputSplit[] createInputSplits(int numSplits) throws IOException {
	if (numSplits < 1) {
		throw new IllegalArgumentException("Number of input splits has to be at least 1.");
	}

	numSplits = (this instanceof NonParallelInput) ? 1 : numSplits;
	GenericInputSplit[] splits = new GenericInputSplit[numSplits];
	for (int i = 0; i < splits.length; i++) {
		splits[i] = new GenericInputSplit(i, numSplits);
	}
	return splits;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:14,代码来源:NonRichGenericInputFormat.java

示例3: DataSourceNode

import org.apache.flink.api.common.io.NonParallelInput; //导入依赖的package包/类
/**
 * Creates a new DataSourceNode for the given contract.
 * 
 * @param pactContract
 *        The data source contract object.
 */
public DataSourceNode(GenericDataSourceBase<?, ?> pactContract) {
	super(pactContract);
	
	if (pactContract.getUserCodeWrapper().getUserCodeClass() == null) {
		throw new IllegalArgumentException("Input format has not been set.");
	}
	
	if (NonParallelInput.class.isAssignableFrom(pactContract.getUserCodeWrapper().getUserCodeClass())) {
		setParallelism(1);
		this.sequentialInput = true;
	} else {
		this.sequentialInput = false;
	}

	this.replicatedInput = ReplicatingInputFormat.class.isAssignableFrom(
													pactContract.getUserCodeWrapper().getUserCodeClass());

	this.gprops = new GlobalProperties();
	this.lprops = new LocalProperties();

	SplitDataProperties<?> splitProps = pactContract.getSplitDataProperties();

	if(replicatedInput) {
		this.gprops.setFullyReplicated();
		this.lprops = new LocalProperties();
	} else if (splitProps != null) {
		// configure data properties of data source using split properties
		setDataPropertiesFromSplitProperties(splitProps);
	}

}
 
开发者ID:axbaretto,项目名称:flink,代码行数:38,代码来源:DataSourceNode.java

示例4: DataSourceNode

import org.apache.flink.api.common.io.NonParallelInput; //导入依赖的package包/类
/**
 * Creates a new DataSourceNode for the given contract.
 * 
 * @param pactContract
 *        The data source contract object.
 */
public DataSourceNode(GenericDataSourceBase<?, ?> pactContract) {
	super(pactContract);
	
	if (pactContract.getUserCodeWrapper().getUserCodeClass() == null) {
		throw new IllegalArgumentException("Input format has not been set.");
	}
	
	if (NonParallelInput.class.isAssignableFrom(pactContract.getUserCodeWrapper().getUserCodeClass())) {
		setDegreeOfParallelism(1);
		this.sequentialInput = true;
	} else {
		this.sequentialInput = false;
	}
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:21,代码来源:DataSourceNode.java

示例5: DataSource

import org.apache.flink.api.common.io.NonParallelInput; //导入依赖的package包/类
/**
 * Creates a new data source.
 * 
 * @param context The environment in which the data source gets executed.
 * @param inputFormat The input format that the data source executes.
 * @param type The type of the elements produced by this input format.
 */
public DataSource(ExecutionEnvironment context, InputFormat<OUT, ?> inputFormat, TypeInformation<OUT> type) {
	super(context, type);
	
	if (inputFormat == null) {
		throw new IllegalArgumentException("The input format may not be null.");
	}
	
	this.inputFormat = inputFormat;
	
	if (inputFormat instanceof NonParallelInput) {
		this.dop = 1;
	}
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:21,代码来源:DataSource.java


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