veyron/services/store/memstore/query: Add sample() function.

The sample() function randomly samples the stream of results using reservoir
sampling.  sample() takes a single integer argument specifying the number
of samples to return.

I plan to use this function in the Store codelab to randomly select
a fortune.

Change-Id: I574a0fef77cff4fe602c1b300c80c5be33318fef
2 files changed
tree: db3375293347972756394168b99dc5a2f7371998
  1. examples/
  2. lib/
  3. runtimes/
  4. security/
  5. services/
  6. tools/