cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Katkov <ikat...@gmail.com>
Subject Re: Connection Pooling
Date Mon, 05 Oct 2009 15:57:37 GMT
As Jonathan Ellis points out one might use common-pool

If you also use Spring it makes it very easy to configure, so there are no
need to code it yourself.
Here is an example

    <bean id="cassandraClient"
class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="targetSource" ref="poolCassandraClient"/>
    </bean>

    <bean id="poolCassandraClient"
class="org.springframework.aop.target.CommonsPoolTargetSource">
        <property name="targetBeanName" value="cassandraClientTarget"/>
        <property name="maxSize" value="50"/>
    </bean>

Where "cassandraClientTarget" is bean id of your Cassandra client class, the
one you'd like to pool.

P.S. You need to have commons-pool.jar and spring.jar (or equivalents) in
your classpath


On Sat, Oct 3, 2009 at 4:34 PM, Mark McBride <mark.mcbride@gmail.com> wrote:

> If you're looking for a concrete example, you can probably
> transliterate the Scala example in Cassidy
> (http://github.com/viktorklang/Cassidy), which uses commons pooling.
> Or you could use Cassidy and get pooling for free.
>
>   ---Mark
>
> On Sat, Oct 3, 2009 at 6:31 AM, Jonathan Ellis <jbellis@gmail.com> wrote:
> > It would be pretty easy to create one with
> > http://commons.apache.org/pool/.  If your number of ops-per-connection
> > is already high then pooling is a lower priority.
> >
> > On Sat, Oct 3, 2009 at 5:46 AM, Johannes Schaback
> > <johannes.schaback@visual-meta.com> wrote:
> >> Hi!
> >>
> >> Just a quick question out of curiosity; is it necessary/sesnsible to
> >> use a connection pool if a larger number of clients want to connect to
> >> the same node? If yes, does Cassandra/thrift maybe already have a
> >> connection pool that I am unaware of?
> >>
> >> I found lazyboys Python Wrapper for Cassandra which includes a
> >> connection pool, but I am wondering if there exists something similar
> >> for the Java world.
> >>
> >> Thanks,
> >>
> >> Johannes
> >>
> >
>

Mime
View raw message