[
https://issues.apache.org/jira/browse/FLINK-3118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041745#comment-15041745
]
Martin Junghanns commented on FLINK-3118:
-----------------------------------------
I am not so familiar with the type extraction mechanisms, yet. My suggestion
would be sth like
{code}
@SuppressWarnings("unchecked")
public static <IN1, IN2, OUT> TypeInformation<OUT> createTypeInfo(Class<?>
baseClass, Class<?> clazz, int returnParamPos, TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type, Object instance) {
if (instance != null && instance instanceof ResultTypeQueryable) {
return ((ResultTypeQueryable<OUT>) instance).getProducedType();
} else {
return createTypeInfo(baseClass, clazz, returnParamPos, in1Type,
in2Type);
}
}
{code}
which would be called (e.g. from {{VertexCentricIteration}}) like so
{code}
private TypeInformation<Message> getMessageType(MessagingFunction<K, VV,
Message, EV> mf) {
return TypeExtractor.createTypeInfo(MessagingFunction.class, mf.getClass(),
2, null, null, mf);
}
{code}
> Check if MessageFunction implements ResultTypeQueryable
> -------------------------------------------------------
>
> Key: FLINK-3118
> URL: https://issues.apache.org/jira/browse/FLINK-3118
> Project: Flink
> Issue Type: Bug
> Components: Gelly
> Reporter: Martin Junghanns
> Assignee: Martin Junghanns
>
> To generalize message values in vertex centric computations, it is necessary
> to let the user define the {{TypeInformation}} via {{ResultTypeQueryable}}.
> This needs to be checked in {{VertexCentricIteration}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)