stratosphere / stratosphere

Stratosphere is now Apache Flink.
https://github.com/apache/incubator-flink
Apache License 2.0
197 stars 84 forks source link

Exemplary implementation of map function with Java 8 Lambdas. #895

Closed twalthr closed 10 years ago

twalthr commented 10 years ago

This PR shows how we could implement Java 8 Lambdas into the current master without changing much code. I implemented a Lambda Mapper. An example job shows that it is working.

See also #612.

aljoscha commented 10 years ago

Very nice. It might not be pretty, but I think it's the only way to get the lambda function types. I don't like the Wrapper, I see that it was the easiest way to do it here but for a release we can easily get rid of that.

Also, this will fail right now when you pass in an object (anonymous inner class) that directly derives from GenericMap, here we cannot use the lambda resolution logic but the old logic with getGenericInterfaces().

twalthr commented 10 years ago

Yes, you are right. I have prepared the new getMapReturnTypes() method. We then need to rework getParameterType() as it does not support interfaces as "base class". After the rework is done we can get rid of getMapReturnTypes(MapFunction<IN, OUT> mapFunction, TypeInformation<IN> inType).

uce commented 10 years ago

I'm closing this PR for now as I think it was just to gather some feedback. I've linked this PR in FLINK-701.