hadoop-zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (ZOOKEEPER-196) doxygen comment for state argument of watcher_fn typedef and implementation differ ("...one of the *_STATE constants, otherwise -1")
Date Thu, 11 Jun 2009 15:31:07 GMT

    [ 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.


Mime
View raw message