Re: question about watcher

2010-11-03 Thread Qian Ye
thanks Patrick, I want to know all watches set by all clients.
I would open a jira and write some design think about it later.

On Tue, Nov 2, 2010 at 11:53 PM, Patrick Hunt ph...@apache.org wrote:

 Hi Qian Ye, yes you should open a JIRA for this. If you want to work
 on a patch we could advise you. One thing not clear to me, are you
 interested in just the watches set by the particular client, or all
 watches set by all clients? The first should be relatively easy to
 get, the second would be more involved (the difference btw getting
 local watches and having to talk to the server to get all watches).
 Does this have to be a client api or more administrative in nature?
 Also see
 http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html#sc_zkCommands
 specifically the wchs,wchp,wchs 4 letter words.

 Regards,

 Patrick

 On Tue, Nov 2, 2010 at 4:11 AM, Qian Ye yeqian@gmail.com wrote:
  Hi all,
 
  Is there any progress about this issue? Should we open a new JIRA for it?
 We
  really need a way to know who set watchers on a specific node.
 
  thanks~
 
  On Thu, Aug 6, 2009 at 11:01 PM, Qian Ye yeqian@gmail.com wrote:
 
  Thanks Mahadev, I think it is a useful feature for many scenarios.
 
 
  On Thu, Aug 6, 2009 at 12:59 PM, Mahadev Konar maha...@yahoo-inc.com
 wrote:
 
  Hi Qian,
   There isnt any such api. We have been thinking abt adding an api on
  cancelling a cleints watches. We have been thinking about adding a proc
  filesystem wherein a cleintt will have a list of all the watches. This
  data
  can be used to know which clients are watching what znode, but this has
  always been in the future discussions for us. We DO NOT have anything
  planned in the near future for this.
 
  Thanks
  mahadev
 
 
  On 8/5/09 6:57 PM, Qian Ye yeqian@gmail.com wrote:
 
   Hi all:
  
   Is there a client API for querying the watchers' owner for a specific
  znode?
   In some situation, we want to find out who set watchers on the znode.
  
   thx
 
 
 
 
  --
  With Regards!
 
  Ye, Qian
  Made in Zhejiang University
 
 
 
 
  --
  With Regards!
 
  Ye, Qian
 




-- 
With Regards!

Ye, Qian


Re: question about watcher

