You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Narasimha Tadepalli <Na...@pervasive.com> on 2012/11/13 20:47:52 UTC

getChildren question.

Does anybody have any idea about importance of object parameter in this below method? What exactly it does if we provide some object? Documentation didn't provide any details about this extra parameter. Appreciate your time.



public void getChildren(String path,

                        Watcher watcher,

                        AsyncCallback.ChildrenCallback<http://zookeeper.apache.org/doc/r3.4.4/api/org/apache/zookeeper/AsyncCallback.ChildrenCallback.html> cb,

                        Object ctx)

http://zookeeper.apache.org/doc/r3.4.4/api/index.html


for example

zk.getChildren("/node/child1/subchild", watcher, childrencallback, Context.MESSAGE);


where Context is enum

private enum Context {

        MESSAGE,
        LOCK;
    }
NOTICE: All information in and attached to this email may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message.

RE: getChildren question.

Posted by Narasimha Tadepalli <Na...@pervasive.com>.
Hi Michi

Thanks a lot. That helped me a bit.

-Narasimha

-----Original Message-----
From: mutsuzaki@gmail.com [mailto:mutsuzaki@gmail.com] On Behalf Of Michi Mutsuzaki
Sent: Tuesday, November 13, 2012 2:30 PM
To: user@zookeeper.apache.org
Cc: zookeeper-user@hadoop.apache.org; dev@zookeeper.apache.org
Subject: Re: getChildren question.

Hi Narasimha,

It's an opaque object. Zookeeper client doesn't do anything with it, except that it's passed back to the callback. It's useful when you need to pass some kind of context to the callback.

--Michi

On Tue, Nov 13, 2012 at 11:47 AM, Narasimha Tadepalli <Na...@pervasive.com> wrote:
> Does anybody have any idea about importance of object parameter in this below method? What exactly it does if we provide some object? Documentation didn't provide any details about this extra parameter. Appreciate your time.
>
>
>
> public void getChildren(String path,
>
>                         Watcher watcher,
>
>
> AsyncCallback.ChildrenCallback<http://zookeeper.apache.org/doc/r3.4.4/
> api/org/apache/zookeeper/AsyncCallback.ChildrenCallback.html> cb,
>
>                         Object ctx)
>
> http://zookeeper.apache.org/doc/r3.4.4/api/index.html
>
>
> for example
>
> zk.getChildren("/node/child1/subchild", watcher, childrencallback,
> Context.MESSAGE);
>
>
> where Context is enum
>
> private enum Context {
>
>         MESSAGE,
>         LOCK;
>     }
> NOTICE: All information in and attached to this email may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message.

NOTICE: All information in and attached to this email may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message.


RE: getChildren question.

Posted by Narasimha Tadepalli <Na...@pervasive.com>.
Hi Michi

Thanks a lot. That helped me a bit.

-Narasimha

-----Original Message-----
From: mutsuzaki@gmail.com [mailto:mutsuzaki@gmail.com] On Behalf Of Michi Mutsuzaki
Sent: Tuesday, November 13, 2012 2:30 PM
To: user@zookeeper.apache.org
Cc: zookeeper-user@hadoop.apache.org; dev@zookeeper.apache.org
Subject: Re: getChildren question.

Hi Narasimha,

It's an opaque object. Zookeeper client doesn't do anything with it, except that it's passed back to the callback. It's useful when you need to pass some kind of context to the callback.

--Michi

On Tue, Nov 13, 2012 at 11:47 AM, Narasimha Tadepalli <Na...@pervasive.com> wrote:
> Does anybody have any idea about importance of object parameter in this below method? What exactly it does if we provide some object? Documentation didn't provide any details about this extra parameter. Appreciate your time.
>
>
>
> public void getChildren(String path,
>
>                         Watcher watcher,
>
>
> AsyncCallback.ChildrenCallback<http://zookeeper.apache.org/doc/r3.4.4/
> api/org/apache/zookeeper/AsyncCallback.ChildrenCallback.html> cb,
>
>                         Object ctx)
>
> http://zookeeper.apache.org/doc/r3.4.4/api/index.html
>
>
> for example
>
> zk.getChildren("/node/child1/subchild", watcher, childrencallback,
> Context.MESSAGE);
>
>
> where Context is enum
>
> private enum Context {
>
>         MESSAGE,
>         LOCK;
>     }
> NOTICE: All information in and attached to this email may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message.

NOTICE: All information in and attached to this email may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message.


Re: getChildren question.

Posted by Michi Mutsuzaki <mi...@cs.stanford.edu>.
Hi Narasimha,

It's an opaque object. Zookeeper client doesn't do anything with it,
except that it's passed back to the callback. It's useful when you
need to pass some kind of context to the callback.

--Michi

On Tue, Nov 13, 2012 at 11:47 AM, Narasimha Tadepalli
<Na...@pervasive.com> wrote:
> Does anybody have any idea about importance of object parameter in this below method? What exactly it does if we provide some object? Documentation didn't provide any details about this extra parameter. Appreciate your time.
>
>
>
> public void getChildren(String path,
>
>                         Watcher watcher,
>
>                         AsyncCallback.ChildrenCallback<http://zookeeper.apache.org/doc/r3.4.4/api/org/apache/zookeeper/AsyncCallback.ChildrenCallback.html> cb,
>
>                         Object ctx)
>
> http://zookeeper.apache.org/doc/r3.4.4/api/index.html
>
>
> for example
>
> zk.getChildren("/node/child1/subchild", watcher, childrencallback, Context.MESSAGE);
>
>
> where Context is enum
>
> private enum Context {
>
>         MESSAGE,
>         LOCK;
>     }
> NOTICE: All information in and attached to this email may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message.

Re: getChildren question.

Posted by Michi Mutsuzaki <mi...@cs.stanford.edu>.
Hi Narasimha,

It's an opaque object. Zookeeper client doesn't do anything with it,
except that it's passed back to the callback. It's useful when you
need to pass some kind of context to the callback.

--Michi

On Tue, Nov 13, 2012 at 11:47 AM, Narasimha Tadepalli
<Na...@pervasive.com> wrote:
> Does anybody have any idea about importance of object parameter in this below method? What exactly it does if we provide some object? Documentation didn't provide any details about this extra parameter. Appreciate your time.
>
>
>
> public void getChildren(String path,
>
>                         Watcher watcher,
>
>                         AsyncCallback.ChildrenCallback<http://zookeeper.apache.org/doc/r3.4.4/api/org/apache/zookeeper/AsyncCallback.ChildrenCallback.html> cb,
>
>                         Object ctx)
>
> http://zookeeper.apache.org/doc/r3.4.4/api/index.html
>
>
> for example
>
> zk.getChildren("/node/child1/subchild", watcher, childrencallback, Context.MESSAGE);
>
>
> where Context is enum
>
> private enum Context {
>
>         MESSAGE,
>         LOCK;
>     }
> NOTICE: All information in and attached to this email may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message.