Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple sharding capabilities for JDBC driver #29

Merged

Conversation

kibab
Copy link

@kibab kibab commented Apr 24, 2011

This patch adds simple sharding to JDBC driver. After applying this patch is becomes possible to specify several database server URLs:
db.url=jdbc:mysql://192.168.0.101:3306/ycsb,jdbc:mysql://192.168.0.102:3306/ycsb,jdbc:mysql://192.168.0.103:3306/ycsb

Data is sharded using very simple algorithm: shardIndex = Key.hashcode() % shardsNumber. However on large data sets it gives fairly equal distribution across several sharding nodes.

Tested using 3 MySQL instances.

@joaquincasares
Copy link
Contributor

Great code!

I'm using it now on my branch. I did however notice that JdbcDBCreateTable.java wasn't touched and that line 73 uses KEY instead of PRIMARY_KEY. This message is more of a placeholder for a future task. It work great right now as is.

ghost pushed a commit that referenced this pull request Sep 10, 2011
…25675

Add simple sharding capabilities for JDBC driver
@ghost ghost merged commit 6afa743 into brianfrankcooper:master Sep 10, 2011
ghost pushed a commit that referenced this pull request Sep 10, 2011
@ghost
Copy link

ghost commented Sep 10, 2011

Hi Ilya,

I just merged your patch to the master branch. This is a really good feature to have.

Thanks!
--Michi

jaricftw pushed a commit to jaricftw/YCSB that referenced this pull request Jul 19, 2016
…4f5a5b6a6d9115cc25675

Add simple sharding capabilities for JDBC driver
jaricftw pushed a commit to jaricftw/YCSB that referenced this pull request Jul 19, 2016
jaricftw pushed a commit to jaricftw/YCSB that referenced this pull request Jul 19, 2016
…4f5a5b6a6d9115cc25675

Add simple sharding capabilities for JDBC driver
jaricftw pushed a commit to jaricftw/YCSB that referenced this pull request Jul 19, 2016
hse-root pushed a commit to hse-project/hse-ycsb that referenced this pull request Aug 21, 2020
…age-lrc-1.8 to v0.17.0.2.1-lrc-hse-1.8.0

* commit '235251333f711c31cd07e9346b24f19c7747be6a':
  Merge pull request brianfrankcooper#28 in HSE/hse-ycsb from make-package-lrc to v0.17.0-lrc-hse
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants