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 B158D19601 for ; Thu, 31 Mar 2016 17:30:07 +0000 (UTC) Received: (qmail 6919 invoked by uid 500); 31 Mar 2016 17:30:07 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 6872 invoked by uid 500); 31 Mar 2016 17:30:07 -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 6862 invoked by uid 99); 31 Mar 2016 17:30:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2016 17:30:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 101C1C1B55 for ; Thu, 31 Mar 2016 17:30:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 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_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 5SAVBmchJkwJ for ; Thu, 31 Mar 2016 17:30:06 +0000 (UTC) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 182F85F217 for ; Thu, 31 Mar 2016 17:30:06 +0000 (UTC) Received: by mail-yw0-f181.google.com with SMTP id h129so106532459ywb.1 for ; Thu, 31 Mar 2016 10:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=jmzQ32h/3i08cH3z8R/M+a5zIs+Z5oRB+JdjSJ1SZPs=; b=TXvv+sKNxo0ML8cxDN5AOl8amosf+jJNYgGvhn/Vuk/4PhEx4vSsnm2FkGVnv/kGv+ BvePixs/4rTXcCzv3zZe7xWTGGyCLhk9qRnsR7GDHpeGZhsi+fgdHaWELJxI7/+XlwAp 2BfdxS5hrYGPaiLkr9CpN9/TNAdTAlawGazgxBHP1tG20HW+6p2s1gJ2ogXsg2sFECXs AE9bKYlkyVU2/DuIPEECHmN4Pm5fd0XYAYfbwn2RakaSVs/40CiUO7VnyJLlUaYu4RWx Tvh2tvnrH1OnJCYWimE/RWL/TQWhedUqM4vZfozRh3SBqHPOCwBL8ukhS2sVYdPbo7yb G1Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jmzQ32h/3i08cH3z8R/M+a5zIs+Z5oRB+JdjSJ1SZPs=; b=alENxpTUIm6B0nKfMlVj62IWpdtltrJ5QnfOa0xXlAX6B2ZetZOQHzivI78hwBm2B5 UL4NaQaQB3jcObqjwg6O1upTbfR9krx141J2wvYi/1O39xc/Bek3ug2pkAyzXieT/N+h sxSt8u2in5ME0yITjHfMGKb65k6LLk95UKVinfyhl5Ub5lgPTFpMc8RTco9aioG8Pmzy KVwI1+WgWA5iEbfb/rVEts1KUdx8chC1GYnAEfXDusC0KFNKd2r6QsiYFQaFSVD9Nr4D dorKQnkT++u8ZTs7COMcHeNWl3WhBINlbmJBcUpUbQFfwnVeRZKRCzyvHr0cSiWZSFLu xkpg== X-Gm-Message-State: AD7BkJL2kDnD4FSr7FyLoi2WuB/iHA3Fmv3IfcPGHTxjEmCMvzql7ojEgHNr/u5FGpVPeV1DMyswJER671D4gg== X-Received: by 10.129.121.142 with SMTP id u136mr624205ywc.269.1459445405543; Thu, 31 Mar 2016 10:30:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.19.214 with HTTP; Thu, 31 Mar 2016 10:29:46 -0700 (PDT) From: Sakthipriyan Vairamani Date: Thu, 31 Mar 2016 22:59:46 +0530 Message-ID: Subject: TreeCache not working To: user@curator.apache.org Content-Type: multipart/alternative; boundary=94eb2c0a7ce2f77de5052f5b9c03 --94eb2c0a7ce2f77de5052f5b9c03 Content-Type: text/plain; charset=UTF-8 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? --94eb2c0a7ce2f77de5052f5b9c03 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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, d=
eletion, and updation) in the Node I am watching. Following is the code I h=
ave,

    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?
--94eb2c0a7ce2f77de5052f5b9c03--