Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-310

Create a getBulk() operation that returns CASValue object

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.6
    • Fix Version/s: .backlog1.x
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None

      Description

      The current client.getBulk(keys) returns the values only,

      It would be useful to create an operation that returns the list of CASValue to allow developer to do CAS operations.

      This should also be supported by the views when doing a "includeDocs" operation

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        ingenthr Matt Ingenthron added a comment -

        One quick comment from a historical sense... I believe the getBulk() and thus it's API has been around longer than the CAS value has. This is legacy from spymemcached and the memcached protocol.

        On the note about doing a loop versus a getBulk(), with the current code if you do a series of async gets(), it's going to be exactly the same as getBulk(). The internals of getBulk() perform the same logic. In fact, it's arguably faster if you're using the Futures directly, since you don't have to wait until they all arrive, You just block when the data is needed.

        We should address that in the documentation.

        Show
        ingenthr Matt Ingenthron added a comment - One quick comment from a historical sense... I believe the getBulk() and thus it's API has been around longer than the CAS value has. This is legacy from spymemcached and the memcached protocol. On the note about doing a loop versus a getBulk(), with the current code if you do a series of async gets(), it's going to be exactly the same as getBulk(). The internals of getBulk() perform the same logic. In fact, it's arguably faster if you're using the Futures directly, since you don't have to wait until they all arrive, You just block when the data is needed. We should address that in the documentation.
        Hide
        mshaw mshaw added a comment -

        Ok interesting thanks for that added info. I have seen getBulk() mentioned in webinars as the recommended way to get multiple records as well.

        Show
        mshaw mshaw added a comment - Ok interesting thanks for that added info. I have seen getBulk() mentioned in webinars as the recommended way to get multiple records as well.
        Hide
        ingenthr Matt Ingenthron added a comment -

        For many clients, that will be the most efficient route which is why they say that in general introductions. Mostly it's described along with views, where you'll have a query and then multi-get the underlying docs. Java is a bit more advanced of a client with it's asynch capabilities, so it is a little different in this regard.

        Show
        ingenthr Matt Ingenthron added a comment - For many clients, that will be the most efficient route which is why they say that in general introductions. Mostly it's described along with views, where you'll have a query and then multi-get the underlying docs. Java is a bit more advanced of a client with it's asynch capabilities, so it is a little different in this regard.
        Hide
        mladen.markov Mladen Markov added a comment -

        Guys, correct me if I'm wrong but the memcached protocol supports bulk gets - getting CAS values for multiple keys with one call.
        See the "gets <key>*" command at https://github.com/memcached/memcached/blob/master/doc/protocol.txt

        Is one "gets 1000 keys" call not going to be way faster than 1000 (async) "get 1 key" calls?

        Show
        mladen.markov Mladen Markov added a comment - Guys, correct me if I'm wrong but the memcached protocol supports bulk gets - getting CAS values for multiple keys with one call. See the "gets <key>*" command at https://github.com/memcached/memcached/blob/master/doc/protocol.txt Is one "gets 1000 keys" call not going to be way faster than 1000 (async) "get 1 key" calls?
        Hide
        perry Perry Krug added a comment -

        Mladen, that part of the protocol only applies to asking for 1000 keys from the same node. In Couchbase-land, it's very likely that that set of 1000 keys actually comes from multiple nodes, in which case you need to make separate calls (at least one for each server). The Java client automatically does this for you and is just as fast as the single "get 1000 keys" call.

        Show
        perry Perry Krug added a comment - Mladen, that part of the protocol only applies to asking for 1000 keys from the same node. In Couchbase-land, it's very likely that that set of 1000 keys actually comes from multiple nodes, in which case you need to make separate calls (at least one for each server). The Java client automatically does this for you and is just as fast as the single "get 1000 keys" call.

          People

          • Assignee:
            daschl Michael Nitschinger
            Reporter:
            tgrall Tug Grall (Inactive)
          • Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There are no open Gerrit changes