本文整理汇总了Java中org.apache.flink.api.java.operators.translation.PlanLeftUnwrappingCoGroupOperator.setSecondInput方法的典型用法代码示例。如果您正苦于以下问题:Java PlanLeftUnwrappingCoGroupOperator.setSecondInput方法的具体用法?Java PlanLeftUnwrappingCoGroupOperator.setSecondInput怎么用?Java PlanLeftUnwrappingCoGroupOperator.setSecondInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.api.java.operators.translation.PlanLeftUnwrappingCoGroupOperator
的用法示例。
在下文中一共展示了PlanLeftUnwrappingCoGroupOperator.setSecondInput方法的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;
}
示例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;
}