I guess a possible way to do this would be to implement ITaskHook and register the class using the topology.auto.task.hooks config. However, this interface doesn't provide a hook for the open method present in Spout objects, so it wouldn't really work. So two questions: Why doesn't ITaskHook provide a method for open()? And are there any other ways to initialize various services/threads/singletons before spout/bolt deserialization?

From: user@storm.apache.org At: 01/18/18 15:51:50
To: user@storm.apache.org
Subject: Initialization in Storm before Deserialization
Does Storm provide any mechanism to initialize services or threads before any Bolts and Spouts are deserialized in Cluster Mode? Or is the only mechanism to do this from within open()/prepare()?