You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Maxim P. Dementiev (JIRA)" <ji...@apache.org> on 2008/10/20 14:13:44 UTC

[jira] Created: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
------------------------------------------------------------------------------------------------------------------------------------

                 Key: ZOOKEEPER-196
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
             Project: Zookeeper
          Issue Type: Bug
         Environment: Linux
            Reporter: Maxim P. Dementiev


In zookeeper.h:
 * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
 * will be one of the *_STATE constants, otherwise -1.
but for this sequence:
 1. zoo_awexists(name)
 2. zoo_acreate(name)
we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1

I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).

And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?

I wonder if there are any plans to split current watcher_fn callback to something like:
1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-196:
------------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

I just committed this. thanks ben.

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>            Assignee: Benjamin Reed
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-196.patch
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Reed reassigned ZOOKEEPER-196:
---------------------------------------

    Assignee: Benjamin Reed

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>            Assignee: Benjamin Reed
>             Fix For: 3.2.0
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Reed updated ZOOKEEPER-196:
------------------------------------

    Status: Patch Available  (was: Open)

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>            Assignee: Benjamin Reed
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-196.patch
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715793#action_12715793 ] 

Hadoop QA commented on ZOOKEEPER-196:
-------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12409690/ZOOKEEPER-196.patch
  against trunk revision 781173.

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no tests are needed for this patch.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/100/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/100/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/100/console

This message is automatically generated.

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>            Assignee: Benjamin Reed
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-196.patch
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Maxim P. Dementiev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maxim P. Dementiev updated ZOOKEEPER-196:
-----------------------------------------

    Component/s: c client

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Reed updated ZOOKEEPER-196:
------------------------------------

    Attachment: ZOOKEEPER-196.patch

fixed this problem and another problem that stated that watches get removed on disconnect.

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>            Assignee: Benjamin Reed
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-196.patch
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-196:
------------------------------------

    Fix Version/s:     (was: 3.1.0)
                   3.2.0

moving it to 3.2

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>             Fix For: 3.2.0
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718512#action_12718512 ] 

Hudson commented on ZOOKEEPER-196:
----------------------------------

Integrated in ZooKeeper-trunk #343 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/343/])
    

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>            Assignee: Benjamin Reed
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-196.patch
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-196:
-----------------------------------

    Fix Version/s: 3.1.0

> doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-196
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-196
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client
>         Environment: Linux
>            Reporter: Maxim P. Dementiev
>             Fix For: 3.1.0
>
>
> In zookeeper.h:
>  * \param state connection state. If the type is ZOO_SESSION_EVENT, the state value 
>  * will be one of the *_STATE constants, otherwise -1.
> but for this sequence:
>  1. zoo_awexists(name)
>  2. zoo_acreate(name)
> we've got a watcher callback with type=ZOO_CREATED_EVENT and state!=-1
> I think the comment should be altered to underline the difference between zookeeper_init() callback usage and others ("the getter API functions with the "w" prefix in their names") for the new "watcher object" style.
> It looks like the type and path argument values are useless for the former (because type is always ZOO_SESSION_EVENT, and path is always empty), and the state is useless for the latter (it is considered to be -1).
> And more,  the state of the legacy style should be commented - will it be marked as obsolete? Or will it be supported in the future?
> I wonder if there are any plans to split current watcher_fn callback to something like:
> 1. new watcher_fn: typedef void (*watcher_fn)(zhandle_t *zh, int type, const char *path, void *watcherCtx);
> 2. connection_fn: typedef void (*watcher_fn)(zhandle_t *zh, int state, void *context);
> Because, you see, the usage is different and there is no any common set of arguments apart from zh (which is common for API) and context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.