diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-06-04 17:18:33 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-06-04 17:18:33 +0200 |
commit | 9df57eba9f7b9bbee19bba5e880cbf611ef82d5b (patch) | |
tree | 5bc13d213d7fda2315b958595c714c9746cbabbb /storage/connect/tabtbl.h | |
parent | 0a01953c1a6e586f286d44222f9371a46da1ac45 (diff) | |
download | mariadb-git-9df57eba9f7b9bbee19bba5e880cbf611ef82d5b.tar.gz |
- Adding parallelism to the TBL table type
modified:
storage/connect/tabcol.h
storage/connect/tabtbl.cpp
storage/connect/tabtbl.h
storage/connect/value.cpp
Diffstat (limited to 'storage/connect/tabtbl.h')
-rw-r--r-- | storage/connect/tabtbl.h | 75 |
1 files changed, 69 insertions, 6 deletions
diff --git a/storage/connect/tabtbl.h b/storage/connect/tabtbl.h index 69b862ebe4e..cdd84a1dd29 100644 --- a/storage/connect/tabtbl.h +++ b/storage/connect/tabtbl.h @@ -1,5 +1,5 @@ /*************** TabTbl H Declares Source Code File (.H) ***************/ -/* Name: TABTBL.H Version 1.2 */ +/* Name: TABTBL.H Version 1.3 */ /* */ /* (C) Copyright to the author Olivier BERTRAND 2008-2013 */ /* */ @@ -11,7 +11,29 @@ typedef class TBLDEF *PTBLDEF; typedef class TDBTBL *PTDBTBL; - +typedef class TDBTBM *PTDBTBM; +typedef class MYSQLC *PMYC; + +/***********************************************************************/
+/* Defines the structures used for distributed TBM tables. */
+/***********************************************************************/
+typedef struct _TBMtable *PTBMT;
+
+typedef struct _TBMtable {
+ PTBMT Next; // Points to next data table struct
+ PTABLE Tap; // Points to the sub table
+ PGLOBAL G; // Needed in thread routine
+ bool Complete; // TRUE when all results are read
+ bool Ready; // TRUE when results are there
+ int Rows; // Total number of rows read so far
+ int ProgCur; // Current pos
+ int ProgMax; // Max pos
+ int Rc; // Return code
+ THD *Thd;
+ pthread_attr_t attr; // ??? + pthread_t Tid; // CheckOpen thread ID
+ } TBMT;
+
/***********************************************************************/ /* TBL table. */ /***********************************************************************/ @@ -32,6 +54,7 @@ class DllExport TBLDEF : public PRXDEF { /* Logical table description */ protected: // Members bool Accept; /* TRUE if bad tables are accepted */ + bool Thread; /* Use thread for remote tables */ int Maxerr; /* Maximum number of bad tables */ int Ntables; /* Number of tables */ }; // end of TBLDEF @@ -41,7 +64,6 @@ class DllExport TBLDEF : public PRXDEF { /* Logical table description */ /***********************************************************************/ class DllExport TDBTBL : public TDBPRX { friend class TBTBLK; - friend class TDBPLG; public: // Constructor TDBTBL(PTBLDEF tdp = NULL); @@ -51,8 +73,8 @@ class DllExport TDBTBL : public TDBPRX { // Methods virtual void ResetDB(void); - virtual int GetRecpos(void) {return Rows;} - virtual int GetBadLines(void) {return (int)Nbf;} + virtual int GetRecpos(void) {return Rows;} + virtual int GetBadLines(void) {return (int)Nbc;} // Database routines virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); @@ -72,7 +94,7 @@ class DllExport TDBTBL : public TDBPRX { PTABLE CurTable; // Points to the current table bool Accept; // TRUE if bad tables are accepted int Maxerr; // Maximum number of bad tables - int Nbf; // Number of bad connections + int Nbc; // Number of bad connections int Rows; // Used for RowID int Crp; // Used for CurPos }; // end of class TDBTBL @@ -100,3 +122,44 @@ class TBTBLK : public TIDBLK { protected: // Must not have additional members }; // end of class TBTBLK + +/***********************************************************************/ +/* This is the TBM Access Method class declaration. */ +/***********************************************************************/ +class DllExport TDBTBM : public TDBTBL { + friend class TBTBLK; + public: + // Constructor + TDBTBM(PTBLDEF tdp = NULL); + + // Implementation +//virtual AMT GetAmType(void) {return TYPE_AM_TBL;} + + // Methods + virtual void ResetDB(void); +//virtual int GetRecpos(void) {return Rows;} +//virtual int GetBadLines(void) {return (int)Nbc;} + + // Database routines +//virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + virtual int GetMaxSize(PGLOBAL g) {return 10;} // Temporary + virtual int RowNumber(PGLOBAL g, bool b = FALSE); +//virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL scp); + virtual bool OpenDB(PGLOBAL g); + virtual int ReadDB(PGLOBAL g); + + protected: + // Internal functions +//bool InitTableList(PGLOBAL g); +//bool TestFil(PGLOBAL g, PFIL filp, PTABLE tabp); + bool OpenTables(PGLOBAL g); + int ReadNextRemote(PGLOBAL g); + + // Members + PTBMT Tmp; // To data table TBMT structures
+ PTBMT Cmp; // Current data table PLGF (to move to TDBTBL)
+ PTBMT Bmp; // To bad (unconnected) PLGF structures
+ bool Done; // TRUE after first GetAllResults
+ int Nrc; // Number of remote connections
+ int Nlc; // Number of local connections
+ }; // end of class TDBTBM |