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

ASF GitHub Bot commented on CASSANDRA-7840:
-------------------------------------------

Github user michaelsembwever commented on the pull request:

    
https://github.com/apache/cassandra/commit/ba09523de7cad3b3732c0e7e60b072f84e809e21#commitcomment-28024074
  
    In src/java/org/apache/cassandra/dht/BootstrapEvent.java:
    In src/java/org/apache/cassandra/dht/BootstrapEvent.java on line 62:
    > My bet would be that people would add Events member instances as statics 
again, to save some garbage and because they are stateless anyways.
    
    Yes, and this would definitely make sense for classes that were 
instantiated frequently. 
    That is, the following isn't wrong…
    ```
    public class BootStrapper extends ProgressEventNotifierSupport
    {
        …
        private static final BoostrapEvents bootstrapEvents = BootstrapEvents();
    …
                bootstrapEvents.useSpecifiedTokens(…);
    ```
    
    But separating the static methods in Event classes out to non-static 
methods in Events classes still provides us improved testability. Which is my 
understanding to the reasoning behind CASSANDRA-7840.


> Refactor static state & functions into static singletons
> --------------------------------------------------------
>
>                 Key: CASSANDRA-7840
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7840
>             Project: Cassandra
>          Issue Type: Sub-task
>            Reporter: Blake Eggleston
>            Assignee: Blake Eggleston
>            Priority: Major
>             Fix For: 3.11.x
>
>         Attachments: 
> 0001-splitting-StorageService-executors-into-a-separate-c.patch, 
> 0002-making-DatabaseDescriptor-a-singleton.patch, 
> 0003-refactoring-StorageService-static-methods.patch, 
> 0004-making-StorageProxy-a-singleton.patch, 
> 0005-making-MigrationManager-a-singleton.patch, 
> 0006-making-SystemKeyspace-a-singleton.patch, 
> 0007-making-Auth-a-singleton.patch, 
> 0008-removing-static-methods-and-initialization-from-Comp.patch, 
> 0009-making-SinkManager-a-singleton.patch, 
> 0010-making-DefsTables-a-singleton.patch, 
> 0011-making-StageManager-a-singleton.patch, 
> 0012-making-MessagingService-a-singleton.patch, 
> 0013-making-QueryProcessor-a-singleton.patch, 
> 0014-refactoring-static-methods-on-Tracing.patch, 
> 0015-removing-static-state-from-BatchlogManager.patch, 
> 0016-removing-static-method-from-CommitLog.patch, 
> 0017-OutboundTcpConnection-removing-singleton-access-from.patch, 
> 0018-FBUtilities-removing-getLocalAddress-getBroadcastAdd.patch, 
> 0019-PendingRangeCalculatorService-removing-singleton-acc.patch, 
> 0020-ActiveRepairService-removing-static-members-and-meth.patch, 
> 0021-RowDataResolver-removing-static-singleton-access-fro.patch, 
> 0022-AbstractReadExecutor-removing-static-method.patch, 
> 0023-StorageServiceAccessor-removing-static-singleton-acc.patch, 
> 0024-FileUtils-removing-static-singleton-accesses-from-st.patch, 
> 0025-ResourceWatcher-removing-static-singleton-access-fro.patch, 
> 0026-TokenMetadata-removing-static-singleton-access-from-.patch, 
> 0027-OutboundTcpConnectionPool-removing-static-singleton-.patch, 
> 0028-Cassandra-PasswordAuthenticator-making-static-method.patch, 
> 0029-CompactionMetrics-making-static-method-instance-meth.patch, 
> 0030-ClientState-splitting-configured-QueryHandler-instan.patch, 
> 0031-SSTableReader-splitting-static-factory-methods-into-.patch, 
> 0032-Keyspace-splitting-static-factory-methods-and-state-.patch, 
> 0033-ColumnFamilyStore-splitting-static-factory-methods-a.patch, 
> 0034-TriggerDefinition-removing-static-singleton-access-f.patch, 
> 0035-CFMetaData-splitting-off-static-factory-methods-onto.patch, 
> 0036-KSMetaData-splitting-off-static-factory-methods-onto.patch, 
> 0037-SystemKeyspace-moving-system-keyspace-definitions-on.patch, 
> 0038-UTMetaData-refactoring-static-singleton-accesses-for.patch, 
> 0039-CounterId-removing-static-singleton-accesses-from-st.patch, 
> 0040-AtomicBtreeColumns-replacing-SystemKeyspace-CFMetaDa.patch
>
>
> 1st step of CASSANDRA-7837.
> Things like DatabaseDescriptor.getPartitioner() should become 
> DatabaseDescriptor.instance.getPartitioner(). In cases where there is a mix 
> of instance state and static functionality (Keyspace & ColumnFamilyStore 
> classes), the static portion should be split off into singleton factory 
> classes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to