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 C720B19FD0 for ; Thu, 31 Mar 2016 20:56:04 +0000 (UTC) Received: (qmail 96468 invoked by uid 500); 31 Mar 2016 20:56:04 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 96421 invoked by uid 500); 31 Mar 2016 20:56:04 -0000 Mailing-List: contact user-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@curator.apache.org Delivered-To: mailing list user@curator.apache.org Received: (qmail 96411 invoked by uid 99); 31 Mar 2016 20:56:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2016 20:56:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 23235180536 for ; Thu, 31 Mar 2016 20:56:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id kedDkvw5T7vz for ; Thu, 31 Mar 2016 20:56:02 +0000 (UTC) Received: from mail-vk0-f43.google.com (mail-vk0-f43.google.com [209.85.213.43]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 556C35F473 for ; Thu, 31 Mar 2016 20:56:01 +0000 (UTC) Received: by mail-vk0-f43.google.com with SMTP id k1so119037297vkb.0 for ; Thu, 31 Mar 2016 13:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=KkHy6mA3pj8grul28XzY4RmWc6Mb7v+/Ju0g64BUCUw=; b=PvAqSZVIX9kf78tJgYCz4zJYpu9MReXZezC3Io28vvRto5p7aX7FoSSbcZvDIGL0nt 5dI9axk6pn8EaFr3uNp8xCEAhIcw0UnfdRZFgUPGT2DZmsDDcZAdYja3st1V0vYctYFP dajGRtmEJLSXwWQr4Gv2wOadhGJUx4+GPVs3m/fxz30jpdq7RFPC1hd4oCbkDrq0XUCk ssdKLjGYum2OIRUyGwq9fNRGiyXmPJnDpVX+c3dURCMj1Cgst40d1YYn9Tl6VkmyfFIe sfbpjnerBjueTy/tDowBxqMYGZooGjFaDreP5ZxQE1w0hYfWIpJNWIsUC/vFzQiPirPZ N/9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=KkHy6mA3pj8grul28XzY4RmWc6Mb7v+/Ju0g64BUCUw=; b=MyjpKllFiq6vMkPM34WhjQQYIrjEiumqxMIk5njmCG3z7M/TLRc2QPAEsUlhoZt0FW zXAZdcS/cY6Dd7qkzi83LF2l/yFbrDCFhheowqAwgOEU9GdPGhc8InoYEeq7kuz1EnId 1S3+t9qTUcJjiLiBeOSTy+2QvrTbmbly9aQ2Eiy+FyhF5cNtqfi5/fFUeveB5CsfTDzM d8aaSeebynWTKuv5qN1rp9plTANO8POeQfATgOjit3ljMMSop0lpsR8AaBNtgpq7G1Yf tbwyG3bhW6sSO2oLrMMe67hEN9vwaJ6GuPpB8BVuPaYc3+5C0P3rQf6hkmnIUpGPYrfX 52QA== X-Gm-Message-State: AD7BkJJOP2+JS02rGHakSqd++N2xbcYIFYZ1Ewro/xw/NUJACXSeyE1rCBZeqJ99v2Pq1V4LyGnv6LMFj2WGGA== MIME-Version: 1.0 X-Received: by 10.31.3.213 with SMTP id f82mr521574vki.27.1459457760197; Thu, 31 Mar 2016 13:56:00 -0700 (PDT) Received: by 10.176.69.227 with HTTP; Thu, 31 Mar 2016 13:56:00 -0700 (PDT) In-Reply-To: References: Date: Thu, 31 Mar 2016 16:56:00 -0400 Message-ID: Subject: Re: TreeCache not working From: Scott Blum To: Jordan Zimmerman Cc: user@curator.apache.org Content-Type: multipart/alternative; boundary=001a11426cde5c8533052f5e7d99 --001a11426cde5c8533052f5e7d99 Content-Type: text/plain; charset=UTF-8 I took a cursory look but I've never used Scala. Nothing seems obviously wrong, so I'm not sure what to say? I'm pretty sure TreeCache generally works as intended. On Thu, Mar 31, 2016 at 4:06 PM, Jordan Zimmerman < jordan@jordanzimmerman.com> wrote: > Scott, please have a look. > > On Mar 31, 2016, at 12:29 PM, Sakthipriyan Vairamani < > sakthiprofessional@gmail.com> wrote: > > I am using Apache Curator Recipes v2.10.0, with Scala 2.11.8. I want to be notified whenever there is a change (addition, deletion, and updation) in the Node I am watching. Following is the code I have, > > curatorClient = CuratorFrameworkFactory.newClient("proper Connection String"), > new ExponentialBackoffRetry(1000, 3)) > curatorClient.start() > > treeCache = new TreeCache(curatorClient, "/a") > treeCache.start() > > treeCache.getListenable.addListener(new TreeCacheListener { > override def childEvent(client: CuratorFramework, event: TreeCacheEvent): Unit = { > > event.getType match { > case TreeCacheEvent.Type.NODE_ADDED => ERROR("TreeNode added: " > + ZKPaths.getNodeFromPath(event.getData.getPath) + ", value: " > + new String(event.getData.getData)) > case TreeCacheEvent.Type.NODE_UPDATED => ERROR("TreeNode Updated: " > + ZKPaths.getNodeFromPath(event.getData.getPath) + ", value: " > + new String(event.getData.getData)) > case TreeCacheEvent.Type.NODE_REMOVED => ERROR("TreeNode Removed: " > + ZKPaths.getNodeFromPath(event.getData.getPath) + ", value: " > + new String(event.getData.getData)); > case ex: TreeCacheEvent.Type => ERROR(s"Received Event [$ex]") > } > > } > }) > > Now, the only message I get from this is > > Received Event [INITIALIZED] > > Nothing else. I tried adding nodes to /a through zkCli and also through the program (I use util-zk library for inserting). What am I missing? > > > --001a11426cde5c8533052f5e7d99 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I took a cursory look but I've never used Scala.=C2=A0= Nothing seems obviously wrong, so I'm not sure what to say?=C2=A0 I= 9;m pretty sure TreeCache generally works as intended.

On Thu, Mar 31, 2016 at 4:06 PM,= Jordan Zimmerman <jordan@jordanzimmerman.com> wrot= e:
Scott, please have a look.

On Mar 31, 2016, at 12:29 PM, Sakthipriyan Vairamani= <sakt= hiprofessional@gmail.com> wrote:

I am using =
Apache Curator Recipes v2.10.0, with Scala 2.11.8. I want to be notified wh=
enever there is a change (addition, deletion, and updation) in the Node I a=
m watching. Following is the code I have,

    curatorClient =3D CuratorFrameworkFactory.newClient("proper Connec=
tion String"),
      new ExponentialBackoffRetry(1000, 3))
    curatorClient.start()

    treeCache =3D new TreeCache(curatorClient, "/a")
    treeCache.start()

    treeCache.getListenable.addListener(new TreeCacheListener {
      override def childEvent(client: CuratorFramework, event: TreeCacheEve=
nt): Unit =3D {

        event.getType match {
          case TreeCacheEvent.Type.NODE_ADDED =3D> ERROR("TreeNode =
added: "
            + ZKPaths.getNodeFromPath(event.getData.getPath) + ", valu=
e: "
            + new String(event.getData.getData))
          case TreeCacheEvent.Type.NODE_UPDATED =3D> ERROR("TreeNod=
e Updated: "
            + ZKPaths.getNodeFromPath(event.getData.getPath) + ", valu=
e: "
            + new String(event.getData.getData))
          case TreeCacheEvent.Type.NODE_REMOVED =3D> ERROR("TreeNod=
e Removed: "
            + ZKPaths.getNodeFromPath(event.getData.getPath) + ", valu=
e: "
            + new String(event.getData.getData));
          case ex: TreeCacheEvent.Type =3D> ERROR(s"Received Event =
[$ex]")
        }

      }
    })

Now, the only message I get from this is

    Received Event [INITIALIZED]

Nothing else. I tried adding nodes to /a through zkCli and also through the=
 program (I use util-zk library for inserting). What am I missing?


--001a11426cde5c8533052f5e7d99--