Cache store configuration usability

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

Cache store configuration usability

Valentin Kulichenko
Igniters,

I was playing with the cache store in a Spring project and found a couple
of usability issues:

   1. Setting cache store factory in configuration is not enough to enable
   read/write-through, we also require to explicitly enable them via
   setReadThrough and setWriteThrough properties. I understand that this is
   how JCache is designed, but the issue is that we don't validate this
   situation. One sets the store factor, but it simply doesn't work until you
   switch on read/write-through. This is very confusing, we should print out a
   warning at least.
   2. Cache store (and also expiry policy) is instantiated by Ignite via a
   factory, not by Spring, so user can't use Spring auto-wiring which is very
   common in Spring apps. I found a workaround - injected Spring app context
   and made initialization call in LifecycleAware.start(), but I think we
   should do this automatically.

Thoughts?

--
Val
Reply | Threaded
Open this post in threaded view
|

Re: Cache store configuration usability

dsetrakyan
Valentin,

I completely agree, there is a usability issue there. It would be great if
you could file a ticket and propose a design for it.

D

On Thu, May 7, 2015 at 8:36 PM, Valentin Kulichenko <
[hidden email]> wrote:

> Igniters,
>
> I was playing with the cache store in a Spring project and found a couple
> of usability issues:
>
>    1. Setting cache store factory in configuration is not enough to enable
>    read/write-through, we also require to explicitly enable them via
>    setReadThrough and setWriteThrough properties. I understand that this is
>    how JCache is designed, but the issue is that we don't validate this
>    situation. One sets the store factor, but it simply doesn't work until
> you
>    switch on read/write-through. This is very confusing, we should print
> out a
>    warning at least.
>    2. Cache store (and also expiry policy) is instantiated by Ignite via a
>    factory, not by Spring, so user can't use Spring auto-wiring which is
> very
>    common in Spring apps. I found a workaround - injected Spring app
> context
>    and made initialization call in LifecycleAware.start(), but I think we
>    should do this automatically.
>
> Thoughts?
>
> --
> Val
>
Reply | Threaded
Open this post in threaded view
|

Re: Cache store configuration usability

Valentin Kulichenko
Created ticket: https://issues.apache.org/jira/browse/IGNITE-884

I marked it as "newbie", because it seems to be pretty easy to implement.
Feel free to comment.

--
Val

On Thu, May 7, 2015 at 9:14 PM, Dmitriy Setrakyan <[hidden email]>
wrote:

> Valentin,
>
> I completely agree, there is a usability issue there. It would be great if
> you could file a ticket and propose a design for it.
>
> D
>
> On Thu, May 7, 2015 at 8:36 PM, Valentin Kulichenko <
> [hidden email]> wrote:
>
> > Igniters,
> >
> > I was playing with the cache store in a Spring project and found a couple
> > of usability issues:
> >
> >    1. Setting cache store factory in configuration is not enough to
> enable
> >    read/write-through, we also require to explicitly enable them via
> >    setReadThrough and setWriteThrough properties. I understand that this
> is
> >    how JCache is designed, but the issue is that we don't validate this
> >    situation. One sets the store factor, but it simply doesn't work until
> > you
> >    switch on read/write-through. This is very confusing, we should print
> > out a
> >    warning at least.
> >    2. Cache store (and also expiry policy) is instantiated by Ignite via
> a
> >    factory, not by Spring, so user can't use Spring auto-wiring which is
> > very
> >    common in Spring apps. I found a workaround - injected Spring app
> > context
> >    and made initialization call in LifecycleAware.start(), but I think we
> >    should do this automatically.
> >
> > Thoughts?
> >
> > --
> > Val
> >
>