Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

ioctx: ListOmapValues & GetAllOmapValues added #19

Merged
merged 1 commit into from
May 4, 2015

Conversation

gierschv
Copy link
Contributor

@gierschv gierschv commented May 4, 2015

Added:

  • ListOmapValues allows to iterate on all the key feteched during
    a read operation of an omap (the goal is to easily get the last
    read key from the C iterator. This one can then be used in another
    call as startAfter parameter).
  • GetAllOmapValues returns all the keys / values of the whole omap
  • GetOmapValues now uses ListOmapValues

* `ListOmapValues` allows to iterate on all the key feteched during
a read operation of an omap (the goal is to easily get the last
read key from the C iterator. This one can then be used in another
call as `startAfter` parameter).
* `GetAllOmapValues` returns all the keys / values of the whole omap
* `GetOmapValues` now uses `ListOmapValues`

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
@dotnwat
Copy link
Owner

dotnwat commented May 4, 2015

I'd like to propose a slight change to the patch, but I'm open to anything :)

I think it is a good idea to strive for a 1-1 mapping with librados API. So, I'd propose that ideally we expose rados_create_read_op, rados_read_op_omap_get_vals, and rados_omap_get_next directly so that a user could construct something like ListOmapValues themselves. Having some convenience functions is also a good idea, so I think a common thing is just GetAllOmapValues() without any parameters, and users with extra needs can use the lower level API.

I don't mind merging this as it is now since the library is still evolving. Would that be useful now, and then start to expose the lower level stuff?

@gierschv
Copy link
Contributor Author

gierschv commented May 4, 2015

Sure, I made this PR since I needed a lower level (i.e. knowing which is the last key read so I can create a new read operation to read the next keys), and I think the ListOmapValues I suggest here is a good start :)

@dotnwat
Copy link
Owner

dotnwat commented May 4, 2015

Ok sounds good. If I get a chance soon I'll try to expose the rados op api directly and see how that looks.

dotnwat added a commit that referenced this pull request May 4, 2015
ioctx: ListOmapValues & GetAllOmapValues added
@dotnwat dotnwat merged commit 6f60f5a into dotnwat:master May 4, 2015
@gierschv
Copy link
Contributor Author

gierschv commented May 4, 2015

Thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants