Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A80F5185A3 for ; Tue, 7 Jul 2015 23:11:04 +0000 (UTC) Received: (qmail 31731 invoked by uid 500); 7 Jul 2015 23:11:04 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 31681 invoked by uid 500); 7 Jul 2015 23:11:04 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 31670 invoked by uid 99); 7 Jul 2015 23:11:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jul 2015 23:11:04 +0000 Date: Tue, 7 Jul 2015 23:11:04 +0000 (UTC) From: "Dmitry Minkovsky (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CURATOR-230) Get remaining semaphore count upon lease acquisition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 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)