Brian Aker wrote:
> Hi!
> 
> On Aug 3, 2008, at 10:59 PM, Mats Kindahl wrote:
> 
>> Although I don't disagree, what do you consider as an alternative to the
>> THD for keeping session data around?
> 
> THD is pretty much session data now (especially since it is no longer
> tied thread).

Cool, but does this mean the documentation is out of date?

/**
  @class THD
  For each client connection we create a separate thread with THD serving as
  a thread/connection descriptor
*/

If that comment is outdated, let us please correct! :)

Also, THD currently inherits from Statement, which represents a single
query.  Wouldn't a more appropriate relationship be one of THD
encapsulating a linked list of Statement instances, each representing a
particular query being executed in the client connection?

Similarly, there is a lot of replication stuff inside THD itself.  Could
this stuff be refactored out of THD into a true replication API.  This
would allow developers working on replication to blackbox the
replication functionality away from developers modifying/refactoring THD
down to a more reasonable size.  As long as there are accessor methods
to THD's member variables that the replication engine needs to be aware
of, I don't see a need to have THD methods like
set_current_stmt_binlog_row_based() and binlog_query().  In my mind, the
replication API should have methods to register a callback on Statement
execution which examines the query and performs necessary replication
functionality if the Statement meets requirements.

I guess I am envisioning a THD that would essentially be responsible for
doing the following (simplified) execution path:

Manage/facilitate NET communication
-> Pull in all statements from client
  -> Create a Statement for each statement recv'd from client, pop onto
stack
    -> Execute each statement
      -> Send result(s) of statement back to client
    -> Update counters/state

All other functionality would be done via callbacks notified at various
state changes in the Statement execution path...

Am I out of my mind about this?

> The biggest problem I now see with it is getting it properly encapsulated.

Yep.

> Cheers,
>     -Brian
> 
> -- 
> _______________________________________________________
> Brian "Krow" Aker, brian at tangent.org
> Seattle, Washington
> http://krow.net/                     <-- Me
> http://tangent.org/                <-- Software
> _______________________________________________________
> You can't grep a dead tree.
> 
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to