Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete items in Set with Context [JIRA: CLIENTS-755] #260

Open
cjimison opened this issue Feb 9, 2016 · 1 comment
Open

Delete items in Set with Context [JIRA: CLIENTS-755] #260

cjimison opened this issue Feb 9, 2016 · 1 comment

Comments

@cjimison
Copy link

cjimison commented Feb 9, 2016

Sorry if this is more of a question then a bug, but I am a little stuck. Recently I updated my riak-erlang-client and I see that in the riakc_set:del_element I need to have a context set or it will throw context_required (riakc_map as well).

However I am confused by this because the basho docs says:

%% You cannot fetch a Data Type's context directly using the Erlang
%% client. This is actually quite all right, as the client automatically
%% manages contexts when making updates.

Does del_element not fall into the confines of an "update"?

Assuming that del_element is a special case:

I have a very large set in the DB (about 1M entries) and I was hoping to be able to delete an element in that set without reading the whole set first. I tried to read just the head of the object but as per what the doc said, I can't seem to get the context unless I read the whole set into my server.

I don't read this list very often but elements are added/removed on a somewhat frequent bases.

Thanks for any info/help!

@Basho-JIRA Basho-JIRA changed the title Delete items in Set with Context Delete items in Set with Context [JIRA: CLIENTS-755] Feb 9, 2016
@cjimison
Copy link
Author

cjimison commented Feb 9, 2016

So the docs also say that "removing an element from a set is a bit trickier than adding elements. In order to remove an item (or multiple items), we need to first fetch the set, which provides our client access to the set's causal context". So to answer my own question yes delete is a special case :p

However the question I still have is can I ask Riak for just the context without pulling the whole set down? Given the amount of stuff in this list it would be nice not to put the extra load on the nic and more stuff to GC if I am not actually using the rest of the set except to remove an element from it.

Thanks!

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

No branches or pull requests

2 participants