David

David Teigland wrote:
> On Tue, Aug 18, 2009 at 06:09:38PM +0200, Jan Friesse wrote:
>> This feature should allow app to get cpg groups and members. It's
>> modeled like ckpt section iteration, so:
> 
> Thanks! I've been waiting a long time for this (the same is needed for various
> other things in corosync+openais).  I hope you'll also add a command line tool
> that uses this API to report all cpgs and their members.  You may also want to

It's part of bugzilla, so yes, there will be command line tool (I'm not
exactly sure what it will be able to do, yet) so I will send some DRAFT
what's my ideas and I will be very happy to see another ideas.

> add an API to query state/status/info about a particular cpg (querying the
> members is the most important, but eventually we'll probably want more info
> about each cpg.)

What kind of info do you mean? Because in reality, what we have about
cpg is just members and nothing more. Of course, this can be enhanced.

> 
> I'm not fond of the iteration-style API, although it may have some advantages
> in theory.  When writing these API's I generally do something like this (see
> libdlmcontrol for a specific example):
> 
>  get_groups(int max, int *count, struct group *groups);
>  get_group_members(char *name, int max, int *count, struct member *members);
>  get_group_info(char *name, struct group_info &info);
> 
> "max" is the number of slots the user is providing in *groups or *members.
> If that's not enough, then -E2BIG is returned in *count so the caller can
> call again with more space.  Otherwise, the number of slots filled in is
> returned in *count.

Ya, this looks nice (fewer calls to get result, ...), but I'm trying to
follow "Rule of Least Surprise" and because AIS standard use everywhere
iteration, I think it's good idea to use it in cpg too.

> 
> Dave
> 

Regards,
  Honza
_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to