From: Roy Lyseng Date: May 12 2009 6:51pm Subject: Re: MySQL Reengineering Project List-Archive: http://lists.mysql.com/internals/36647 Message-Id: <4A09C516.5080002@sun.com> MIME-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII; format=flowed Content-Transfer-Encoding: 7BIT Sergei Golubchik wrote: > 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 :) ...or many threads (not THDs) per Statement if you ever asked me. Thanks, Roy