[infinispan-dev] infinispan + javax.cache impl

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[infinispan-dev] infinispan + javax.cache impl

Ales Justin
Dunno if this was already implemented somewhere else,
but here is my initial javax.cache impl based on Infinispan:
* https://github.com/alesj/lhotse/tree/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan

-Ales


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] infinispan + javax.cache impl

Galder Zamarreno
Hey Ales,

I had a quick glance and these are my comments so far:

Do you know where's the javadoc or source for the javax.cache classes?

Also, I'm not sure we can really implement this on top of Infinispan. Personally I think it's better if it's implemented within Infinispan. For example:

https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCache.java#L90

You're basically accessing the data container directly there and so you bypass any interceptors. So for example, in a distributed cache that call won't lookup the entry if not present locally. Same thing if the entry is instead located in a cache store.

Have you also tried to run a test with the listener in https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCacheListener.java ? The method parameters for onPut, onLoad and onRemove appear to be wrong.

What does the @MetaInfServices do in https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCacheFactory.java ?

Cheers,

On Apr 30, 2011, at 12:29 PM, Ales Justin wrote:

> Dunno if this was already implemented somewhere else,
> but here is my initial javax.cache impl based on Infinispan:
> * https://github.com/alesj/lhotse/tree/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan
>
> -Ales
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] infinispan + javax.cache impl

Pete Muir
Agreed. Could we provide a jsr107 module in infinispan that implements the proposed api?

On 4 May 2011, at 02:53, Galder Zamarreño wrote:

> Hey Ales,
>
> I had a quick glance and these are my comments so far:
>
> Do you know where's the javadoc or source for the javax.cache classes?
>
> Also, I'm not sure we can really implement this on top of Infinispan. Personally I think it's better if it's implemented within Infinispan. For example:
>
> https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCache.java#L90
>
> You're basically accessing the data container directly there and so you bypass any interceptors. So for example, in a distributed cache that call won't lookup the entry if not present locally. Same thing if the entry is instead located in a cache store.
>
> Have you also tried to run a test with the listener in https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCacheListener.java ? The method parameters for onPut, onLoad and onRemove appear to be wrong.
>
> What does the @MetaInfServices do in https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCacheFactory.java ?
>
> Cheers,
>
> On Apr 30, 2011, at 12:29 PM, Ales Justin wrote:
>
>> Dunno if this was already implemented somewhere else,
>> but here is my initial javax.cache impl based on Infinispan:
>> * https://github.com/alesj/lhotse/tree/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan
>>
>> -Ales
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] infinispan + javax.cache impl

Ales Justin
In reply to this post by Ales Justin
> Agreed. Could we provide a jsr107 module in infinispan that implements the proposed api?
>
> On 4 May 2011, at 02:53, Galder Zamarre?o wrote:
>
>> Hey Ales,
>>
>> I had a quick glance and these are my comments so far:
>>
>> Do you know where's the javadoc or source for the javax.cache classes?

Nope.
I just pulled the first javax.cache maven artifact I could find.
And I googled for some poor javadoc.

>> Also, I'm not sure we can really implement this on top of Infinispan. Personally I think it's better if it's implemented within Infinispan. For example:
>>
>> https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCache.java#L90
>>
>> You're basically accessing the data container directly there and so you bypass any interceptors. So for example, in a distributed cache that call won't lookup the entry if not present locally. Same thing if the entry is instead located in a cache store.

Is there some other proper API I could use to implement this?
But I have nothing against moving this directly to Infinispan. :-)

>> Have you also tried to run a test with the listener in https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCacheListener.java ? The method parameters for onPut, onLoad and onRemove appear to be wrong.

Ah, copy/paste error.
Let me actually create some tests.

>> What does the @MetaInfServices do in https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCacheFactory.java ?

http://weblogs.java.net/blog/kohsuke/archive/2009/03/my_project_of_t.html

-Ales

>>> Dunno if this was already implemented somewhere else,
>>> but here is my initial javax.cache impl based on Infinispan:
>>> * https://github.com/alesj/lhotse/tree/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] infinispan + javax.cache impl

Ales Justin
>>> Have you also tried to run a test with the listener in https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCacheListener.java ? The method parameters for onPut, onLoad and onRemove appear to be wrong.
>
> Ah, copy/paste error.
> Let me actually create some tests.


Here, some initial smoke tests:

https://github.com/alesj/lhotse/blob/master/javax-cache/src/test/java/org/jboss/test/lhotse/cache/test/SmokeTestCase.java

-Ales


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] infinispan + javax.cache impl

Galder Zamarreno
In reply to this post by Ales Justin

On May 7, 2011, at 11:25 PM, Ales Justin wrote:

>> </snip>
>
>>> Also, I'm not sure we can really implement this on top of Infinispan. Personally I think it's better if it's implemented within Infinispan. For example:
>>>
>>> https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCache.java#L90
>>>
>>> You're basically accessing the data container directly there and so you bypass any interceptors. So for example, in a distributed cache that call won't lookup the entry if not present locally. Same thing if the entry is instead located in a cache store.
>
> Is there some other proper API I could use to implement this?
> But I have nothing against moving this directly to Infinispan. :-)

AFAIK no, there's no API that allows to retrieve the info you need for the CacheEntry without getting into internals.

I'm not sure whether this is something we wanna be exposing right now.

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] infinispan + javax.cache impl

Manik Surtani
Just a heads up. No point wasting much time on this, JSR 107 is in for a pretty major revamp.


Two threads in particular to note:


Cheers
Manik


On 9 May 2011, at 14:34, Galder Zamarreño wrote:


On May 7, 2011, at 11:25 PM, Ales Justin wrote:

</snip>

Also, I'm not sure we can really implement this on top of Infinispan. Personally I think it's better if it's implemented within Infinispan. For example:

https://github.com/alesj/lhotse/blob/master/javax-cache/src/main/java/org/jboss/lhotse/cache/infinispan/InfinispanCache.java#L90

You're basically accessing the data container directly there and so you bypass any interceptors. So for example, in a distributed cache that call won't lookup the entry if not present locally. Same thing if the entry is instead located in a cache store.

Is there some other proper API I could use to implement this?
But I have nothing against moving this directly to Infinispan. :-)

AFAIK no, there's no API that allows to retrieve the info you need for the CacheEntry without getting into internals.

I'm not sure whether this is something we wanna be exposing right now.

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev



_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev