storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dima Dragan <dima.dra...@belleron.net>
Subject Re: write data to file then bulk copy to database
Date Fri, 05 Dec 2014 22:35:00 GMT
Hi,

I think better approach is creating static class with thread-safe singleton
initialization of connection pool (for example, I use HikariCP for SQL db
and JedisPool for Redis) and provide public access for getting connection
from it to bolt. Init pool in prepare method, take connection,execute smth,
give it back in execute method.

So every worker will get it's own pool which is shared between bolts.

Best regards,
Dmytro Dragan
On Dec 5, 2014 11:57 PM, "Sa Li" <sa.in.vanc@gmail.com> wrote:

> Hi, all
>
> Right now I am able to write tuples into a file, and use copy command to
> load into database, but this is obviously not a perfect solution, increase
> complexity and overheads. Any idea to make it simpler?
>
>
> thanks
>
>
> Alec
>

Mime
View raw message