bitly/simplehttp — pull request #30 by jehiah (2012-02-05 19:56:35+00:00)
Title: Simpleleveldb /dump_csv endpoint

This is an endpoint that will iterate over an entire DB and stream it out to a http endpoint

This is essentially /fwmatch in some of the other simple*db instances, and /dump in simplememdb

current limitations:

* it dumps data at a max rate of 500 records every .1 second (Based on a timer)
* it doesn't care how much data is pooled up in the socket/buffered event (essentially this is unbounded)
* it doesn't have any options to dump out to the local filesystem

That said, It's good enough that you can dump a subset of the dataset out to csv by `curl http://localhost:8080/dump_csv?key=prefix_string' > data.csv`

Internally this uses a leveldb snapshot to give a consistent view of the database even while other requests write data into the db.

cc: @mreiferson