You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Zili Chen (Jira)" <ji...@apache.org> on 2020/03/09 09:34:00 UTC

[jira] [Commented] (FLINK-16503) Don't assign ScheduledExecutorService into variables of ExecutorService or Executor types

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

Zili Chen commented on FLINK-16503:
-----------------------------------

[~leventov] Thanks for reporting this. May I ask what is the problem if we assign ScheduledExecutorService into variables of ExecutorService or Executor types? Where is the source of the statement "there is an unnecessary efficiency cost", and is there a general solution?

> Don't assign ScheduledExecutorService into variables of ExecutorService or Executor types
> -----------------------------------------------------------------------------------------
>
>                 Key: FLINK-16503
>                 URL: https://issues.apache.org/jira/browse/FLINK-16503
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Roman Leventov
>            Priority: Minor
>
> There is an unnecessary efficiency cost to assigning ScheduledExecutorService (typically, ScheduledThreadPoolExecutor) into variables of ExecutorService or Executor types.
> Currently, there is one such occurrence in production code, in TaskManagerRunner, and three more in tests.
> They could be found using IntelliJ's Structural search pattern (and Structural Search inspection):
> {{$x$ = $y$;}}
> Where the Type of {{$x$}} is set to {{ExecutorService|Executor}} ("within type hierarchy" checkbox is off), and the Type of {{$y$}} is set to {{ScheduledThreadPoolExecutor|ForkJoinPool}} ("within type hierarchy" checkbox is on).
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)