Return-Path: X-Original-To: apmail-curator-user-archive@minotaur.apache.org Delivered-To: apmail-curator-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9F871059C for ; Tue, 11 Jun 2013 04:05:17 +0000 (UTC) Received: (qmail 29311 invoked by uid 500); 11 Jun 2013 04:05:16 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 29284 invoked by uid 500); 11 Jun 2013 04:05:16 -0000 Mailing-List: contact user-help@curator.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@curator.incubator.apache.org Delivered-To: mailing list user@curator.incubator.apache.org Received: (qmail 29275 invoked by uid 99); 11 Jun 2013 04:05:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 04:05:15 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [209.85.160.49] (HELO mail-pb0-f49.google.com) (209.85.160.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 04:05:08 +0000 Received: by mail-pb0-f49.google.com with SMTP id jt11so7939860pbb.22 for ; Mon, 10 Jun 2013 21:04:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to:x-mailer:x-gm-message-state; bh=ra8HNw51vExCqKh3O0ywxdltEfqkSXOQ5I2x1GWz0UM=; b=h7S1nGHlsl7xXqbYCAF6t4EOim8avV+zKnYXcrHkJf3QpL5C9G4YeIelPgCNpG0l6b AUr1AX/tVFglHwNmNAsZMJpkGWJmLn0Mx8FbHUE5xdRu+21dbLCX14rjcla2j5HJMcUY Lsfz4/CunouPOe5ZE7emawIGMzG/y9qCFa9idJMLg23nwltIiuKwqySJQr/G8gN9eEvW 1wWbS4EYO6s0LhYVLha9QV/ji9yuOxOqS7st5NuoCiNt62ezAbW1mcWR7awrExlhqDRq 5zswuUaNt/k9J3NjGq+IdScH9yY/3+XwT9TUx7jtLEIRYAzFPXzVAlZeS+LC3ktWJKVg D+vQ== X-Received: by 10.66.252.133 with SMTP id zs5mr16721505pac.47.1370923466971; Mon, 10 Jun 2013 21:04:26 -0700 (PDT) Received: from [10.0.1.50] (c-24-130-72-169.hsd1.ca.comcast.net. [24.130.72.169]) by mx.google.com with ESMTPSA id yj2sm12778372pbb.40.2013.06.10.21.04.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 21:04:26 -0700 (PDT) From: Jordan Zimmerman Content-Type: multipart/alternative; boundary="Apple-Mail=_D18E2A79-2A5E-48C0-B3F1-1562BAFD8CB9" Message-Id: <8A6126C8-947F-4077-A410-84D83F582500@jordanzimmerman.com> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Cache block on start Date: Mon, 10 Jun 2013 21:04:25 -0700 References: <57AC621B-9933-4FE3-ADD5-220EFB28E0D9@jordanzimmerman.com> To: user@curator.incubator.apache.org, vines@apache.org In-Reply-To: X-Mailer: Apple Mail (2.1508) X-Gm-Message-State: ALoCoQlBg58RTNSl9LFwwsa9kZ9UC5PFyNeK7KcGwJkj3ajWN9x8XKoWeW4Wv2Rpy8k8f7L7KO+4 X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_D18E2A79-2A5E-48C0-B3F1-1562BAFD8CB9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 If you want to block, use POST_INITIALIZED_EVENT and use a = CountDownLatch or something to block on until you get the event. -Jordan =20 On Jun 10, 2013, at 8:52 PM, John Vines wrote: > I'm currently doing that, but I'm under the impression that just = starts the background processes in building the cache, not block until = the cache is fully populated. >=20 >=20 > On Mon, Jun 10, 2013 at 10:50 PM, Jordan Zimmerman = wrote: > Pass BUILD_INITIAL_CACHE for the start mode. >=20 > On Jun 10, 2013, at 7:27 PM, John Vines wrote: >=20 > > I'm using a PathChildrenCache for maintaining some state information = in my code, including a listener event. But when I first start up my = process it takes a while for the cache to update (and subsequently the = listener events to trigger and populate another cache). Is there a way = to force the cache to build, at start time or otherwise, that will still = trigger listener events? I have no guarantees that the listeners will = trigger when I start, so I cannot poll on that either. > > > > Thanks > > John >=20 >=20 --Apple-Mail=_D18E2A79-2A5E-48C0-B3F1-1562BAFD8CB9 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=iso-8859-1 If you want to block, use POST_INITIALIZED_EVENT and use a CountDownLatch or something to block on until you get the event.

-Jordan
 
On Jun 10, 2013, at 8:52 PM, John Vines <vines@apache.org> wrote:

I'm currently doing that, but I'm under the impression that just starts the background processes in building the cache, not block until the cache is fully populated.


On Mon, Jun 10, 2013 at 10:50 PM, Jordan Zimmerman <jordan@jordanzimmerman.com> wrote:
Pass BUILD_INITIAL_CACHE for the start mode.

On Jun 10, 2013, at 7:27 PM, John Vines <vines@apache.org> wrote:

> I'm using a PathChildrenCache for maintaining some state information in my code, including a listener event. But when I first start up my process it takes a while for the cache to update (and subsequently the listener events to trigger and populate another cache). Is there a way to force the cache to build, at start time or otherwise, that will still trigger listener events? I have no guarantees that the listeners will trigger when I start, so I cannot poll on that either.
>
> Thanks
> John



--Apple-Mail=_D18E2A79-2A5E-48C0-B3F1-1562BAFD8CB9--