[ https://issues.apache.org/jira/browse/STORM-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yvonne Ironberg updated STORM-1000: ----------------------------------- Description: 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. was: 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. > 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 > 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)