diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-20 12:05:47 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-20 12:05:47 +0100 |
commit | 7b400a088d049661b9a4dded385ac78923bb0017 (patch) | |
tree | bb3ee7bac4454f66ec6f38cf6683f24bc6c065d4 /storage/connect/tabtbl.h | |
parent | d67ad26b33ea16a3b59215ef967bdd9b89345e04 (diff) | |
parent | e5729127b8a50a0e553fd8b87b2683e4a684dfcc (diff) | |
download | mariadb-git-7b400a088d049661b9a4dded385ac78923bb0017.tar.gz |
- MRR + Block Indexing
modified:
storage/connect/array.h
storage/connect/catalog.h
storage/connect/colblk.cpp
storage/connect/colblk.h
storage/connect/connect.cc
storage/connect/connect.h
storage/connect/domdoc.h
storage/connect/filamap.cpp
storage/connect/filamap.h
storage/connect/filamdbf.h
storage/connect/filamfix.cpp
storage/connect/filamfix.h
storage/connect/filamtxt.cpp
storage/connect/filamtxt.h
storage/connect/filamvct.cpp
storage/connect/filamvct.h
storage/connect/filamzip.cpp
storage/connect/filamzip.h
storage/connect/filter.cpp
storage/connect/filter.h
storage/connect/global.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/myconn.h
storage/connect/plgcnx.h
storage/connect/plgdbsem.h
storage/connect/plgdbutl.cpp
storage/connect/plugutil.c
storage/connect/preparse.h
storage/connect/reldef.cpp
storage/connect/reldef.h
storage/connect/tabcol.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/tabfix.cpp
storage/connect/tabfmt.cpp
storage/connect/tabfmt.h
storage/connect/table.cpp
storage/connect/tabmysql.cpp
storage/connect/tabmysql.h
storage/connect/taboccur.h
storage/connect/tabodbc.h
storage/connect/tabsys.h
storage/connect/tabtbl.h
storage/connect/tabutil.h
storage/connect/tabvct.cpp
storage/connect/tabvct.h
storage/connect/tabwmi.h
storage/connect/tabxml.h
storage/connect/user_connect.cc
storage/connect/user_connect.h
storage/connect/valblk.cpp
storage/connect/valblk.h
storage/connect/value.cpp
storage/connect/value.h
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xobject.cpp
storage/connect/xobject.h
storage/connect/xtable.h
Diffstat (limited to 'storage/connect/tabtbl.h')
-rw-r--r-- | storage/connect/tabtbl.h | 328 |
1 files changed, 159 insertions, 169 deletions
diff --git a/storage/connect/tabtbl.h b/storage/connect/tabtbl.h index 0ff6c37eaed..783f3da2c9e 100644 --- a/storage/connect/tabtbl.h +++ b/storage/connect/tabtbl.h @@ -1,169 +1,159 @@ -/*************** TabTbl H Declares Source Code File (.H) ***************/ -/* Name: TABTBL.H Version 1.3 */ -/* */ -/* (C) Copyright to the author Olivier BERTRAND 2008-2013 */ -/* */ -/* This file contains the TDBTBL classes declares. */ -/***********************************************************************/ -#include "block.h" -#include "colblk.h" -#include "tabutil.h" - -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. */ -/***********************************************************************/ -class DllExport TBLDEF : public PRXDEF { /* Logical table description */ - friend class TDBTBL; - friend class TDBTBC; - public: - // Constructor - TBLDEF(void); - - // Implementation - virtual const char *GetType(void) {return "TBL";} - - // Methods - virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); - virtual PTDB GetTable(PGLOBAL g, MODE m); - - 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 - -/***********************************************************************/ -/* This is the TBL Access Method class declaration. */ -/***********************************************************************/ -class DllExport TDBTBL : public TDBPRX { - friend class TBTBLK; - public: - // Constructor - TDBTBL(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); - 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, PCFIL filp, PTABLE tabp); - - // Members - PTABLE Tablist; // Points to the table list - PTABLE CurTable; // Points to the current table - bool Accept; // TRUE if bad tables are accepted - int Maxerr; // Maximum number of bad tables - int Nbc; // Number of bad connections - int Rows; // Used for RowID - int Crp; // Used for CurPos - }; // end of class TDBTBL - -/***********************************************************************/ -/* Class TBTBLK: TDBPLG TABID special column descriptor. */ -/***********************************************************************/ -class TBTBLK : public TIDBLK { - public: - // The constructor must restore Value because XOBJECT has a void - // constructor called by default that set Value to NULL - TBTBLK(PVAL valp) {Value = valp;} - - // Methods - virtual void ReadColumn(PGLOBAL g); - - // Fake operator new used to change TIDBLK into SDTBLK - void * operator new(size_t size, TIDBLK *sp) {return sp;} - -#if !defined(__BORLANDC__) - // Avoid warning C4291 by defining a matching dummy delete operator - void operator delete(void *, TIDBLK*) {} - void operator delete(void *, size_t size) {} -#endif - - 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, PCFIL 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 - - -pthread_handler_t ThreadOpen(void *p); +/*************** TabTbl H Declares Source Code File (.H) ***************/
+/* Name: TABTBL.H Version 1.3 */
+/* */
+/* (C) Copyright to the author Olivier BERTRAND 2008-2013 */
+/* */
+/* This file contains the TDBTBL classes declares. */
+/***********************************************************************/
+#include "block.h"
+#include "colblk.h"
+#include "tabutil.h"
+
+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. */
+/***********************************************************************/
+class DllExport TBLDEF : public PRXDEF { /* Logical table description */
+ friend class TDBTBL;
+ friend class TDBTBC;
+ public:
+ // Constructor
+ TBLDEF(void);
+
+ // Implementation
+ virtual const char *GetType(void) {return "TBL";}
+
+ // Methods
+ virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
+ virtual PTDB GetTable(PGLOBAL g, MODE m);
+
+ 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
+
+/***********************************************************************/
+/* This is the TBL Access Method class declaration. */
+/***********************************************************************/
+class DllExport TDBTBL : public TDBPRX {
+ friend class TBTBLK;
+ public:
+ // Constructor
+ TDBTBL(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);
+ 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, PCFIL filp, PTABLE tabp);
+
+ // Members
+ PTABLE Tablist; // Points to the table list
+ PTABLE CurTable; // Points to the current table
+ bool Accept; // TRUE if bad tables are accepted
+ int Maxerr; // Maximum number of bad tables
+ int Nbc; // Number of bad connections
+ int Rows; // Used for RowID
+ int Crp; // Used for CurPos
+ }; // end of class TDBTBL
+
+/***********************************************************************/
+/* Class TBTBLK: TDBPLG TABID special column descriptor. */
+/***********************************************************************/
+class TBTBLK : public TIDBLK {
+ public:
+ // The constructor must restore Value because XOBJECT has a void
+ // constructor called by default that set Value to NULL
+ TBTBLK(PVAL valp) {Value = valp;}
+
+ // Methods
+ virtual void ReadColumn(PGLOBAL g);
+
+ // Fake operator new used to change TIDBLK into SDTBLK
+ void * operator new(size_t size, TIDBLK *sp) {return sp;}
+
+#if !defined(__BORLANDC__)
+ // Avoid warning C4291 by defining a matching dummy delete operator
+ void operator delete(void *, TIDBLK*) {}
+ void operator delete(void *, size_t size) {}
+#endif
+
+ 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);
+
+ // Methods
+ virtual void ResetDB(void);
+
+ // Database routines
+ virtual int GetMaxSize(PGLOBAL g) {return 10;} // Temporary
+ virtual int RowNumber(PGLOBAL g, bool b = FALSE);
+ virtual bool OpenDB(PGLOBAL g);
+ virtual int ReadDB(PGLOBAL g);
+
+ protected:
+ // Internal functions
+ 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
+
+pthread_handler_t ThreadOpen(void *p);
|