You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Vyacheslav Daradur <da...@gmail.com> on 2017/04/13 12:54:27 UTC
Synchronize method across Ignite cluster
Hi Igniters!
I need to synchronize a method across a Ignite cluster, which work with
IgniteCache.
Does Ignite provide any tools for?
For example:
***
Lock lock = cache.lock(key);
lock.lock();
try {
// todo somethink
}
finally {
lock.unlock();
}
***
--
Best Regards, Vyacheslav
Re: Synchronize method across Ignite cluster
Posted by Anton Vinogradov <av...@gridgain.com>.
>> Lock lock = cache.lock(key); - works only
>> with CacheAtomicityMode.TRANSACTIONAL
Correct
>> Does cache-locks work across all nodes of Ignite-cluster?
Yes
>> what an approach will be the best for use
>> within IGNITE-4211.
EntryProcessor is the best case, but, seems, it can't be used due to Spring
AOPs.
On Thu, Apr 13, 2017 at 4:15 PM, Vyacheslav Daradur <da...@gmail.com>
wrote:
> Anton, you all know for what I need it))
>
> As I understand:
> Lock lock = cache.lock(key); - works only
> with CacheAtomicityMode.TRANSACTIONAL
>
> Does cache-locks work across all nodes of Ignite-cluster?
>
> Can you give me some advice: what an approach will be the best for use
> within IGNITE-4211. (you know the context of this task)
>
>
> 2017-04-13 16:06 GMT+03:00 Anton Vinogradov <av...@gridgain.com>:
>
> > Vyacheslav,
> >
> > Explicit cache locks, DataStructures (eg. reentrant locks), transactions,
> > etc.
> > We have all of them and even more :)
> >
> > On Thu, Apr 13, 2017 at 3:54 PM, Vyacheslav Daradur <daradurvs@gmail.com
> >
> > wrote:
> >
> > > Hi Igniters!
> > >
> > > I need to synchronize a method across a Ignite cluster, which work with
> > > IgniteCache.
> > >
> > > Does Ignite provide any tools for?
> > >
> > > For example:
> > > ***
> > > Lock lock = cache.lock(key);
> > > lock.lock();
> > >
> > > try {
> > > // todo somethink
> > > }
> > > finally {
> > > lock.unlock();
> > > }
> > > ***
> > >
> > > --
> > > Best Regards, Vyacheslav
> > >
> >
>
>
>
> --
> Best Regards, Vyacheslav
>
Re: Synchronize method across Ignite cluster
Posted by Vyacheslav Daradur <da...@gmail.com>.
Anton, you all know for what I need it))
As I understand:
Lock lock = cache.lock(key); - works only
with CacheAtomicityMode.TRANSACTIONAL
Does cache-locks work across all nodes of Ignite-cluster?
Can you give me some advice: what an approach will be the best for use
within IGNITE-4211. (you know the context of this task)
2017-04-13 16:06 GMT+03:00 Anton Vinogradov <av...@gridgain.com>:
> Vyacheslav,
>
> Explicit cache locks, DataStructures (eg. reentrant locks), transactions,
> etc.
> We have all of them and even more :)
>
> On Thu, Apr 13, 2017 at 3:54 PM, Vyacheslav Daradur <da...@gmail.com>
> wrote:
>
> > Hi Igniters!
> >
> > I need to synchronize a method across a Ignite cluster, which work with
> > IgniteCache.
> >
> > Does Ignite provide any tools for?
> >
> > For example:
> > ***
> > Lock lock = cache.lock(key);
> > lock.lock();
> >
> > try {
> > // todo somethink
> > }
> > finally {
> > lock.unlock();
> > }
> > ***
> >
> > --
> > Best Regards, Vyacheslav
> >
>
--
Best Regards, Vyacheslav
Re: Synchronize method across Ignite cluster
Posted by Anton Vinogradov <av...@gridgain.com>.
Vyacheslav,
Explicit cache locks, DataStructures (eg. reentrant locks), transactions,
etc.
We have all of them and even more :)
On Thu, Apr 13, 2017 at 3:54 PM, Vyacheslav Daradur <da...@gmail.com>
wrote:
> Hi Igniters!
>
> I need to synchronize a method across a Ignite cluster, which work with
> IgniteCache.
>
> Does Ignite provide any tools for?
>
> For example:
> ***
> Lock lock = cache.lock(key);
> lock.lock();
>
> try {
> // todo somethink
> }
> finally {
> lock.unlock();
> }
> ***
>
> --
> Best Regards, Vyacheslav
>