I have considered using AtomicLong as well. But the main reason to
introduce ignite lock is becuase the increaseAndGet() method should only be
called after all the policies are allowed.

Here is an example, when a message is allowed by Policy A(100 messages per
user per day), but blocked by policy B(500 messages per user per week),
nether counter A and counter B should have count increased.

Hence, my thought using ignite lock:
1). lock all used keys in policies
2). exam policies
3). If allowed, update counters
4). Unlock all used keys

Would transaction help in my case?

vkulichenko <valentin.kuliche...@gmail.com>於 2017年2月13日 週一,上午10:33寫道:

> Hi Evans,
>
>
>
> It sounds like you can simply use AtomicLong:
>
> https://apacheignite.readme.io/docs/atomic-types
>
>
>
> -Val
>
>
>
>
>
>
>
> --
>
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-for-fine-grained-policy-quota-control-tp10563p10584.html
>
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
>

Reply via email to