You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "Rick Kellogg (JIRA)" <ji...@apache.org> on 2015/09/30 03:04:04 UTC

[jira] [Updated] (STORM-1000) Use static member classes when permitted

     [ https://issues.apache.org/jira/browse/STORM-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Kellogg updated STORM-1000:
--------------------------------
    Component/s: storm-core

> Use static member classes when permitted
> ----------------------------------------
>
>                 Key: STORM-1000
>                 URL: https://issues.apache.org/jira/browse/STORM-1000
>             Project: Apache Storm
>          Issue Type: Improvement
>          Components: storm-core
>            Reporter: Yvonne Ironberg
>            Assignee: Yvonne Ironberg
>            Priority: Minor
>             Fix For: 0.11.0
>
>         Attachments: STORM-1000.patch
>
>
> In Java, the difference between “static member class” and “nonstatic member class” is simply a reference to  its enclosing instance. “Static” here means “independent of the enclosing instance”. Or “an enclosed instance can survive without an enclosing instance”.
> * For an instance of a nonstatic member class, there is a reference from the enclosed instance to the enclosing instance. When the enclosing instance doesn’t exist, you cannot instantiate the nonstatic member class.
> * For an instance of a static member class, there isn’t such a reference from the enclosed instance to the enclosing instance. So this helps the enclosing instance be garbage-collected.
> Favoring static member classes when permitted improves performance because time and space for extra references are saved.
> This optimization was done before for Storm (e.g., as part of STORM-797), see [its patch|https://patch-diff.githubusercontent.com/raw/apache/storm/pull/537.patch].
> This issue tries to improve all such places in the current codebase. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)