byzhang / terrastore

Automatically exported from code.google.com/p/terrastore
Other
0 stars 0 forks source link

"Bulk" fetching #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Allow a client to fetch a list of documents by key in a single request.

In my use case, I'd like to avoid using a predicate to evaluate the full set of 
keys.  Rather, I'd like the server to simply iterate over the list of keys I 
provide and get the single document associated with each, and then return the 
resulting list of documents.

E.g., Client: "Get documents 2, 6, 7, and 15."  Server: "Okay, here are three 
documents: 2, 7, and 15 (I didn't find '6')."  Or simply, "Okay, here are 
documents 2, 7, and 15" (leaving the client to simply recognize that since '6' 
was missing, it must not have been found.)

Presently, I am doing this by rapidly sending a sequence of GET requests one by 
one, which seems inefficient.

Original issue reported on code.google.com by teonanac...@gmail.com on 16 Mar 2011 at 4:26

GoogleCodeExporter commented 9 years ago

Original comment by sergio.b...@gmail.com on 16 Mar 2011 at 1:35

GoogleCodeExporter commented 9 years ago
Implemented by exposing the following HTTP operation: POST /bucket/bulk/get
It accepts a json array as the request payload, containing (string) keys to 
fetch, i.e.: ["1", "3"]

Feedback would be very welcome!

Original comment by sergio.b...@gmail.com on 19 Mar 2011 at 7:21

GoogleCodeExporter commented 9 years ago
Sounds good to me.  I am using the Java API, which I suspect will expose a 
method that takes a List of String ids, correct?

Original comment by teonanac...@gmail.com on 19 Mar 2011 at 11:45

GoogleCodeExporter commented 9 years ago
The Java Client will take a set of strings: I'll add bulk put/get APIs in the 
next few days.

Original comment by sergio.b...@gmail.com on 20 Mar 2011 at 9:48

GoogleCodeExporter commented 9 years ago
Implemented on Java Client too: see issue 172.

Original comment by sergio.b...@gmail.com on 26 Mar 2011 at 4:57