Hi John.

But that should be done at build time, right?

The thing is that I have already packed the fat jar and there is this
class that submit the topology, in this class I read from somewhere the
source code of the class and compile at runtime, but then when the bolt
try to deseralize the object it throw the class not found error.

On 03/10/2016 12:52 AM, John Fang wrote:
> You can put the needed compiled classes in the directory: your topology's 
> src/main/resources, then you package your topology with resources. If you 
> submit the topology, storm will extract the needed the compiled classes to a 
> directory which is in the worker's scope. So the spout/bolt can find the 
> classes.
> 
> Regards
>        John Fang
> 
> 
> -----邮件原件-----
> 发件人: "Carlos Chávez" [mailto:ccha...@agssa.net] 
> 发送时间: 2016年3月10日 11:29
> 收件人: user@storm.apache.org
> 主题: Dynamic compiled object/classes and topology
> 
> Hi All.
> 
> I have some bolt that compile some classes from a string, my classes are in 
> Scala and I use ToolBox to compile. The compile is done in the prepare method 
> and that work fine. Then in the execute method I'm able to call the methods 
> from this classes.
> 
> The thing is that compile the classes take some time mostly because there are 
> many thread compiling the same set of classes. I was trying to reduce the 
> time compiling of classes before summit the topology, I was able to pass the 
> compiled objects to the bolt and when the bolt deserialize the object it 
> throw the class not found error.
> 
> I suspect that when I submit the topology the compiled classes are not in 
> scope, not sure if the class loader when submit the topology is reset or 
> something.
> 
> So, is there a way to add this dynamic compiled object/classes to the 
> topology at runtime?
> 
> ----
> Cheers.
> Carlos Chávez.
> 


-- 
Saludos.
Carlos Chávez.
AG Software, S.A.

Reply via email to