Java client include docs option


#1

Hi,
I am using java client library 2.0.1 and the thing I am trying to achieve is to load the whole document based on ViewRow. it seems that ViewQuery class doesn’t contain include_docs option, so each call to document() on ViewRow results in addtional call to couchbase.
Are you planing to add include_docs option in the nearest future?


#2

Hi,

the “include docs” option has been replaced with document() since in an asynchronous context it’s pretty much the same and more flexible (for example you can choose to only load specific documents depending on the key emitted). But you are right that in a blocking context, some people can benefit from bringing it back. Do you want to file an enhancement request to the JCBC bug tracker?

http://www.couchbase.com/issues/browse/JCBC

In the meantime, you can use the async ops to get maximum performance.


#3

Thank you for your reply!
I have one more question - how can I configure viewWorkerSize and ViewConnsPerNode parameters with the new client? (it was done with CouchbaseConnectionFactoryBuilder in the old one)


#4

Hi @acubenchik,

it actually got easier now. In the new SDK, we are using a common IO layer for all operations so you can tune there. This is how you can tune the number of sockets to open per node to views and also how to tune the global IO pool size (which I recommend keeping at the default to start with and only increase the number of view sockets):

    CoreEnvironment environment = DefaultCoreEnvironment
        .builder()
        .ioPoolSize(/*global IO thread pool size*/)
        .viewEndpoints(/*number of view sockets to open per node*/)
        .build();

    Cluster cluster = CouchbaseCluster.create(environment)