You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Shubin Ruan (Jira)" <ji...@apache.org> on 2022/04/02 08:36:00 UTC
[jira] [Created] (FLINK-27007) Should the MailboxDefaultAction interface be annotated with @FunctionalInterface?
Shubin Ruan created FLINK-27007:
-----------------------------------
Summary: Should the MailboxDefaultAction interface be annotated with @FunctionalInterface?
Key: FLINK-27007
URL: https://issues.apache.org/jira/browse/FLINK-27007
Project: Flink
Issue Type: Improvement
Components: Runtime / Task
Reporter: Shubin Ruan
When StreamTask initializes mailboxProcessor, it passes in the MailboxDefaultAction parameter through \{this::processInput}.
{code:java}
this.mailboxProcessor =
new MailboxProcessor(
this::processInput, mailbox, actionExecutor, numMailsProcessedCounter);{code}
Since the parameter can be passed by Lambda expression, it means that MailboxDefaultAction is a functional interface, that is, there is only one unimplemented method. To increase code readability, should the MailboxDefaultAction interface be annotated with @FunctionalInterface? should the MailboxDefaultAction interface be annotated with @FunctionalInterface?
{code:java}
@Internal
@FunctionalInterface
public interface MailboxDefaultAction {
...
} {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)