Recommend including total_rows value in Java Client ViewResponse class
Sometimes it's useful to know the total_rows value returned from a view query, but the current Java client SDK drops that value.
Looking at the SDK code, it looks pretty simple to get this value and store it as the view data is being parsed. I think it would only require:
1. A new long value in the ViewResponse class, perhaps called totalViewRows.
2. New constructors for ViewResponse, ViewResponseNoDocs, ViewResponseWithDocs, and ViewResponseReduced to include the value of totalViewRows.
3. Update parseResult in NoDocsOperationImpl.java, DocsOperationImpl.java, and ReducedOperationImpl.java to read and save total_rows.
Maybe -1 could be used for an unknown number of rows in the current constructor.
I could try to do this myself, if someone at Couchbase thinks it's worthwhile.
Hello John
It is a valid request and I have created a new enhancement request in the Java SDK client project:
http://www.couchbase.com/issues/browse/JCBC-240
Do not hesitate to contribute to the SDK, it will be great to have this, if you are not familiar yet with the process here how to start:
http://www.couchbase.com/wiki/display/couchbase/Contributing+Changes
Regards
Tug
@tgrall