@ Internal public static Set < Annotation > readSingleForwardAnnotations ( Class < ? > udfClass ) { ForwardedFields forwardedFields = udfClass . getAnnotation ( ForwardedFields . class ) ; NonForwardedFields nonForwardedFields = udfClass . getAnnotation ( NonForwardedFields . class ) ; ReadFields readSet = udfClass . getAnnotation ( ReadFields . class ) ; Set < Annotation > annotations = new HashSet < Annotation > ( ) ; if ( forwardedFields != null ) { annotations . add ( forwardedFields ) ; } if ( nonForwardedFields != null ) { if ( ! annotations . isEmpty ( ) ) { throw new InvalidProgramException ( "Either " + ForwardedFields . class . getSimpleName ( ) + " or " + NonForwardedFields . class . getSimpleName ( ) + " can be annotated to a function, not both." ) ; } annotations . add ( nonForwardedFields ) ; } if ( readSet != null ) { annotations . add ( readSet ) ; } return ! annotations . isEmpty ( ) ? annotations : null ; }
Reads the annotations of a user defined function with one input and returns semantic properties according to the forwarded fields annotated .