OpenTSDB/asynchbase — pull request #59 by lzheng (2013-05-23 00:49:26+00:00)
Title: Add KeyValue callback handlers for get and scan.

@tsuna @canoeberry @jasonculverhouse
This is a merge back of what Jonathan created at: https://github.com/Flipboard/asynchbase/commit/ef2c07bc57cef0efacb7c7d4c8f2704a0c8fca45
I did several touch-ups to make sure the change can be integrated back to OpenTSDB/asynchbase.

The change will enable callers for scanner and get to specify a callback handler to process KeyValue as they are coming. Thus caller can decide if the value should be saved or discarded. It is a great way to save some memories and avoid too much GCs.

I still have a couple of questions:
1. Is there a way to stop/cancel the get/scan when the Callback returns false? E.g.: if the caller of get/scanner decides he gets enough data already, he could cancel the request thus avoid unnecessary traffics.
2. In this implementation, when the callback is not null, we return an deferred empty array list. We could also return deferred long or list of longs. However, I found it is not very straight forward to do so. Please let me know if you have got suggestions.