You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "Jungtaek Lim (JIRA)" <ji...@apache.org> on 2015/09/01 23:41:45 UTC
[jira] [Resolved] (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 ]
Jungtaek Lim resolved STORM-1000.
---------------------------------
Resolution: Fixed
Fix Version/s: 0.11.0
Thanks, [~YvonneIronberg]
I merged into master.
> Use static member classes when permitted
> ----------------------------------------
>
> Key: STORM-1000
> URL: https://issues.apache.org/jira/browse/STORM-1000
> Project: Apache Storm
> Issue Type: Improvement
> 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)