Hi, Jay!
On May 12, Jay Pipes wrote:
>> However, do you know of any other interfaces that work this way? I am
>> personally not aware of any other, but then I don't know every corner
>> of the code like Serg does. :)
>
> "External" interfaces? See all the plugin "interfaces". There's no
> enforcement of types really at all. Just passing void *'s around.
Where ? Plugin interfaces don't pass void* around much.
They do it in two places (that I remember out of my head):
- init() function. Brian added that to pass handlerton down.
it is ignored by any clean plugin API and should've been done
differently for storage engines and I_S tables.
- MYSQL_THD is defined as void*, which is fine as it's an opaque
pointer, plugins are never expected to look inside to cast it to
anything.
> As for the internal interfaces, I would suggest cleaning up the class
> interfaces of THD, JOIN, and other major classes to enforce public
> accessors and getters, protecting private member variables behind a clean
> API. This would, eventually, make some of these classes semi-usable in
> public interfaces.
We don't have public interfaces for them (besides few thd_* accessors
functions) in plugin.h. And doubt that we want to have them.
We're working on new APIs to access these objects, instead of putting
lipstick on old ones.
> Another thing to think about in your refactoring efforts is detaching the
> THD from its current inheritance from Statement, Query_arena and ilink.
> Without doing this, and using encapsulation so that a THD can have multiple
> Statements, it will be very difficult to work on any future parallelization
> efforts.
You mean, a Statement can have multiple THDs, I suppose :)
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring