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

Blake Eggleston commented on CASSANDRA-7840:
--------------------------------------------

I'll revert the system keyspace CFMetaData location, and fix these other issues 
as well. Should I just add additional commits to my branch, or make the changes 
and rebase so there are small(er) patches, each with a specific change? Let me 
know what's most convenient for you.

About the factories/managers. The classes with managers split out all have some 
variables shared between them. ColumnFamilyStore instances share a group of 
executors between them which currently lives on ColumnFamilyStoreManager. 
Keyspace had a boolean initialized field, which is now on KeyspaceManager. 
CFMetaDataFactory and KSMetaDataFactory don't have any shared state now, but 
once the system keyspace CFMetaData and KSMetaData is moved off of 
SystemKeyspace, they'll need to live somewhere. I was thinking 
CFMetaDataFactory and KSMetaDataFactory would be the best place. The classes 
with manager/factory classes have a lot of dependencies. For example, 
ColumnFamilyStore depends on CacheService, CommitLog, CompactionManager, 
DatabaseDescriptor, SSTableReaderFactory, Schema, StorageService, 
SystemKeyspace, and Tracing. If we don't have a factory singleton, we're going 
to have to pass all those into the helper methods anywhere a column family 
store is instantiated. Having all that stuff live in a ColumnFamilyStoreManager 
instance we pass around just makes things a bit more readable.

Let me know what you think.

> 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
>              Labels: patch
>         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
(v6.3.4#6332)

Reply via email to