While checkAndPut is atomic as it's built now it doesn't support also checking 
the timestamp range which is included in the new checkAndMutate API. I had 
planned on using the cell's timestamp as the revision along with the value to 
ensure not only that the value hadn't been changed but that there hadn't been 
changes in between that just happened to put the value back.

As I was looking at everything I had another question. Why is the cache 
currently using a scan instead of a get to fetch values from HBase. It seems 
like that would be much less performant considering we know the row key we're 
looking for.


Thanks
Shawn

-----Original Message-----
From: Bryan Bende <[email protected]> 
Sent: Thursday, April 25, 2019 11:56 AM
To: [email protected]
Subject: Re: Adding HBase Support for AtomicDistributedMapCacheClient

Can it not be done with the existing checkAndPut method? [1]

I think if you use the value as the revision it should work. Would be similar 
to how the Redis implementation works [2].

[1] 
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/HBaseClientService.java#L65
[2] 
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-redis-bundle/nifi-redis-extensions/src/main/java/org/apache/nifi/redis/service/RedisDistributedMapCacheClientService.java#L271

On Thu, Apr 25, 2019 at 12:38 PM Shawn Weeks <[email protected]> wrote:
>
> I'll need to add a check and mutate method to the HBaseClientService 
> Interface, should I just extend with a HBase2ClientService or add 
> checkAndMutate to the existing interface and just make it raise an exception 
> if you try and use it against hbase 1? While Hbase 1.x supports 
> checkAndMutate it doesn't provide a way to filter on timestamp which is part 
> of how I was going to implement the revision requirement for AtomicMapCache.
>
> Thanks
> Shawn
>
> -----Original Message-----
> From: Bryan Bende <[email protected]>
> Sent: Thursday, April 25, 2019 9:11 AM
> To: [email protected]
> Subject: Re: Adding HBase Support for AtomicDistributedMapCacheClient
>
> I'm not aware of a JIRA, so I'd say go for it.
>
> On Wed, Apr 24, 2019 at 9:27 PM Shawn Weeks <[email protected]> wrote:
> >
> > Seems like this should be fairly easy for HBase 2.x with the checkAndMutate 
> > functionality and I was wondering if there is already a Jira for this. 
> > Otherwise I might make an attempt at it. It would be good to be able to 
> > support Wait/Notify and other things that need 
> > AtomicDistributedMapCacheClient using an Apache developed product commonly 
> > found in a Hadoop Cluster.
> >
> > Thanks
> > Shawn

Reply via email to