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)

Reply via email to