You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by Joe Stein <cr...@gmail.com> on 2013/05/29 21:12:47 UTC

putIfAbsent ?

Hey, so was looking at Mutation and did not see a putIfAbsent function is there such a thing in Accumulo ?

Thanks!

/*
Joe Stein, Chief Architect
http://www.medialets.com
Twitter: @allthingshadoop
Mobile: 917-597-9771
*/

Re: putIfAbsent ?

Posted by Joe Stein <cr...@gmail.com>.
example 3 is really cool too would be a great way to counting uniques
within row keys, like users within a campaign


On Wed, May 29, 2013 at 4:28 PM, Keith Turner <ke...@deenlo.com> wrote:

> On Wed, May 29, 2013 at 3:12 PM, Joe Stein <cr...@gmail.com> wrote:
>
> > Hey, so was looking at Mutation and did not see a putIfAbsent function is
> > there such a thing in Accumulo ?
> >
>
> I am looking into adding conditional mutations to Accumulo 1.6. that would
> support this.
>
> https://issues.apache.org/jira/browse/ACCUMULO-1000
>
> In the design document I suggested a method called putCondition() and if
> the value was null, thats mean that the user expected it to be absent.   I
> don't really like that API for specifying expected absence.
>
>
>
>
> >
> > Thanks!
> >
> > /*
> > Joe Stein, Chief Architect
> > http://www.medialets.com
> > Twitter: @allthingshadoop
> > Mobile: 917-597-9771
> > */
>



-- 

/*
Joe Stein
http://www.linkedin.com/in/charmalloc
Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
*/

Re: putIfAbsent ?

Posted by Keith Turner <ke...@deenlo.com>.
On Wed, May 29, 2013 at 3:12 PM, Joe Stein <cr...@gmail.com> wrote:

> Hey, so was looking at Mutation and did not see a putIfAbsent function is
> there such a thing in Accumulo ?
>

I am looking into adding conditional mutations to Accumulo 1.6. that would
support this.

https://issues.apache.org/jira/browse/ACCUMULO-1000

In the design document I suggested a method called putCondition() and if
the value was null, thats mean that the user expected it to be absent.   I
don't really like that API for specifying expected absence.




>
> Thanks!
>
> /*
> Joe Stein, Chief Architect
> http://www.medialets.com
> Twitter: @allthingshadoop
> Mobile: 917-597-9771
> */

Re: putIfAbsent ?

Posted by Christopher <ct...@apache.org>.
There is not such a thing in Accumulo. To do that, you'd have to have
your client do the check first. You could do something clever like a
put with a timestamp prior to any timestamp that would exist if the
key had already been there, that way it'll be ignored if a newer one
existed (assuming you have max versions set to 1 on the
VersioningIterator).

--
Christopher L Tubbs II
http://gravatar.com/ctubbsii


On Wed, May 29, 2013 at 3:12 PM, Joe Stein <cr...@gmail.com> wrote:
> Hey, so was looking at Mutation and did not see a putIfAbsent function is there such a thing in Accumulo ?
>
> Thanks!
>
> /*
> Joe Stein, Chief Architect
> http://www.medialets.com
> Twitter: @allthingshadoop
> Mobile: 917-597-9771
> */