Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Add 'hostPoolSize' option to ConnectionPool #70

Merged
merged 4 commits into from
Sep 27, 2012
Merged

Add 'hostPoolSize' option to ConnectionPool #70

merged 4 commits into from
Sep 27, 2012

Conversation

hpainter
Copy link
Contributor

Small modification that allows the number connections per cluster host to be increased. Similar to the node-postgres module, which uses a pool of 10 'parallel' connections to the db, bumpng this number up increased the throughput of our app which was making a lot of asynchronous read requests to the cassandra db.

Allows the number of connections per host to be modified.  Defaults
to 1 if not specified.
@devdazed
Copy link
Contributor

Awesome, commit. I've been meaning to do this [ ref #21 ]. The only thing I ask before I pull is that a test get written for it. I want to ensure we don't break existing functionality.

Fixes a bug where doing the counter initialization up top prevented
connections to hosts after the first one.
@hpainter
Copy link
Contributor Author

I'll see if I can get some test coverage for this. I noticed that if I set multiple hosts in tests/helpers/connection.js it causes some tests to fail, and I suspect I can get a fix for that in with this as well.

Justin Painter added 2 commits September 18, 2012 13:05
In ConnectionPool.connect(), if the callback gets fired after making the
first successfull connection then subsequent ConnectionPool.use() calls may
not set the keyspace on the entire set of connections.  This moves the
callback to happen after the final connection is set.
Re-runs the existing thrift.js test suite, but sets the
hostPoolSize option before starting.
@hpainter
Copy link
Contributor Author

OK, tests are ready and passing. The current suite of thrift.js tests just get imported and re-run with the hostPoolSize option set. Let me know if you see any issues...

devdazed added a commit that referenced this pull request Sep 27, 2012
Add 'hostPoolSize' option to ConnectionPool
@devdazed devdazed merged commit 6975cd0 into simplereach:master Sep 27, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants