By Global Counter I mean an AtomiciNteger which works as a counter across the cluster.
Regards On Mon, Jul 17, 2017 at 10:11 PM, Amit Pandey <[email protected]> wrote: > Jacob, > > I intend to use it for counters. > > And no I don't need sequential ordering, but kind of a global counter. > > regards > > On Mon, Jul 17, 2017 at 10:09 PM, Jacob Barrett <[email protected]> > wrote: > >> It all depends on you intent for the value. Are you looking for unique >> identifiers, then GUID is best. If you are looking for sequential ordering, >> then snowflake. If you need counters, then AtomicInteger like you were >> asking. >> >> May you could provide a bit more context on the intended use. >> >> -Jake >> >> >> On Mon, Jul 17, 2017 at 9:34 AM Amit Pandey <[email protected]> >> wrote: >> >>> I think block allocation is something I am more interested in. As that >>> should give better performance also. >>> >>> Regards >>> >>> On Mon, Jul 17, 2017 at 10:01 PM, Anthony Baker <[email protected]> >>> wrote: >>> >>>> You can build concurrency primitives like AtomicInteger using the >>>> DistributedLockService. However, cluster-wide synchronization is really an >>>> anti-pattern in distributed computing and should be used sparingly. >>>> Ideally, you should find algorithmic alternatives such as block leasing >>>> with local allocation, twitter snowflake, etc. >>>> >>>> Anthony >>>> >>>> >>>> > On Jul 16, 2017, at 8:15 AM, Amit Pandey <[email protected]> >>>> wrote: >>>> > >>>> > Hi Guys, >>>> > >>>> > We had a hazelcast app we want to port to geode. There are some >>>> usages of AtomicLOng of hazelcast which we need to port, is there a best >>>> practice/alternative to achieve the same in Apache Geode? >>>> > >>>> > regards >>>> >>>> >>> >