2010-11-03 Thread Patrick Hunt
Definitely checkout the 4letter words then (wch*). Keep in mind
getting this data may be expensive (if there's alot of it) and that
watches are locak, so servers only know about the watches from
sessions est through it (server 1 doesn't know about watches of
sessions connected on server 2, 3, etc...).

Patrick

On Wed, Nov 3, 2010 at 1:13 AM, Qian Ye yeqian@gmail.com wrote:
 thanks Patrick, I want to know all watches set by all clients.
 I would open a jira and write some design think about it later.

 On Tue, Nov 2, 2010 at 11:53 PM, Patrick Hunt ph...@apache.org wrote:

 Hi Qian Ye, yes you should open a JIRA for this. If you want to work
 on a patch we could advise you. One thing not clear to me, are you
 interested in just the watches set by the particular client, or all
 watches set by all clients? The first should be relatively easy to
 get, the second would be more involved (the difference btw getting
 local watches and having to talk to the server to get all watches).
 Does this have to be a client api or more administrative in nature?
 Also see
 http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html#sc_zkCommands
 specifically the wchs,wchp,wchs 4 letter words.

 Regards,

 Patrick

 On Tue, Nov 2, 2010 at 4:11 AM, Qian Ye yeqian@gmail.com wrote:
  Hi all,
 
  Is there any progress about this issue? Should we open a new JIRA for it?
 We
  really need a way to know who set watchers on a specific node.
 
  thanks~
 
  On Thu, Aug 6, 2009 at 11:01 PM, Qian Ye yeqian@gmail.com wrote:
 
  Thanks Mahadev, I think it is a useful feature for many scenarios.
 
 
  On Thu, Aug 6, 2009 at 12:59 PM, Mahadev Konar maha...@yahoo-inc.com
 wrote:
 
  Hi Qian,
   There isnt any such api. We have been thinking abt adding an api on
  cancelling a cleints watches. We have been thinking about adding a proc
  filesystem wherein a cleintt will have a list of all the watches. This
  data
  can be used to know which clients are watching what znode, but this has
  always been in the future discussions for us. We DO NOT have anything
  planned in the near future for this.
 
  Thanks
  mahadev
 
 
  On 8/5/09 6:57 PM, Qian Ye yeqian@gmail.com wrote:
 
   Hi all:
  
   Is there a client API for querying the watchers' owner for a specific
  znode?
   In some situation, we want to find out who set watchers on the znode.
  
   thx
 
 
 
 
  --
  With Regards!
 
  Ye, Qian
  Made in Zhejiang University
 
 
 
 
  --
  With Regards!
 
  Ye, Qian
 




 --
 With Regards!

 Ye, Qian



Re: question about watcher

2010-11-02 Thread Qian Ye
Hi all,

Is there any progress about this issue? Should we open a new JIRA for it? We
really need a way to know who set watchers on a specific node.

thanks~

On Thu, Aug 6, 2009 at 11:01 PM, Qian Ye yeqian@gmail.com wrote:

 Thanks Mahadev, I think it is a useful feature for many scenarios.


 On Thu, Aug 6, 2009 at 12:59 PM, Mahadev Konar maha...@yahoo-inc.comwrote:

 Hi Qian,
  There isnt any such api. We have been thinking abt adding an api on
 cancelling a cleints watches. We have been thinking about adding a proc
 filesystem wherein a cleintt will have a list of all the watches. This
 data
 can be used to know which clients are watching what znode, but this has
 always been in the future discussions for us. We DO NOT have anything
 planned in the near future for this.

 Thanks
 mahadev


 On 8/5/09 6:57 PM, Qian Ye yeqian@gmail.com wrote:

  Hi all:
 
  Is there a client API for querying the watchers' owner for a specific
 znode?
  In some situation, we want to find out who set watchers on the znode.
 
  thx




 --
 With Regards!

 Ye, Qian
 Made in Zhejiang University




-- 
With Regards!

Ye, Qian


Re: question about watcher

2010-11-02 Thread Patrick Hunt
Hi Qian Ye, yes you should open a JIRA for this. If you want to work
on a patch we could advise you. One thing not clear to me, are you
interested in just the watches set by the particular client, or all
watches set by all clients? The first should be relatively easy to
get, the second would be more involved (the difference btw getting
local watches and having to talk to the server to get all watches).
Does this have to be a client api or more administrative in nature?
Also see 
http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html#sc_zkCommands
specifically the wchs,wchp,wchs 4 letter words.

Regards,

Patrick

On Tue, Nov 2, 2010 at 4:11 AM, Qian Ye yeqian@gmail.com wrote:
 Hi all,

 Is there any progress about this issue? Should we open a new JIRA for it? We
 really need a way to know who set watchers on a specific node.

 thanks~

 On Thu, Aug 6, 2009 at 11:01 PM, Qian Ye yeqian@gmail.com wrote:

 Thanks Mahadev, I think it is a useful feature for many scenarios.


 On Thu, Aug 6, 2009 at 12:59 PM, Mahadev Konar maha...@yahoo-inc.comwrote:

 Hi Qian,
  There isnt any such api. We have been thinking abt adding an api on
 cancelling a cleints watches. We have been thinking about adding a proc
 filesystem wherein a cleintt will have a list of all the watches. This
 data
 can be used to know which clients are watching what znode, but this has
 always been in the future discussions for us. We DO NOT have anything
 planned in the near future for this.

 Thanks
 mahadev


 On 8/5/09 6:57 PM, Qian Ye yeqian@gmail.com wrote:

  Hi all:
 
  Is there a client API for querying the watchers' owner for a specific
 znode?
  In some situation, we want to find out who set watchers on the znode.
 
  thx




 --
 With Regards!

 Ye, Qian
 Made in Zhejiang University




 --
 With Regards!

 Ye, Qian



Re: A question about Watcher

2010-08-17 Thread Patrick Hunt
All servers keep a copy - so you can shutdown the zk service entirely 
(all servers) and restart it and the sessions are maintained.


Patrick

On 08/16/2010 06:34 PM, Qian Ye wrote:

Thx Mahadev and Benjamin, it seems that I've got some misunderstanding about
the client. I will check it out.

Another relevant question. I noticed that the master zookeeper server keep a
track of all the client session which connects to every zookeeper server in
the same cluster. So when a slave zookeeper server failed, the clients it
served, can switch to another zookeeper server and keep their old session
(the new zookeeper server can get the session information from the master).
My question is, if the master failed, does that means some session
information will definitely be lost?

thx~

On Tue, Aug 17, 2010 at 12:40 AM, Benjamin Reedbr...@yahoo-inc.com  wrote:


the client does keep track of the watches that it has outstanding. when it
reconnects to a new server it tells the server what it is watching for and
the last view of the system that it had.

ben


On 08/16/2010 09:28 AM, Qian Ye wrote:


thx for explaination. Since the watcher can be preserved when the client
switch the zookeeper server it connects to, does that means all the
watchers
information will be saved on all the zookeeper servers? I didn't find any
source of the client can hold the watchers information.


On Tue, Aug 17, 2010 at 12:21 AM, Ted Dunningted.dunn...@gmail.com
  wrote:




I should correct this.  The watchers will deliver a session expiration
event, but since the connection is closed at that point no further
events will be delivered and the cluster will remove them.  This is as
good
as the watchers disappearing.

On Mon, Aug 16, 2010 at 9:20 AM, Ted Dunningted.dunn...@gmail.com
wrote:




The other is session expiration.  Watchers do not survive this.  This
happens when a client does not provide timely
evidence that it is alive and is marked as having disappeared by the
cluster.



















A question about Watcher

2010-08-16 Thread Qian Ye
Hi all:

Will the watchers of a client be losed when the client disconnects from a
Zookeeper server? It is said at
http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkWatchesthat

*When a client reconnects, any previously registered watches will be
reregistered and triggered if needed. In general this all occurs
transparently.* It means that we need not to do any extra things about
watchers if a client disconnected from Zookeeper server A, and reconnect to
Zookeeper server B, doesn't it? Or I should reregistered all the watchers if
this kind of reconnection happened?

thx~
-- 
With Regards!

Ye, Qian


Re: A question about Watcher

2010-08-16 Thread Ted Dunning
There are two different concepts.  One is connection loss.  Watchers survive
this and the client automatically connects
to another member of the ZK cluster.

The other is session expiration.  Watchers do not survive this.  This
happens when a client does not provide timely
evidence that it is alive and is marked as having disappeared by the
cluster.

On Mon, Aug 16, 2010 at 9:04 AM, Qian Ye yeqian@gmail.com wrote:

 Hi all:

 Will the watchers of a client be losed when the client disconnects from a
 Zookeeper server? It is said at

 http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkWatchesthat
 
 *When a client reconnects, any previously registered watches will be
 reregistered and triggered if needed. In general this all occurs
 transparently.* It means that we need not to do any extra things about
 watchers if a client disconnected from Zookeeper server A, and reconnect to
 Zookeeper server B, doesn't it? Or I should reregistered all the watchers
 if
 this kind of reconnection happened?

 thx~
 --
 With Regards!

 Ye, Qian



Re: A question about Watcher

2010-08-16 Thread Benjamin Reed
zookeeper takes care of reregistering all watchers on reconnect. you 
don't need to do anything.


ben

On 08/16/2010 09:04 AM, Qian Ye wrote:

Hi all:

Will the watchers of a client be losed when the client disconnects from a
Zookeeper server? It is said at
http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkWatchesthat

*When a client reconnects, any previously registered watches will be
reregistered and triggered if needed. In general this all occurs
transparently.* It means that we need not to do any extra things about
watchers if a client disconnected from Zookeeper server A, and reconnect to
Zookeeper server B, doesn't it? Or I should reregistered all the watchers if
this kind of reconnection happened?

thx~
   




Re: A question about Watcher

2010-08-16 Thread Ted Dunning
I should correct this.  The watchers will deliver a session expiration
event, but since the connection is closed at that point no further
events will be delivered and the cluster will remove them.  This is as good
as the watchers disappearing.

On Mon, Aug 16, 2010 at 9:20 AM, Ted Dunning ted.dunn...@gmail.com wrote:

 The other is session expiration.  Watchers do not survive this.  This
 happens when a client does not provide timely
 evidence that it is alive and is marked as having disappeared by the
 cluster.



Re: A question about Watcher

2010-08-16 Thread Benjamin Reed

good point ted! i should have waited a bit longer before responding :)

