You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Me <me...@linlyu.com> on 2015/11/05 07:26:40 UTC
How can I add a trigger to modify the value when one K-V inserting?
I would like to add a function like the trigger in SQL for ignite, I have to modify the value of an entry when the entry is inserted into a cache.
But I don't know how to do it, as I known, there is a MapTrigger in Coherence can do this.
Here is the URL(https://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_triggers.htm#COHDG130).
Thanks for your help.
Best Regards
Lin Lyu
Re: How can I add a trigger to modify the value when one K-V inserting?
Posted by Yakov Zhdanov <yz...@apache.org>.
Hi!
You can use org.apache.ignite.configuration.CacheConfiguration#interceptor
providing the similar functionality as mentioned trigger. You will need to
implement org.apache.ignite.cache.CacheInterceptor#onBeforePut and return
new value which will be put to cache. You also can use convenient adapter
- org.apache.ignite.cache.CacheInterceptorAdapter
Thanks!
--Yakov
2015-11-05 9:26 GMT+03:00 Me <me...@linlyu.com>:
> I would like to add a function like the trigger in SQL for ignite, I have
> to modify the value of an entry when the entry is inserted into a cache.
>
> But I don't know how to do it, as I known, there is a MapTrigger in
> Coherence can do this.
> Here is the URL(
> https://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_triggers.htm#COHDG130
> ).
>
> Thanks for your help.
>
> Best Regards
>
> Lin Lyu
>