Hi all,

So, I am currently fighting with something in IoTDB. It’s the usage of static 
variables all over the place.

The problem I’m having, is that I’m working on building an App that allows to 
run IoTDB in various forms of deployment. So, depending on the type of 
deployment, you can switch the location of where data is stored.

So, in my case I’ve started IoTDB, and it stores data in a directory “data-1” … 
so if I want to change this to “data-2” I need to stop IoTDB data-node and 
config-node, change the configuration and start config-node and data-node again.

However, we are using singletons everywhere … the problem now is that these 
don’t get re-initialized and they keep on pointing to “data-1”. Right now, I’m 
preparing a PR, where I can manually trigger a re-initialization of these 
singletons, by adding a static “reinitializeStatics()” method to them. But 
that’s just a super-ugly hack.

The much better solution would be to not need statics, but to either manually 
weave the components together or to use a component framework to do the weaving.

The benefit would also definitely be, that we could start running tests without 
forking processes and we could probably even re-use VMs over tests.

What do you folks think?

Chris

Reply via email to