curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Minkovsky (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CURATOR-230) Get remaining semaphore count upon lease acquisition
Date Tue, 07 Jul 2015 23:11:04 GMT
Dmitry Minkovsky created CURATOR-230:
----------------------------------------

             Summary: Get remaining semaphore count upon lease acquisition
                 Key: CURATOR-230
                 URL: https://issues.apache.org/jira/browse/CURATOR-230
             Project: Apache Curator
          Issue Type: Wish
          Components: Recipes
    Affects Versions: 2.8.0
            Reporter: Dmitry Minkovsky
            Priority: Trivial


I'm using Curator to help generate IDs in a distributed environment. My IDs are pretty typical:
64 bits with three components: timestamp, worker, count. The worker component comes from a
Curator {{DistributedAtomicNumber}} modulo the max number of workers. To make sure that at
any given time the number of workers don't exceed the max number of workers, each worker needs
to take an {{InterProcessSemaphoreV2}} before it gets its worker ID. It seems that this would
be simpler if I could just get a lease count upon acquiring an {{InterProcessSemaphoreV2}}.
Would this be possible? Thank you.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message