You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Игорь Гнатюк <gn...@gmail.com> on 2016/11/14 16:26:08 UTC

CacheInterceptor with client nodes

Hi, all!.

I've tried to add a CacheInterceptor to Apache Ignite cache. It works fine
on server nodes, but when i am trying to access cache("get" operation) from
a client node interceptor is invoked localy (on a client node). Is there
any way to make it work only on server node, before sending results to the
clients?

Re: CacheInterceptor with client nodes

Posted by Игорь Гнатюк <gn...@gmail.com>.
Thanks for the advice, Vladislav. I will try this aproach.

2016-11-15 11:43 GMT+03:00 Vladislav Pyatkov <vl...@gmail.com>:

> Hi Igor,
>
> Why don't you implement CacheStore for this behavior?
> You should implement own CacheStore and set "Read-Through" as true[1].
> At this case all invokes "get" over cache will be reflect on primary node
> (into CacheStore), each time when data can not be found on cache.
>
> If you want to decrease live-time of entry into cache, you can use
> expiry-policies[2].
>
> [1]: https://apacheignite.readme.io/docs/persistent-store#read-
> through-and-write-through
> [2]: https://apacheignite.readme.io/docs/expiry-policies
>
> On Tue, Nov 15, 2016 at 11:30 AM, Игорь Гнатюк <gn...@gmail.com>
> wrote:
>
>> Hi,
>> I need to call a native function via JNI on every "get" and "put" call to
>> a specific cache. The call should be made on a server node, where this
>> concrete enrty resides.
>>
>> 2016-11-15 2:34 GMT+03:00 vkulichenko <va...@gmail.com>:
>>
>>> Hi,
>>>
>>> What exactly are you trying to do? What's the use case?
>>>
>>> -Val
>>>
>>>
>>>
>>> --
>>> View this message in context: http://apache-ignite-users.705
>>> 18.x6.nabble.com/CacheInterceptor-with-client-nodes-tp8964p8970.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>>
>>
>>
>
>
> --
> Vladislav Pyatkov
>

Re: CacheInterceptor with client nodes

Posted by Vladislav Pyatkov <vl...@gmail.com>.
Hi Igor,

Why don't you implement CacheStore for this behavior?
You should implement own CacheStore and set "Read-Through" as true[1].
At this case all invokes "get" over cache will be reflect on primary node
(into CacheStore), each time when data can not be found on cache.

If you want to decrease live-time of entry into cache, you can use
expiry-policies[2].

[1]:
https://apacheignite.readme.io/docs/persistent-store#read-through-and-write-through
[2]: https://apacheignite.readme.io/docs/expiry-policies

On Tue, Nov 15, 2016 at 11:30 AM, Игорь Гнатюк <gn...@gmail.com> wrote:

> Hi,
> I need to call a native function via JNI on every "get" and "put" call to
> a specific cache. The call should be made on a server node, where this
> concrete enrty resides.
>
> 2016-11-15 2:34 GMT+03:00 vkulichenko <va...@gmail.com>:
>
>> Hi,
>>
>> What exactly are you trying to do? What's the use case?
>>
>> -Val
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/CacheInterceptor-with-client-nodes-tp8964p8970.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>


-- 
Vladislav Pyatkov

Re: CacheInterceptor with client nodes

Posted by Игорь Гнатюк <gn...@gmail.com>.
Hi,
I need to call a native function via JNI on every "get" and "put" call to a
specific cache. The call should be made on a server node, where this
concrete enrty resides.

2016-11-15 2:34 GMT+03:00 vkulichenko <va...@gmail.com>:

> Hi,
>
> What exactly are you trying to do? What's the use case?
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/CacheInterceptor-with-client-nodes-tp8964p8970.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: CacheInterceptor with client nodes

Posted by vkulichenko <va...@gmail.com>.
Hi,

What exactly are you trying to do? What's the use case?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/CacheInterceptor-with-client-nodes-tp8964p8970.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.