zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Martella <claudio.marte...@tis.bz.it>
Subject Re: counter with zookeeper
Date Thu, 02 Dec 2010 17:40:11 GMT
so you keep a list of unused ID ranges in the ZK node's data?

On 12/2/10 6:21 PM, David Rosenstrauch wrote:
> I don't, for several reasons:
> a) We request ID's frequently enough that old ones do eventually get
> used up.
> b) Even with a largely fragmented ID space, the largest we've seen the
> bytes contents of that ZK node get up to is 5-6KBytes.  So no real
> worries about either storage space or network I/O when reading/writing
> to/from the ZK node.
> DR
> On 12/02/2010 10:58 AM, Claudio Martella wrote:
>> I like Ted's idea too.
>> David, how do you handle re-compaction of your fragmented ID space?
>> On 12/2/10 4:55 PM, David Rosenstrauch wrote:
>>> On 12/02/2010 10:47 AM, Ted Dunning wrote:
>>>> I would recommend that you increment the counter by 100 or 1000 and
>>>> then
>>>> increment a local counter over the implied range.  This will drive the
>>>> amortized ZK overhead down to tens of microseconds which should be
>>>> good for
>>>> almost any application. Your final ids will still be almost entirely
>>>> contiguous.  You could implement a fancier counter in ZK that
>>>> remembers
>>>> returned chunks for re-use to get perfect contiguity if you really
>>>> wanted
>>>> that.
>>> This is what our library does.  You request chunks of, say, 1000 ID's,
>>> and then push back any remaining unused ID's in the chunk you took.
>>> DR

Claudio Martella
Digital Technologies
Unit Research & Development - Analyst

TIS innovation park
Via Siemens 19 | Siemensstr. 19
39100 Bolzano | 39100 Bozen
Tel. +39 0471 068 123
Fax  +39 0471 068 129
claudio.martella@tis.bz.it http://www.tis.bz.it

Short information regarding use of personal data. According to Section 13 of Italian Legislative
Decree no. 196 of 30 June 2003, we inform you that we process your personal data in order
to fulfil contractual and fiscal obligations and also to send you information regarding our
services and events. Your personal data are processed with and without electronic means and
by respecting data subjects' rights, fundamental freedoms and dignity, particularly with regard
to confidentiality, personal identity and the right to personal data protection. At any time
and without formalities you can write an e-mail to privacy@tis.bz.it in order to object the
processing of your personal data for the purpose of sending advertising materials and also
to exercise the right to access personal data and other rights referred to in Section 7 of
Decree 196/2003. The data controller is TIS Techno Innovation Alto Adige, Siemens Street n.
19, Bolzano. You can find the complete information on the web site www.tis.bz.it.

View raw message