public static SingleInputSemanticProperties getSemanticPropsSingle( Set<Annotation> set, TypeInformation<?> inType, TypeInformation<?> outType) { if (set == null) { return null; } Iterator<Annotation> it = set.iterator(); String[] forwarded = null; String[] nonForwarded = null; String[] read = null; while (it.hasNext()) { Annotation ann = it.next(); if (ann instanceof ForwardedFields) { forwarded = ((ForwardedFields) ann).value(); } else if (ann instanceof NonForwardedFields) { nonForwarded = ((NonForwardedFields) ann).value(); } else if (ann instanceof ReadFields) { read = ((ReadFields) ann).value(); } else if (ann instanceof ForwardedFieldsFirst || ann instanceof ForwardedFieldsSecond || ann instanceof NonForwardedFieldsFirst || ann instanceof NonForwardedFieldsSecond || ann instanceof ReadFieldsFirst || ann instanceof ReadFieldsSecond) { throw new InvalidSemanticAnnotationException("Annotation " + ann.getClass() + " invalid for single input function."); } } if (forwarded != null || nonForwarded != null || read != null) { SingleInputSemanticProperties result = new SingleInputSemanticProperties(); getSemanticPropsSingleFromString(result, forwarded, nonForwarded, read, inType, outType); return result; } return null; }
public static SingleInputSemanticProperties getSemanticPropsSingle( Set<Annotation> set, TypeInformation<?> inType, TypeInformation<?> outType) { if (set == null) { return null; } Iterator<Annotation> it = set.iterator(); String[] forwarded = null; String[] nonForwarded = null; String[] read = null; while (it.hasNext()) { Annotation ann = it.next(); if (ann instanceof ForwardedFields) { forwarded = ((ForwardedFields) ann).value(); } else if (ann instanceof NonForwardedFields) { nonForwarded = ((NonForwardedFields) ann).value(); } else if (ann instanceof ReadFields) { read = ((ReadFields) ann).value(); } else if (ann instanceof ForwardedFieldsFirst || ann instanceof ForwardedFieldsSecond || ann instanceof NonForwardedFieldsFirst || ann instanceof NonForwardedFieldsSecond || ann instanceof ReadFieldsFirst || ann instanceof ReadFieldsSecond) { throw new InvalidSemanticAnnotationException("Annotation " + ann.getClass() + " invalid for single input function."); } } if (forwarded != null || nonForwarded != null || read != null) { SingleInputSemanticProperties result = new SingleInputSemanticProperties(); getSemanticPropsSingleFromString(result, forwarded, nonForwarded, read, inType, outType); return result; } return null; }
public static SingleInputSemanticProperties getSemanticPropsSingle( Set<Annotation> set, TypeInformation<?> inType, TypeInformation<?> outType) { if (set == null) { return null; } Iterator<Annotation> it = set.iterator(); String[] forwarded = null; String[] nonForwarded = null; String[] read = null; while (it.hasNext()) { Annotation ann = it.next(); if (ann instanceof ForwardedFields) { forwarded = ((ForwardedFields) ann).value(); } else if (ann instanceof NonForwardedFields) { nonForwarded = ((NonForwardedFields) ann).value(); } else if (ann instanceof ReadFields) { read = ((ReadFields) ann).value(); } else if (ann instanceof ForwardedFieldsFirst || ann instanceof ForwardedFieldsSecond || ann instanceof NonForwardedFieldsFirst || ann instanceof NonForwardedFieldsSecond || ann instanceof ReadFieldsFirst || ann instanceof ReadFieldsSecond) { throw new InvalidSemanticAnnotationException("Annotation " + ann.getClass() + " invalid for single input function."); } } if (forwarded != null || nonForwarded != null || read != null) { SingleInputSemanticProperties result = new SingleInputSemanticProperties(); getSemanticPropsSingleFromString(result, forwarded, nonForwarded, read, inType, outType); return result; } return null; }
@FunctionAnnotation.NonForwardedFields("2;4") private static class DummyGroupReduceFunction4 implements GroupReduceFunction<Tuple5<Integer, Long, String, Long, Integer>, Tuple5<Integer, Long, String, Long, Integer>> { @Override public void reduce(Iterable<Tuple5<Integer, Long, String, Long, Integer>> values, Collector<Tuple5<Integer, Long, String, Long, Integer>> out) throws Exception { } } }
@FunctionAnnotation.NonForwardedFields({"1"}) private static class AllForwardedExceptMapper<T> implements MapFunction<T, T> { @Override public T map(T value) { return value; } }
@FunctionAnnotation.NonForwardedFields("2;4") private static class DummyReduceFunction4 implements ReduceFunction<Tuple5<Integer, Long, String, Long, Integer>> { @Override public Tuple5<Integer, Long, String, Long, Integer> reduce(Tuple5<Integer, Long, String, Long, Integer> v1, Tuple5<Integer, Long, String, Long, Integer> v2) throws Exception { return new Tuple5<Integer, Long, String, Long, Integer>(); } } }
@FunctionAnnotation.NonForwardedFields("2;4") private static class DummyGroupCombineFunction4 implements GroupCombineFunction<Tuple5<Integer, Long, String, Long, Integer>, Tuple5<Integer, Long, String, Long, Integer>> { @Override public void combine(Iterable<Tuple5<Integer, Long, String, Long, Integer>> values, Collector<Tuple5<Integer, Long, String, Long, Integer>> out) throws Exception { } } }