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


Java UserCodeWrapper类代码示例

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


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

示例1: initializeOnMaster

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
@Override
public void initializeOnMaster(ClassLoader loader) throws Exception {
	if (this.outputFormat == null) {
		TaskConfig cfg = new TaskConfig(getConfiguration());
		UserCodeWrapper<OutputFormat<?>> wrapper = cfg.<OutputFormat<?>>getStubWrapper(loader);
	
		if (wrapper == null) {
			throw new Exception("No output format present in OutputFormatVertex's task configuration.");
		}

		this.outputFormat = wrapper.getUserCodeObject(OutputFormat.class, loader);
		this.outputFormat.configure(cfg.getStubParameters());
	}
	
	if (this.outputFormat instanceof InitializeOnMaster) {
		((InitializeOnMaster) this.outputFormat).initializeGlobal(getParallelism());
	}
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:19,代码来源:OutputFormatVertex.java

示例2: initializeOnMaster

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
@Override
public void initializeOnMaster(ClassLoader loader) throws Exception {
	if (inputFormat == null) {
		TaskConfig cfg = new TaskConfig(getConfiguration());
		UserCodeWrapper<InputFormat<?, ?>> wrapper = cfg.<InputFormat<?, ?>>getStubWrapper(loader);
		
		if (wrapper == null) {
			throw new Exception("No input format present in InputFormatVertex's task configuration.");
		}
		
		inputFormat = wrapper.getUserCodeObject(InputFormat.class, loader);
		inputFormat.configure(cfg.getStubParameters());
	}
	
	setInputSplitSource(inputFormat);
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:17,代码来源:InputFormatVertex.java

示例3: CrossOperatorBase

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
public CrossOperatorBase(UserCodeWrapper<FT> udf, BinaryOperatorInformation<IN1, IN2, OUT> operatorInfo, String name) {
	super(udf, operatorInfo, name);
	
	if (this instanceof CrossWithSmall) {
		setCrossHint(CrossHint.SECOND_IS_SMALL);
	}
	else if (this instanceof CrossWithLarge) {
		setCrossHint(CrossHint.FIRST_IS_SMALL);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:CrossOperatorBase.java

示例4: setStubWrapper

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
public void setStubWrapper(UserCodeWrapper<?> wrapper) {
	try {
		InstantiationUtil.writeObjectToConfig(wrapper, this.config, STUB_OBJECT);
	} catch (IOException e) {
		throw new CorruptConfigurationException("Could not write the user code wrapper " + wrapper.getClass() + " : " + e.toString(), e);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:8,代码来源:TaskConfig.java

示例5: getStubWrapper

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T> UserCodeWrapper<T> getStubWrapper(ClassLoader cl) {
	try {
		return (UserCodeWrapper<T>) InstantiationUtil.readObjectFromConfig(this.config, STUB_OBJECT, cl);
	} catch (ClassNotFoundException | IOException e) {
		throw new CorruptConfigurationException("Could not read the user code wrapper: " + e.getMessage(), e);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:9,代码来源:TaskConfig.java

示例6: createInput

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的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: Builder

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
/**
 * Creates a Builder with the provided {@link JoinFunction} implementation
 * 
 * @param udf The {@link JoinFunction} implementation for this Match operator.
 * @param keyClass The class of the key data type.
 * @param keyColumn1 The position of the key in the first input's records.
 * @param keyColumn2 The position of the key in the second input's records.
 */
protected Builder(UserCodeWrapper<JoinFunction> udf, Class<? extends Key<?>> keyClass, int keyColumn1, int keyColumn2) {
	this.udf = udf;
	this.keyClasses = new ArrayList<Class<? extends Key<?>>>();
	this.keyClasses.add(keyClass);
	this.keyColumns1 = new ArrayList<Integer>();
	this.keyColumns1.add(keyColumn1);
	this.keyColumns2 = new ArrayList<Integer>();
	this.keyColumns2.add(keyColumn2);
	this.inputs1 = new ArrayList<Operator<Record>>();
	this.inputs2 = new ArrayList<Operator<Record>>();
	this.broadcastInputs = new HashMap<String, Operator<Record>>();
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:21,代码来源:JoinOperator.java

示例8: Builder

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
/**
 * Creates a Builder with the provided {@link CoGroupFunction} implementation.
 * 
 * @param udf The {@link CoGroupFunction} implementation for this CoGroup operator.
 * @param keyClass The class of the key data type.
 * @param keyColumn1 The position of the key in the first input's records.
 * @param keyColumn2 The position of the key in the second input's records.
 */
protected Builder(UserCodeWrapper<org.apache.flink.api.common.functions.CoGroupFunction<Record, Record, Record>> udf, Class<? extends Key<?>> keyClass,
		int keyColumn1, int keyColumn2)
{
	this.udf = udf;
	this.keyClasses = new ArrayList<Class<? extends Key<?>>>();
	this.keyClasses.add(keyClass);
	this.keyColumns1 = new ArrayList<Integer>();
	this.keyColumns1.add(keyColumn1);
	this.keyColumns2 = new ArrayList<Integer>();
	this.keyColumns2.add(keyColumn2);
	this.inputs1 = new ArrayList<Operator<Record>>();
	this.inputs2 = new ArrayList<Operator<Record>>();
	this.broadcastInputs = new HashMap<String, Operator<Record>>();
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:23,代码来源:CoGroupOperator.java

示例9: builder

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
/**
 * Creates a Builder with the provided {@link ReduceFunction} implementation.
 * 
 * @param udf The {@link ReduceFunction} implementation for this Reduce contract.
 */
public static Builder builder(ReduceFunction udf) {
	UserCodeWrapper<ReduceFunction> original = new UserCodeObjectWrapper<ReduceFunction>(udf);
	UserCodeWrapper<GroupReduceFunction<Record, Record>> wrapped =
			new UserCodeObjectWrapper<GroupReduceFunction<Record, Record>>(new WrappingReduceFunction(udf));
	
	return new Builder(original, wrapped);
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:13,代码来源:ReduceOperator.java

示例10: Builder

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
/**
 * Creates a Builder with the provided {@link ReduceFunction} implementation.
 * 
 * @param wrappedUdf The {@link ReduceFunction} implementation for this Reduce contract.
 */
private Builder(UserCodeWrapper<ReduceFunction> originalUdf, UserCodeWrapper<GroupReduceFunction<Record, Record>> wrappedUdf) {
	this.originalUdf = originalUdf;
	this.udfWrapper = wrappedUdf;
	this.keyClasses = new ArrayList<Class<? extends Key<?>>>();
	this.keyColumns = new ArrayList<Integer>();
	this.inputs = new ArrayList<Operator<Record>>();
	this.broadcastInputs = new HashMap<String, Operator<Record>>();
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:14,代码来源:ReduceOperator.java

示例11: Builder

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
/**
 * Creates a Builder with the provided {@link CrossFunction} implementation.
 * 
 * @param udf The {@link CrossFunction} implementation for this Cross operator.
 */
protected Builder(UserCodeWrapper<CrossFunction> udf) {
	this.udf = udf;
	this.inputs1 = new ArrayList<Operator<Record>>();
	this.inputs2 = new ArrayList<Operator<Record>>();
	this.broadcastInputs = new HashMap<String, Operator<Record>>();
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:12,代码来源:CrossOperator.java

示例12: InnerJoinOperatorBase

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
public InnerJoinOperatorBase(UserCodeWrapper<FT> udf, BinaryOperatorInformation<IN1, IN2, OUT> operatorInfo,
		int[] keyPositions1, int[] keyPositions2, String name) {
	super(udf, operatorInfo, keyPositions1, keyPositions2, name);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:5,代码来源:InnerJoinOperatorBase.java

示例13: getUserCodeWrapper

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
@Override
public UserCodeWrapper<?> getUserCodeWrapper() {
	return null;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:5,代码来源:DeltaIterationBase.java

示例14: CoGroupRawOperatorBase

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
public CoGroupRawOperatorBase(UserCodeWrapper<FT> udf, BinaryOperatorInformation<IN1, IN2, OUT> operatorInfo, int[] keyPositions1, int[] keyPositions2, String name) {
	super(udf, operatorInfo, keyPositions1, keyPositions2, name);
	this.combinableFirst = false;
	this.combinableSecond = false;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:6,代码来源:CoGroupRawOperatorBase.java

示例15: MapOperatorBase

import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
public MapOperatorBase(UserCodeWrapper<FT> udf, UnaryOperatorInformation<IN, OUT> operatorInfo, String name) {
	super(udf, operatorInfo, name);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:4,代码来源:MapOperatorBase.java


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