[
https://issues.apache.org/jira/browse/CURATOR-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dmitry Minkovsky updated CURATOR-230:
-------------------------------------
Description: 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. There are some inherent issues with this method, but it's serving me
fine at the moment. However, it seems that this use-case could be made entirely
much simpler if I could just get a lease count upon acquiring an
{{InterProcessSemaphoreV2}}. Would this be possible? Thank you. (was: 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.)
> 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. There are some
> inherent issues with this method, but it's serving me fine at the moment.
> However, it seems that this use-case could be made entirely much 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)