Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Couchbase 2 - View on non JSON docs

6 replies [Last post]
  • Login or register to post comments
Thu, 09/27/2012 - 00:10
cb
Offline
Joined: 08/10/2012
Groups: None

Using the java client API :

I'm trying to query a view which contains non JSON docs (binary serialized Java Objects)

When executing the query (using the Java Client API - latest release) I'm getting the following exception:

Exception in thread "main" java.lang.ClassCastException: [my class name removed] cannot be cast to java.lang.String
at com.couchbase.client.protocol.views.ViewRowWithDocs.(ViewRowWithDocs.java:39)
at com.couchbase.client.internal.ViewFuture.get(ViewFuture.java:97)
at com.couchbase.client.internal.ViewFuture.get(ViewFuture.java:48)
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:65)
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:584)

My Query instance is set to fetch the docs : query.setIncludeDocs(true)

When set to query.setIncludeDocs(false) - the query execution succeeds but in that case, I don't have the actual docs and I will have to perform an explicit get on each returned row.

Can you add support for this scenario in the java client?

Top
  • Login or register to post comments
Fri, 09/28/2012 - 12:36
john
Offline
Joined: 01/05/2012
Groups: None

It's actually likely to be faster to perform an explicit get or multi-get on the docs, since that will pull docs from memory and avoid disk I/O...

Top
  • Login or register to post comments
Mon, 10/01/2012 - 23:49
cb
Offline
Joined: 08/10/2012
Groups: None

Is this a formal Couchbase employee response? View query involves Disk I/O ?? I'm not sure about that. If your map can fully reside in memory I don't think that there is any IO involved.

I know that Views are slower than multi get due to the RESTful interface of view query as opposed to the binary protocol of single/multi get. But it has nothing to do with disk io.

Can someone from Couchbase provide answers to the above discussion / bug report?

Top
  • Login or register to post comments
Tue, 10/02/2012 - 07:18
john
Offline
Joined: 01/05/2012
Groups: None

You can read more about view performance here:

http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-opera...

Top
  • Login or register to post comments
Tue, 10/02/2012 - 08:32
cb
Offline
Joined: 08/10/2012
Groups: None

I wasn't aware of that - thanks for pointing it out. I hope that the file system caching is in some way a prevention mechanism against seek IO.

In any case - the bug described above is still an issue and a Couchbase response should be kindly supplied here.

Top
  • Login or register to post comments
Wed, 10/03/2012 - 04:55
daschl
Offline
Joined: 05/19/2012
Groups: None

Hi,

thanks for bringing this up. I filed a ticket for this, where you can track the status too. http://www.couchbase.com/issues/browse/JCBC-125

I'm working on it!

Thanks,
Michael

Top
  • Login or register to post comments
Thu, 10/04/2012 - 22:09
ingenthr
Offline
Joined: 03/16/2010
Groups:

Both john and daschl are part of Couchbase, Inc. Please feel free to email matt at couchbase if there's anything more I can do. We'll have more improvements to serving views in future releases.

Thanks!

Matt

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker