@SuppressWarnings("unchecked") private ObjectArrayTypeInfo(Type arrayType, Type componentType) { this.arrayType = arrayType; this.componentType = componentType; this.componentInfo = (TypeInformation<C>) TypeExtractor.createTypeInfo(componentType); }
@Override public TypeComparator<T> createComparator(boolean sortOrderAscending) { return instantiateComparator(comparatorClass, sortOrderAscending); }
@Override public TypeInformation<E> getProducedType() { return TypeExtractor.getForClass(this.avroValueType); }
@SuppressWarnings("unchecked") public static <IN, OUT> TypeInformation<OUT> getMapReturnTypes(MapFunction<IN, OUT> mapFunction, TypeInformation<IN> inType) { validateInputType(MapFunction.class, mapFunction.getClass(), 0, inType); if(mapFunction instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) mapFunction).getProducedType(); } return createTypeInfo(MapFunction.class, mapFunction.getClass(), 1, inType, null); }
@SuppressWarnings("unchecked") public static <IN> TypeInformation<IN> getInputFormatTypes(InputFormat<IN, ?> inputFormat) { if(inputFormat instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<IN>) inputFormat).getProducedType(); } return createTypeInfo(InputFormat.class, inputFormat.getClass(), 0, null, null); }
@SuppressWarnings("unchecked") public static <T, C> ObjectArrayTypeInfo<T, C> getInfoFor(Type type) { // class type e.g. for custom objects if (type instanceof Class<?> && ((Class<?>) type).isArray() && BasicTypeInfo.getInfoFor((Class<C>) type) == null) { Class<C> array = (Class<C>) type; return new ObjectArrayTypeInfo<T, C>(type, array.getComponentType()); } throw new InvalidTypesException("The given type is not a valid object array."); } }
public static BinaryOperatorInformation<Record, Record, Record> binary() { return new BinaryOperatorInformation<Record, Record, Record>(new RecordTypeInfo(), new RecordTypeInfo(), new RecordTypeInfo()); } }
public SelectorFunctionKeys(KeySelector<T, K> keyExtractor, TypeInformation<T> type) { this.keyExtractor = keyExtractor; this.keyType = TypeExtractor.getKeySelectorTypes(keyExtractor, type); }
public static Type getParameterType(Class<?> baseClass, Class<?> clazz, int pos) { return getParameterType(baseClass, null, clazz, pos); }
public static TypeInformation<?> createTypeInfo(Type t) { ArrayList<Type> typeHierarchy = new ArrayList<Type>(); typeHierarchy.add(t); return createTypeInfoWithTypeHierarchy(typeHierarchy, t, null, null); }
private static int[] makeFields(int[] fields, TupleTypeInfo<?> type) { int inLength = type.getArity(); // null parameter means all fields are considered if (fields == null || fields.length == 0) { fields = new int[inLength]; for (int i = 0; i < inLength; i++) { fields[i] = i; } return fields; } else { return rangeCheckAndOrderFields(fields, inLength-1); } }
@SuppressWarnings("unchecked") public static <IN, OUT> TypeInformation<OUT> getFlatMapReturnTypes(FlatMapFunction<IN, OUT> flatMapFunction, TypeInformation<IN> inType) { validateInputType(FlatMapFunction.class, flatMapFunction.getClass(), 0, inType); if(flatMapFunction instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) flatMapFunction).getProducedType(); } return createTypeInfo(FlatMapFunction.class, flatMapFunction.getClass(), 1, inType, null); }
public static UnaryOperatorInformation<Record, Record> unary() { return new UnaryOperatorInformation<Record, Record>(new RecordTypeInfo(), new RecordTypeInfo()); }
@SuppressWarnings("unchecked") public static <IN, OUT> TypeInformation<OUT> getGroupReduceReturnTypes(GroupReduceFunction<IN, OUT> groupReduceFunction, TypeInformation<IN> inType) { validateInputType(GroupReduceFunction.class, groupReduceFunction.getClass(), 0, inType); if(groupReduceFunction instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) groupReduceFunction).getProducedType(); } return createTypeInfo(GroupReduceFunction.class, groupReduceFunction.getClass(), 1, inType, null); }
public SolutionSetPlaceHolder(DeltaIterationBase<Record, ?> container) { super(container, new OperatorInformation<Record>(new RecordTypeInfo())); } }
@SuppressWarnings("unchecked") public static <IN1, IN2, OUT> TypeInformation<OUT> getJoinReturnTypes(JoinFunction<IN1, IN2, OUT> joinFunction, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type) { validateInputType(JoinFunction.class, joinFunction.getClass(), 0, in1Type); validateInputType(JoinFunction.class, joinFunction.getClass(), 1, in2Type); if(joinFunction instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) joinFunction).getProducedType(); } return createTypeInfo(JoinFunction.class, joinFunction.getClass(), 2, in1Type, in2Type); }
public WorksetPlaceHolder(DeltaIterationBase<?, Record> container) { super(container, new OperatorInformation<Record>(new RecordTypeInfo())); } }
@SuppressWarnings("unchecked") public static <IN1, IN2, OUT> TypeInformation<OUT> getCrossReturnTypes(CrossFunction<IN1, IN2, OUT> crossFunction, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type) { validateInputType(CrossFunction.class, crossFunction.getClass(), 0, in1Type); validateInputType(CrossFunction.class, crossFunction.getClass(), 1, in2Type); if(crossFunction instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) crossFunction).getProducedType(); } return createTypeInfo(CrossFunction.class, crossFunction.getClass(), 2, in1Type, in2Type); }
@SuppressWarnings("unchecked") public static <IN, OUT> TypeInformation<OUT> getKeySelectorTypes(KeySelector<IN, OUT> selector, TypeInformation<IN> inType) { validateInputType(KeySelector.class, selector.getClass(), 0, inType); if(selector instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) selector).getProducedType(); } return createTypeInfo(KeySelector.class, selector.getClass(), 1, inType, null); }
@SuppressWarnings("unchecked") public static <IN1, IN2, OUT> TypeInformation<OUT> getCoGroupReturnTypes(CoGroupFunction<IN1, IN2, OUT> coGroupFunction, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type) { validateInputType(CoGroupFunction.class, coGroupFunction.getClass(), 0, in1Type); validateInputType(CoGroupFunction.class, coGroupFunction.getClass(), 1, in2Type); if(coGroupFunction instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) coGroupFunction).getProducedType(); } return createTypeInfo(CoGroupFunction.class, coGroupFunction.getClass(), 2, in1Type, in2Type); }