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


Java PlanLeftUnwrappingCoGroupOperator类代码示例

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


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

示例1: translateSelectorFunctionCoGroupLeft

import org.apache.flink.api.java.operators.translation.PlanLeftUnwrappingCoGroupOperator; //导入依赖的package包/类
private static <I1, I2, K, OUT> PlanLeftUnwrappingCoGroupOperator<I1, I2, OUT, K> translateSelectorFunctionCoGroupLeft(
		SelectorFunctionKeys<I1, ?> rawKeys1, int[] logicalKeyPositions2,
		CoGroupFunction<I1, I2, OUT> function,
		TypeInformation<I2> inputType2, TypeInformation<OUT> outputType, String name,
		Operator<I1> input1, Operator<I2> input2) {
	if (!inputType2.isTupleType()) {
		throw new InvalidParameterException("Should not happen.");
	}

	@SuppressWarnings("unchecked")
	final SelectorFunctionKeys<I1, K> keys1 = (SelectorFunctionKeys<I1, K>) rawKeys1;
	final TypeInformation<Tuple2<K, I1>> typeInfoWithKey1 = KeyFunctions.createTypeWithKey(keys1);
	final Operator<Tuple2<K, I1>> keyedInput1 = KeyFunctions.appendKeyExtractor(input1, keys1);

	final PlanLeftUnwrappingCoGroupOperator<I1, I2, OUT, K> cogroup =
			new PlanLeftUnwrappingCoGroupOperator<>(
					function,
					keys1,
					logicalKeyPositions2,
					name,
					outputType,
					typeInfoWithKey1,
					inputType2);

	cogroup.setFirstInput(keyedInput1);
	cogroup.setSecondInput(input2);

	return cogroup;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:30,代码来源:CoGroupOperator.java

示例2: translateSelectorFunctionCoGroupLeft

import org.apache.flink.api.java.operators.translation.PlanLeftUnwrappingCoGroupOperator; //导入依赖的package包/类
private static <I1, I2, K, OUT> PlanLeftUnwrappingCoGroupOperator<I1, I2, OUT, K> translateSelectorFunctionCoGroupLeft(
		Keys.SelectorFunctionKeys<I1, ?> rawKeys1, int[] logicalKeyPositions2,
		CoGroupFunction<I1, I2, OUT> function,
		TypeInformation<I1> inputType1, TypeInformation<I2> inputType2, TypeInformation<OUT> outputType, String name,
		Operator<I1> input1, Operator<I2> input2)
{
	if(!inputType2.isTupleType()) {
		throw new InvalidParameterException("Should not happen.");
	}

	@SuppressWarnings("unchecked")
	final Keys.SelectorFunctionKeys<I1, K> keys1 = (Keys.SelectorFunctionKeys<I1, K>) rawKeys1;

	final TypeInformation<Tuple2<K, I1>> typeInfoWithKey1 =
			new TupleTypeInfo<Tuple2<K, I1>>(keys1.getKeyType(), inputType1);

	final KeyExtractingMapper<I1, K> extractor1 = new KeyExtractingMapper<I1, K>(keys1.getKeyExtractor());

	final MapOperatorBase<I1, Tuple2<K, I1>, MapFunction<I1, Tuple2<K, I1>>> keyMapper1 =
			new MapOperatorBase<I1, Tuple2<K, I1>, MapFunction<I1, Tuple2<K, I1>>>(
					extractor1,
					new UnaryOperatorInformation<I1, Tuple2<K, I1>>(inputType1, typeInfoWithKey1),
					"Key Extractor 1");

	final PlanLeftUnwrappingCoGroupOperator<I1, I2, OUT, K> cogroup =
			new PlanLeftUnwrappingCoGroupOperator<I1, I2, OUT, K>(
					function,
					keys1,
					logicalKeyPositions2,
					name,
					outputType,
					typeInfoWithKey1,
					inputType2);

	cogroup.setFirstInput(keyMapper1);
	cogroup.setSecondInput(input2);

	keyMapper1.setInput(input1);
	// set dop
	keyMapper1.setDegreeOfParallelism(input1.getDegreeOfParallelism());

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


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