use of org.apache.flink.api.java.functions.FunctionAnnotation.ReadFieldsFirst in project flink by apache.
the class SemanticPropUtil method getSemanticPropsDual.
public static DualInputSemanticProperties getSemanticPropsDual(Set<Annotation> set, TypeInformation<?> inType1, TypeInformation<?> inType2, TypeInformation<?> outType) {
if (set == null) {
return null;
}
Iterator<Annotation> it = set.iterator();
String[] forwardedFirst = null;
String[] forwardedSecond = null;
String[] nonForwardedFirst = null;
String[] nonForwardedSecond = null;
String[] readFirst = null;
String[] readSecond = null;
while (it.hasNext()) {
Annotation ann = it.next();
if (ann instanceof ForwardedFieldsFirst) {
forwardedFirst = ((ForwardedFieldsFirst) ann).value();
} else if (ann instanceof ForwardedFieldsSecond) {
forwardedSecond = ((ForwardedFieldsSecond) ann).value();
} else if (ann instanceof NonForwardedFieldsFirst) {
nonForwardedFirst = ((NonForwardedFieldsFirst) ann).value();
} else if (ann instanceof NonForwardedFieldsSecond) {
nonForwardedSecond = ((NonForwardedFieldsSecond) ann).value();
} else if (ann instanceof ReadFieldsFirst) {
readFirst = ((ReadFieldsFirst) ann).value();
} else if (ann instanceof ReadFieldsSecond) {
readSecond = ((ReadFieldsSecond) ann).value();
} else if (ann instanceof ForwardedFields || ann instanceof NonForwardedFields || ann instanceof ReadFields) {
throw new InvalidSemanticAnnotationException("Annotation " + ann.getClass() + " invalid for dual input function.");
}
}
if (forwardedFirst != null || nonForwardedFirst != null || readFirst != null || forwardedSecond != null || nonForwardedSecond != null || readSecond != null) {
DualInputSemanticProperties result = new DualInputSemanticProperties();
getSemanticPropsDualFromString(result, forwardedFirst, forwardedSecond, nonForwardedFirst, nonForwardedSecond, readFirst, readSecond, inType1, inType2, outType);
return result;
}
return null;
}
use of org.apache.flink.api.java.functions.FunctionAnnotation.ReadFieldsFirst in project flink by apache.
the class SemanticPropUtil method getSemanticPropsSingle.
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;
}
Aggregations