Open harsha89 opened 8 years ago
You can use an IMap with the name of the 'atomiclong' as key. You can do all the usual operations like get/set/compareAndSet(replace) and alter (using entryprocessors). On top of that you get all the goodies from IMap like ttl.
Hi Pveentier,
Agreed on that. I have one question on entry processors. Can it be handle multiple updates perform in multiple nodes in the cluster? We are maintaining atomic long for distributed counter across the cluster. This more analogs to atomic log addAndGet operations. Also can updates done in asynchronous manner in map? What we notice is that, when there are large number of atomic longs to be replicate, it takes considerable time to update the instance. Hence async gives more flexibility without waiting the replicator thread.
Thanks, Harsha
Hello @harsha89,
entry processors on the same key are guaranteed to be atomic. You can submit 2 entry processors concurrently and they will run one-by-one (on the same key). See http://docs.hazelcast.org/docs/3.5/manual/html-single/index.html#entry-processor for details.
Thanks for the details. I'll check it out.
Hi @harsha89 !
Have you had the chance to try out the suggestion?
@pveentjer hi. has IMap same perfomance for this like IAtomicLong ?
Hi All,
It's really useful to have a option to set TTL value for hazelcast atomic longs. If not system needs to write a cleanup task to remove them. It may cause OOM. I believe it's good option to have a TTL setting as in maps.
Thanks, Harsha