I am using cassandra datastax driver v3.7.2 with java8. In documentation it is mentioned
"You don’t need to manage connections yourself. You simply interact with a Session object, which takes care of it."
If want to create a connection pool of cassandra connection how to do it ? Are there any build in functions/mechanism to support the same ? If so are there any samples available for the same?
You just need to create one Session
object per your application, and then driver will do all necessary pooling for you. Cassandra protocol allows to execute multiple queries over the one connection, and everything just work out of box - you can execute queries from multiple threads using the same Session
object. If necessary (but you need to have a good reason for it), you can increase number of connections from driver to every host in cluster, but in the big cluster this may lead to increased resource consumption.
The complete description on how the pooling is implemented is in the driver's documentation.