ben

On 08/16/2010 09:20 AM, Ted Dunning wrote:

There are two different concepts.  One is connection loss.  Watchers survive
this and the client automatically connects
to another member of the ZK cluster.

The other is session expiration.  Watchers do not survive this.  This
happens when a client does not provide timely
evidence that it is alive and is marked as having disappeared by the
cluster.

On Mon, Aug 16, 2010 at 9:04 AM, Qian Yeyeqian@gmail.com  wrote:

   

Hi all:

Will the watchers of a client be losed when the client disconnects from a
Zookeeper server? It is said at

http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkWatchesthat

*When a client reconnects, any previously registered watches will be
reregistered and triggered if needed. In general this all occurs
transparently.* It means that we need not to do any extra things about
watchers if a client disconnected from Zookeeper server A, and reconnect to
Zookeeper server B, doesn't it? Or I should reregistered all the watchers
if
this kind of reconnection happened?

thx~
--
With Regards!

Ye, Qian

 




Re: A question about Watcher

2010-08-16 Thread Qian Ye
thx for explaination. Since the watcher can be preserved when the client
switch the zookeeper server it connects to, does that means all the watchers
information will be saved on all the zookeeper servers? I didn't find any
source of the client can hold the watchers information.


On Tue, Aug 17, 2010 at 12:21 AM, Ted Dunning ted.dunn...@gmail.com wrote:

 I should correct this.  The watchers will deliver a session expiration
 event, but since the connection is closed at that point no further
 events will be delivered and the cluster will remove them.  This is as good
 as the watchers disappearing.

 On Mon, Aug 16, 2010 at 9:20 AM, Ted Dunning ted.dunn...@gmail.com
 wrote:

  The other is session expiration.  Watchers do not survive this.  This
  happens when a client does not provide timely
  evidence that it is alive and is marked as having disappeared by the
  cluster.
 




