beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kenneth Knowles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-40) Replace rawtype lambda-incompatible uses of SerializableFunction with SimpleFunction (as appropriate)
Date Tue, 02 May 2017 20:32:04 GMT

    [ https://issues.apache.org/jira/browse/BEAM-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15993680#comment-15993680
] 

Kenneth Knowles commented on BEAM-40:
-------------------------------------

I've flipped through the SDK a bit and haven't found anything I care to adjust right now.
Details:

In MapElements and FlatMapElements we were careful to devise a builder scheme so that users
could not accidentally get bitten by rawtypes. In other places like Distinct, it seems the
approach is to let them get bitten but give them methods to improve the behavior. Since the
latter can be done without breaking superficial backwards compatibility, users will not be
stuck if a problem comes up later.

> Replace rawtype lambda-incompatible uses of SerializableFunction with SimpleFunction
(as appropriate)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-40
>                 URL: https://issues.apache.org/jira/browse/BEAM-40
>             Project: Beam
>          Issue Type: Task
>          Components: sdk-java-core
>            Reporter: Kenneth Knowles
>            Assignee: Kenneth Knowles
>            Priority: Minor
>              Labels: Java8, backward-incompatible
>             Fix For: Not applicable
>
>
> When a lambda or method reference is used in Java 8 to provide a SerializableFunction<InputT,
OutputT>, it is instantiated at the raw type SerializableFunction. We occasionally require
reflective access to the actual parameter for OutputT, but it will be unavailable.
> MapElements and FlatMapElements thus use the analogous abstract class SimpleFunction
in such situations to prevent use of a lambda or method reference. They then support lambda
via separate constructors that require user help to determine the concrete output type.
> This ticket calls for an audit of such situations.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message