本文整理汇总了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());
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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>>();
}
示例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>>();
}
示例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);
}
示例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>>();
}
示例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>>();
}
示例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);
}
示例13: getUserCodeWrapper
import org.apache.flink.api.common.operators.util.UserCodeWrapper; //导入依赖的package包/类
@Override
public UserCodeWrapper<?> getUserCodeWrapper() {
return null;
}
示例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;
}
示例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);
}