-- 
With Regards!

Ye, Qian


Re: A question about Watcher

2010-08-16 Thread Mahadev Konar
Hi Qian,
 The watcher information is saved at the client, and the client will
reattach the watches to the new server it connects to.
  Hope that helps.

Thanks
mahadev


On 8/16/10 9:28 AM, Qian Ye yeqian@gmail.com wrote:

 thx for explaination. Since the watcher can be preserved when the client
 switch the zookeeper server it connects to, does that means all the watchers
 information will be saved on all the zookeeper servers? I didn't find any
 source of the client can hold the watchers information.
 
 
 On Tue, Aug 17, 2010 at 12:21 AM, Ted Dunning ted.dunn...@gmail.com wrote:
 
 I should correct this.  The watchers will deliver a session expiration
 event, but since the connection is closed at that point no further
 events will be delivered and the cluster will remove them.  This is as good
 as the watchers disappearing.
 
 On Mon, Aug 16, 2010 at 9:20 AM, Ted Dunning ted.dunn...@gmail.com
 wrote:
 
 The other is session expiration.  Watchers do not survive this.  This
 happens when a client does not provide timely
 evidence that it is alive and is marked as having disappeared by the
 cluster.
 
 
 
 
 
 --
 With Regards!
 
 Ye, Qian
 



Re: A question about Watcher

2010-08-16 Thread Benjamin Reed
the client does keep track of the watches that it has outstanding. when 
it reconnects to a new server it tells the server what it is watching 
for and the last view of the system that it had.


ben

On 08/16/2010 09:28 AM, Qian Ye wrote:

thx for explaination. Since the watcher can be preserved when the client
switch the zookeeper server it connects to, does that means all the watchers
information will be saved on all the zookeeper servers? I didn't find any
source of the client can hold the watchers information.


On Tue, Aug 17, 2010 at 12:21 AM, Ted Dunningted.dunn...@gmail.com  wrote:

   

