If you really want to do this you should be able to do this is the open method 
of your spout or in the prepare method of the bolt.  They execute on the same 
thread so from that you should be able to do what you need to do.
As for the clojure in executor.clj we use the async-loop macro for creating the 
task threads.  

https://github.com/apache/storm/blob/v1.0.2/storm-core/src/clj/org/apache/storm/util.clj#L472-L514

and on line 479 you can see the clojure equivalent of `new Thread(...)`  
`(Thread. ...)` - Bobby 

    On Tuesday, June 21, 2016 9:09 AM, #ZHANG SHUHAO# <[email protected]> 
wrote:
 

 Hi all,

I want to manage the binding of Storm executor thread (NOT worker process) to 
CPU cores (NOT host nodes).
I assume if I would know how the executor thread are initiated, I can manage 
the binding of it by relying on things like JNI.
I have tried my best to look into the related source code of Storm.
Unfortunately, I am very new to Clojure, and I don't get how the executor 
thread are initiated, in particular, I'm looking for  something like "Thread 
thread = new Thread(obj);", which is one of the most common way of creating 
threads in Java.

Any helps are appreciated. Thank you!

Best regards.
Shuhao Zhang (Tony)
+65-86166722


  

Reply via email to