Skip to content

[FLINK-4257] [gelly] Handle delegating algorithm change of class#2474

Closed
greghogan wants to merge 2 commits into
apache:masterfrom
greghogan:4257_handle_delegating_algorithm_change_of_class
Closed

[FLINK-4257] [gelly] Handle delegating algorithm change of class#2474
greghogan wants to merge 2 commits into
apache:masterfrom
greghogan:4257_handle_delegating_algorithm_change_of_class

Conversation

@greghogan
Copy link
Copy Markdown
Contributor

Replaces Delegate with NoOpOperator.

…e of class

A class created by ProxyFactory can intercept and reinterpret method
calls using its MethodHandler, but is restricted in that

* the type of the proxy class cannot be changed
* method return types must be honored

We have algorithms such as VertexDegree and TriangleListing that change
return type depending on configuration, even between single and dual
input functions. This can be problematic, e.g. in OperatorTranslation
where we test dataSet instanceof SingleInputOperator or dataSet
instanceof TwoInputOperator.

Even simply changing operator can be problematic, e.g.
MapOperator.translateToDataFlow returns MapOperatorBase whereas
ReduceOperator.translateToDataFlow returns SingleInputOperator.

Making changes only within Gelly we can append a "no-op" pass-through
MapFunction to any algorithm output which is not a SingleInputOperator.
And Delegate can also walk the superclass hierarchy such we are always
proxying SingleInputOperator.

There is one additional issue. When we call DataSet.output the
delegate's MethodHandler must reinterpret this call to add itself to the
list of sinks.
@asfgit asfgit closed this in 8210ff4 Sep 8, 2016
chobeat pushed a commit to radicalbit/flink that referenced this pull request Sep 9, 2016
chobeat pushed a commit to radicalbit/flink that referenced this pull request Sep 9, 2016
haoch pushed a commit to haoch/flink that referenced this pull request Sep 10, 2016
liuyuzhong pushed a commit to liuyuzhong/flink that referenced this pull request Dec 5, 2016
Replaces Delegate with NoOpOperator.

This closes apache#2474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants