nhachicha/SnappyDB — pull request #23 by SalomonBrys (2014-10-09 18:08:55+00:00)
Title: Count + limit & offset + iterators

Hi,
this pull request adds three features that I need to use SnappyDB in my future app.
My future app will manage chat objects, potentially tens of thousands of them.

### Count
Counting is in fact loading data and counting the number of entries. The problem I have with the `findKeys("prefix").length` is that all keys are loaded into the JVM as managed Strings that I will not use. For small collections, this is not an issue, but for very big collections (as I plan to use SnappyDB for), counting in C++ and not having the JVM manage unused key strings is, I think, important.

Hence, this request adds `countKeys` and `countKeysBetween`.

### Offset & limit
@tieubao asked it in #21. It allows paging (however, iterators are more suited) and allows to access directly a limited view of the key collection.

### Iterators
This is the most important feature. It allows to acces data one by one or by batch and to keep a "pointer" to the position inside the collection so that we can continue browsing later. It is very useful for a huge collection because:

- It allows paging without having to scroll from begining (as offset does).
- It loads values on demand (better than loading tens of thousands strings into the JVM at once).

I have documented and tested these three features.
I have also tried to respect your code style, both in C++ and in Java.

Let me know what you think ;)

Salomon