I should correct this.  The watchers will deliver a session expiration
event, but since the connection is closed at that point no further
events will be delivered and the cluster will remove them.  This is as good
as the watchers disappearing.

On Mon, Aug 16, 2010 at 9:20 AM, Ted Dunningted.dunn...@gmail.com
wrote:

 

The other is session expiration.  Watchers do not survive this.  This
happens when a client does not provide timely
evidence that it is alive and is marked as having disappeared by the
cluster.

   
 



   




Re: A question about Watcher

2010-08-16 Thread Qian Ye
Thx Mahadev and Benjamin, it seems that I've got some misunderstanding about
the client. I will check it out.

Another relevant question. I noticed that the master zookeeper server keep a
track of all the client session which connects to every zookeeper server in
the same cluster. So when a slave zookeeper server failed, the clients it
served, can switch to another zookeeper server and keep their old session
(the new zookeeper server can get the session information from the master).
My question is, if the master failed, does that means some session
information will definitely be lost?

thx~

On Tue, Aug 17, 2010 at 12:40 AM, Benjamin Reed br...@yahoo-inc.com wrote:

 the client does keep track of the watches that it has outstanding. when it
 reconnects to a new server it tells the server what it is watching for and
 the last view of the system that it had.

 ben


 On 08/16/2010 09:28 AM, Qian Ye wrote:

 thx for explaination. Since the watcher can be preserved when the client
 switch the zookeeper server it connects to, does that means all the
 watchers
 information will be saved on all the zookeeper servers? I didn't find any
 source of the client can hold the watchers information.


 On Tue, Aug 17, 2010 at 12:21 AM, Ted Dunningted.dunn...@gmail.com
  wrote:



 I should correct this.  The watchers will deliver a session expiration
 event, but since the connection is closed at that point no further
 events will be delivered and the cluster will remove them.  This is as
 good
 as the watchers disappearing.

 On Mon, Aug 16, 2010 at 9:20 AM, Ted Dunningted.dunn...@gmail.com
 wrote:



 The other is session expiration.  Watchers do not survive this.  This
 happens when a client does not provide timely
 evidence that it is alive and is marked as having disappeared by the
 cluster.













-- 
With Regards!

Ye, Qian


Re: A question about Watcher

2010-08-16 Thread Ted Dunning
Almost never.  There was a bug a while back that could have conceivably
caused that under rare circumstances, but I don't know of any current
mechanism for this lossage that you are asking about.

On Mon, Aug 16, 2010 at 6:34 PM, Qian Ye yeqian@gmail.com wrote:

 My question is, if the master failed, does that means some session
 information will definitely be lost?



Re: question about watcher

2009-08-06 Thread Qian Ye
Thanks Mahadev, I think it is a useful feature for many scenarios.

On Thu, Aug 6, 2009 at 12:59 PM, Mahadev Konar maha...@yahoo-inc.comwrote:

 Hi Qian,
  There isnt any such api. We have been thinking abt adding an api on
 cancelling a cleints watches. We have been thinking about adding a proc
 filesystem wherein a cleintt will have a list of all the watches. This data
 can be used to know which clients are watching what znode, but this has
 always been in the future discussions for us. We DO NOT have anything
 planned in the near future for this.

 Thanks
 mahadev


 On 8/5/09 6:57 PM, Qian Ye yeqian@gmail.com wrote:

  Hi all:
 
  Is there a client API for querying the watchers' owner for a specific
 znode?
  In some situation, we want to find out who set watchers on the znode.
 
  thx




-- 
With Regards!

Ye, Qian
Made in Zhejiang University


Re: question about watcher

2009-08-05 Thread Mahadev Konar
Hi Qian,
 There isnt any such api. We have been thinking abt adding an api on
cancelling a cleints watches. We have been thinking about adding a proc
filesystem wherein a cleintt will have a list of all the watches. This data
can be used to know which clients are watching what znode, but this has
always been in the future discussions for us. We DO NOT have anything
planned in the near future for this.

Thanks
mahadev


On 8/5/09 6:57 PM, Qian Ye yeqian@gmail.com wrote:

 Hi all:
 
 Is there a client API for querying the watchers' owner for a specific znode?
 In some situation, we want to find out who set watchers on the znode.
 
 thx