kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ismael Juma (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (KAFKA-6018) Make from KafkaFuture.Function java 8 lambda compatible
Date Fri, 06 Oct 2017 09:55:00 GMT

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

Ismael Juma edited comment on KAFKA-6018 at 10/6/17 9:54 AM:
-------------------------------------------------------------

Lambdas can be used with abstract classes if they have a single abstract method (which is
the case for KafkaFuture.Function). Are you saying that this doesn't work?


was (Author: ijuma):
Lambdas can be used with abstract classes if they have a single abstract method (which is
the case for KafkaFuture.Function. Are you saying that this doesn't work?

> Make from KafkaFuture.Function java 8 lambda compatible
> -------------------------------------------------------
>
>                 Key: KAFKA-6018
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6018
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>            Reporter: Steven Aerts
>
> KafkaFuture.Function is currently an empty public abstract class.
> This means you cannot implement them as a java lambda.  And you end up with constructs
as:
> {code:java}
> new KafkaFuture.Function<Set<String>, Object>() {
>     @Override
>     public Object apply(Set<String> strings) {
>         return foo;
>     }
> }
> {code}
> I propose to define them as interfaces.
> So this code can become in java 8:
> {code:java}
> strings -> foo
> {code}
> I know this change is backwards incompatible (extends becomes implements).
> But as {{KafkaFuture}} is marked as {{@InterfaceStability.Evolving}}.
> And KafkaFuture states in its javadoc:
> {quote}This will eventually become a thin shim on top of Java 8's CompletableFuture.{quote}
> I think this change might be worth considering.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message