[pybsddb] bdb replica node problem

Davies Liu davies.liu at gmail.com
Thu May 29 03:39:27 CEST 2008


just like:

env.key = value

On Thu, May 29, 2008 at 9:26 AM, Yingbo Qiu <qiuyingbo at gmail.com> wrote:

> BTW: I think pybsddb's DBEnv object should supply a method to assign
> some private item value.
>
> I have to use global variable to pass it into event_callback function.
>
> for example: db-4.7.25/examples_c/ex_rep/mgr/rep_mgr.c
>
> static void
> event_callback(dbenv, which, info)
>    DB_ENV *dbenv;
>    u_int32_t which;
>    void *info;
> {
>    APP_DATA *app = dbenv->app_private;
>    SHARED_DATA *shared = &app->shared_data;
>
>    info = NULL;                /* Currently unused. */
>
>    switch (which) {
>    case DB_EVENT_REP_CLIENT:
>        shared->is_master = 0;
>        break;
>
>    case DB_EVENT_REP_MASTER:
>        shared->is_master = 1;
>        break;
> ....
>
> With pybsddb, programmer just set "shared" to a global variable. :(
> _______________________________________________
> pybsddb mailing list
> pybsddb at argo.es
> http://mailman.argo.es/listinfo/pybsddb
> http://www.argo.es/~jcea/programacion/pybsddb.htm<http://www.argo.es/%7Ejcea/programacion/pybsddb.htm>
>



-- 
Best regards,

Davies Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20080529/696cd729/attachment.htm>


More information about the pybsddb mailing list