Tuesday, July 14, 2009

Drizzle JDBC 0.4 - Rewrite batch handler

I just pushed up Drizzle JDBC 0.4, which, most importantly, contains a rewrite batch handler (I guess much like the one Mark Matthews announced for Connector/J a couple of months ago). It gives the expected 10x+ batch insert improvements, on my laptop I can insert 1M "simple" rows in under 20 seconds.

It is written as a plugin, so you need to do this to your Connection to enable it:
if(connection.isWrapperFor(DrizzleConnection.class)) {
DrizzleConnection dc = connection.unwrap(DrizzleConnection.class);
dc.setBatchQueryHandlerFactory(new RewriteParameterizedBatchHandlerFactory());

(Yes, it will be possible to configure plugins via the connection string and by setting properties). Please, try it out and report any bugs you find!

I also wrote a Scala version of the plugin, it is not bundled with the 0.4 release though - if you are interrested, it is on Launchpad. Scala is awesome, hoping to do some more Scala development in the near future.

This is the changelog for 0.4:
  • Findbug fixes
  • Internal refactorings
  • Make sure all tests pass against both MySQL and Drizzle
  • Batch handler API cleanups, details here.
  • Fix read of 16bit word (by Trond Norbye)
  • A query rewrite batch handler

Download 0.4 here.

No comments: