Return-Path: Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: (qmail 84412 invoked from network); 13 Feb 2011 21:35:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Feb 2011 21:35:53 -0000 Received: (qmail 52906 invoked by uid 500); 13 Feb 2011 21:35:53 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 52868 invoked by uid 500); 13 Feb 2011 21:35:52 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 52860 invoked by uid 99); 13 Feb 2011 21:35:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Feb 2011 21:35:52 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FORGED_YAHOO_RCVD,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dirtyvagabond@gmail.com designates 209.85.161.42 as permitted sender) Received: from [209.85.161.42] (HELO mail-fx0-f42.google.com) (209.85.161.42) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Feb 2011 21:35:47 +0000 Received: by fxm11 with SMTP id 11so6713576fxm.15 for ; Sun, 13 Feb 2011 13:35:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=NQlKIblJViHDmIzjGdW7AmBBeKyOW84zYachpQMvZ/I=; b=uu5bamb3Jm/IzeZyYxWKUSbSGe6ZC9JTCau2mi+AwuOliyqkq82quf5nFydV27LUDd K+0tH/pGPBDQl+FpzH0e4yyNx+V4nQSAmGmj3NecHUCJY/7yEAfp1CVKot8m7C+2PArz INlO4Du20bzYP8vPIEoVwrBGKcN8ZTuncbuVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=whV1dXVq6FCR/zGBKtKIdf7xr7cUDI4Br8yX7rHuzAYYrS8/4l/+qih6NBlCJ+MxiV ZEfrOU0FQhzssn8jglPhkgRYkfnmgWUwOQ/j1+N0A0IAeXeRxyQbe+I6o4W28CM/+x2I t2+CNDx6yzjvXhRQQ+nmrfMQ1bOtG3Wye7rgA= MIME-Version: 1.0 Received: by 10.223.78.205 with SMTP id m13mr3578608fak.79.1297632926070; Sun, 13 Feb 2011 13:35:26 -0800 (PST) Sender: dirtyvagabond@gmail.com Received: by 10.223.79.5 with HTTP; Sun, 13 Feb 2011 13:35:25 -0800 (PST) In-Reply-To: <201102131710.21091.thomas@koch.ro> References: <201102131710.21091.thomas@koch.ro> Date: Sun, 13 Feb 2011 13:35:25 -0800 X-Google-Sender-Auth: AvnA-EJNPrtlpsRQfKydRJBYfEM Message-ID: Subject: Re: ExecutorService over a zookeeper From: Aaron Crow To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=20cf3054a4c39b782c049c30b5a1 --20cf3054a4c39b782c049c30b5a1 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: quoted-printable unsubscribe 2011/2/13 Thomas Koch > =F7=A6=D4=C1=CC=A6=CA =F4=C9=CD=DE=C9=DB=C9=CE: > > Hello. > > > > I am trying to implement distributed executor service over a zookeeper > and > > encountered a problem I am not sure how to deal with. > > > Hi, > > I've the impression, you're doing it too complicate. Why not have a znode > jobs/ and put all your jobs as persistent znodes in there. > So your job_queue could look like: > > jobs/ > job1 > job2 > job3 > > A consumer can then lock a job by putting an ephemeral node in one of the > job > znodes: > > jobs/ > job1 > job2/ > .lock > job3 > > Other consumers see that somebody is already working on job2. If the > consumer > should die, the ephemeral lock will vanish and another consumer could tak= e > over. > You should not publish results in ZK but use some other communication > method. > ZK is really not meant as a messaging solution. > Maybe you'd be better served with a standard message queue (e.g. Apache > activeMQ, rabbitMQ) and use ZK only for coordination? If you have really > high > message load, you could have a look at Hedwig (google://zookeeper hedwig)= . > > Best regards, > > Thomas Koch, http://www.koch.ro > --20cf3054a4c39b782c049c30b5a1--