Hi,Chris

Maybe we could combine these metric singletons into a larger Metric singleton 
and assign different constructors to it, which would seem to reduce the number 
of singletons by a lot.

We can also take some stateless singletons and see if we can abstract them into 
static functions or something, and then we can see how to merge them next

Best
--------------------
Xinyu Tan

On 2024/08/20 16:30:26 Christofer Dutz wrote:
> Hi all,
> 
> So, in order to sensibly tackle the removal of singletons I have compiled a 
> list of all Singletons (at least all classes that have a public static 
> getInstance() method).
> I so-far count 94 classes.
> 
> In a next step I would try to add which type depends on which singleton to 
> that. The result should be a directed graph, that shows segments that could 
> be sensibly refactored.
> 
> I would propose to do “island” by “island”.
> 
> I guess it’s going to be an interesting process … idealy we could use some 
> tool to analyse the graph.
> 
> 
> Chris
> 
> 
> PS: Here’s the list of the singleton classes:
> 
> SystemPropertiesHandler
> SSLClient
> AsyncConfigNodeHeartbeatClientPool
> AsyncDataNodeHeartbeatClientPool
> CnToCnInternalServiceAsyncRequestManager
> CnToDnInternalServiceAsyncRequestManager
> SyncConfigNodeClientPool
> SyncDataNodeClientPool
> ConfigNodeDescriptor
> ConfigNodeRemoveCheck
> SystemPropertiesHandler
> PipeConfigNodeSubtaskExecutor
> PipeConfigNodeListenerMetrics
> PipeConfigNodeReceiverMetrics
> PipeConfigNodeRemainingTimeMetrics
> PipeConfigRegionConnectorMetrics
> PipeConfigRegionExtractorMetrics
> PipeProcedureMetrics
> PipeTemporaryMetaMetrics
> ConfigMNodeFactory
> ProcedureFactory
> ConfigNode
> IoTDBDescriptor
> IoTDBStartCheck
> IoTDBRestServiceDescriptor
> DataRegionConsensusImpl
> SchemaRegionConsensusImpl
> PipeSubtaskExecutorManager
> PipeInsertionDataNodeListener
> PipeTimePartitionListener
> PipeAssignerMetrics
> PipeDataNodeMetrics
> PipeDataNodeReceiverMetrics
> PipeDataNodeRemainingEventAndTimeMetrics
> PipeDataRegionConnectorMetrics
> PipeDataRegionExtractorMetrics
> PipeHeartbeatEventMetrics
> PipeProcessorMetrics
> PipeResourceMetrics
> PipeSchemaRegionConnectorMetrics
> PipeSchemaRegionExtractorMetrics
> PipeSchemaRegionListenerMetrics
> PipeWALInsertNodeCacheMetrics
> PipeCombineHandlerManager
> ConfigNodeClientManager
> ConfigNodeInfo
> DnToCnInternalServiceAsyncRequestManager
> DataNodeExternalServiceAsyncRequestManager
> DataNodeMPPServiceAsyncRequestManager
> DnToDnInternalServiceAsyncRequestManager
> UserCache
> SessionManager
> DataNodeRegionManager
> MPPDataExchangeService
> DriverScheduler
> LoadTsFileMemoryManager
> DataNodeTTLCache
> SchemaEngine
> DataNodeTableCache
> ClusterTemplateManager
> DataNode
> DataNodeInternalRPCService
> MQTTService
> RPCService
> RegionMigrateService
> RestService
> TemporaryQueryDataFileService
> CompactionMetrics
> FileMetrics
> WritingMetrics
> CacheHitRatioMonitor
> CompactionScheduleTaskManager
> CompactionTaskManager
> FlushManager
> WALManager
> TierManager
> TsFileAndModSettleTool
> TriggerClassLoaderManager
> TriggerManagementService
> OpenFileNumUtil
> ModsSerializer
> StringSerializer
> WindowEvaluationTaskPoolManager
> IoTDBMetricManager
> IoTDBJmxReporter
> IoTDBMetricObjNameFactory
> MetricConfigDescriptor
> SystemMetrics
> PipeConfig
> MetricService
> TriggerExecutableManager
> UDFClassLoaderManager
> UDFExecutableManager
> UDFManagementService
> 

Reply via email to