List:Commits« Previous MessageNext Message »
From:jonas Date:March 3 2006 5:15pm
Subject:bk commit into 5.1 tree (jonas:1.2216)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2216 06/03/03 18:14:56 jonas@eel.(none) +4 -0
  ndb dd - use shared pool for file/filegroup in dict

  storage/ndb/src/kernel/vm/KeyTable.hpp
    1.3 06/03/03 18:14:51 jonas@eel.(none) +15 -6
    ndb dd - use shared pool for file/filegroup in dict

  storage/ndb/src/kernel/blocks/record_types.hpp
    1.5 06/03/03 18:14:51 jonas@eel.(none) +10 -5
    ndb dd - use shared pool for file/filegroup in dict

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
    1.30 06/03/03 18:14:51 jonas@eel.(none) +14 -6
    ndb dd - use shared pool for file/filegroup in dict

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
    1.82 06/03/03 18:14:51 jonas@eel.(none) +13 -23
    ndb dd - use shared pool for file/filegroup in dict

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jonas
# Host:	eel.(none)
# Root:	/home/jonas/src/51-ndb

--- 1.4/storage/ndb/src/kernel/blocks/record_types.hpp	2006-02-23 15:09:19 +01:00
+++ 1.5/storage/ndb/src/kernel/blocks/record_types.hpp	2006-03-03 18:14:51 +01:00
@@ -44,11 +44,16 @@
 /**
  * Record types
  */
-#define RT_PGMAN_PAGE_REQUEST      MAKE_TID(1, RG_DISK_OPERATIONS)
+#define RT_PGMAN_PAGE_REQUEST      MAKE_TID( 1, RG_DISK_OPERATIONS)
+#define RT_LGMAN_LOG_WAITER        MAKE_TID( 2, RG_DISK_OPERATIONS)
+#define RT_DBTUP_PAGE_REQUEST      MAKE_TID( 3, RG_DISK_OPERATIONS)
 
-#define RT_LGMAN_LOG_WAITER        MAKE_TID(2, RG_DISK_OPERATIONS)
-
-#define RT_DBTUP_PAGE_REQUEST      MAKE_TID(3, RG_DISK_OPERATIONS)
-#define RT_DBTUP_EXTENT_INFO       MAKE_TID(4, RG_DISK_RECORDS)
+#define RT_DBTUP_EXTENT_INFO       MAKE_TID( 4, RG_DISK_RECORDS)
+#define RT_DBDICT_FILE             MAKE_TID( 5, RG_DISK_RECORDS)
+#define RT_DBDICT_FILEGROUP        MAKE_TID( 6, RG_DISK_RECORDS)
+#define RT_LGMAN_FILE              MAKE_TID( 7, RG_DISK_RECORDS)
+#define RT_LGMAN_FILEGROUP         MAKE_TID( 8, RG_DISK_RECORDS)
+#define RT_TSMAN_FILE              MAKE_TID( 9, RG_DISK_RECORDS)
+#define RT_TSMAN_FILEGROUP         MAKE_TID(10, RG_DISK_RECORDS)
 
 #endif

--- 1.81/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-03-01 10:18:56 +01:00
+++ 1.82/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-03-03 18:14:51 +01:00
@@ -281,8 +281,6 @@
 #define MEMINFO(x, y) infoEvent(x ": %d %d", y.getSize(), y.getNoOfFree())
   if(signal->theData[0] == 1226){
     MEMINFO("c_obj_pool", c_obj_pool);
-    MEMINFO("c_file_pool", c_file_pool);
-    MEMINFO("c_filegroup_pool", c_filegroup_pool);
     MEMINFO("c_opRecordPool", c_opRecordPool);
     MEMINFO("c_rope_pool", c_rope_pool);
   }
@@ -2037,10 +2035,14 @@
   c_obj_pool.setSize(tablerecSize+c_maxNoOfTriggers);
   c_obj_hash.setSize((tablerecSize+c_maxNoOfTriggers+1)/2);
 
-  c_file_pool.setSize(10);
+  Pool_context pc;
+  pc.m_block = this;
+
   c_file_hash.setSize(16);
-  c_filegroup_pool.setSize(10);
   c_filegroup_hash.setSize(16);
+
+  c_file_pool.init(RT_DBDICT_FILE, pc);
+  c_filegroup_pool.init(RT_DBDICT_FILEGROUP, pc);
   
   c_opRecordPool.setSize(256);   // XXX need config params
   c_opCreateTable.setSize(8);
@@ -2121,22 +2123,6 @@
       new (ptr.p) DictObject();
     objs.release();
   }
-
-  {
-    Ptr<File> ptr;
-    SLList<File> objs(c_file_pool);
-    while(objs.seize(ptr))
-      new (ptr.p) File();
-    objs.release();
-  }
-
-  {
-    Ptr<Filegroup> ptr;
-    SLList<Filegroup> objs(c_filegroup_pool);
-    while(objs.seize(ptr))
-      new (ptr.p) Filegroup();
-    objs.release();
-  }
 }//execSIZEALT_REP()
 
 /* ---------------------------------------------------------------- */
@@ -14831,6 +14817,8 @@
       break;
     }
   
+    new (fg_ptr.p) Filegroup();
+
     {
       Rope name(c_rope_pool, obj_ptr.p->m_name);
       if(!name.assign(fg.FilegroupName, len, hash)){
@@ -15070,6 +15058,8 @@
       break;
     }
 
+    new (filePtr.p) File();
+
     {
       Rope name(c_rope_pool, obj_ptr.p->m_name);
       if(!name.assign(f.FileName, len, hash)){
@@ -15084,7 +15074,7 @@
       break;
     case DictTabInfo::LogfileGroup:
     {
-      LocalDLList<File> list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
+      Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
       list.add(filePtr);
       break;
     }
@@ -15310,7 +15300,7 @@
       break;
     case DictTabInfo::LogfileGroup:
     {
-      LocalDLList<File> list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
+      Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
       list.remove(f_ptr);
       break;
     }
@@ -15511,7 +15501,7 @@
      * Mark all undofiles as dropped
      */
     Ptr<File> filePtr;
-    LocalDLList<File> list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
+    Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
     XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
     for(list.first(filePtr); !filePtr.isNull(); list.next(filePtr))
     {

--- 1.29/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2006-02-13 13:12:42 +01:00
+++ 1.30/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2006-03-03 18:14:51 +01:00
@@ -534,6 +534,7 @@
     File() {}
     
     Uint32 key;
+    Uint32 m_magic;
     Uint32 m_obj_ptr_i;
     Uint32 m_filegroup_id;
     Uint32 m_type;
@@ -552,12 +553,17 @@
     bool equal(const File& obj) const { return key == obj.key;}
   };
   typedef Ptr<File> FilePtr;
-
+  typedef RecordPool<File, RWPool> File_pool;
+  typedef DLListImpl<File_pool, File> File_list;
+  typedef LocalDLListImpl<File_pool, File> Local_file_list;
+  typedef KeyTableImpl<File_pool, File> File_hash;
+  
   struct Filegroup {
     Filegroup(){}
 
     Uint32 key;
     Uint32 m_obj_ptr_i;
+    Uint32 m_magic;
     
     Uint32 m_type;
     Uint32 m_version;
@@ -571,7 +577,7 @@
       
       struct {
 	Uint32 m_undo_buffer_size;
-	DLList<File>::HeadPOD m_files;
+	File_list::HeadPOD m_files;
       } m_logfilegroup;
     };
     
@@ -586,11 +592,13 @@
     bool equal(const Filegroup& obj) const { return key == obj.key;}
   };
   typedef Ptr<Filegroup> FilegroupPtr;
+  typedef RecordPool<Filegroup, RWPool> Filegroup_pool;
+  typedef KeyTableImpl<Filegroup_pool, Filegroup> Filegroup_hash;
   
-  ArrayPool<File> c_file_pool;
-  KeyTable<File> c_file_hash;
-  ArrayPool<Filegroup> c_filegroup_pool;
-  KeyTable<Filegroup> c_filegroup_hash;
+  File_pool c_file_pool;
+  Filegroup_pool c_filegroup_pool;
+  File_hash c_file_hash;
+  Filegroup_hash c_filegroup_hash;
   
   RopePool c_rope_pool;
 

--- 1.2/storage/ndb/src/kernel/vm/KeyTable.hpp	2005-04-08 02:44:07 +02:00
+++ 1.3/storage/ndb/src/kernel/vm/KeyTable.hpp	2006-03-03 18:14:51 +01:00
@@ -22,22 +22,31 @@
 /**
  * KeyTable2 is DLHashTable2 with hardcoded Uint32 key named "key".
  */
-template <class T>
-class KeyTable : public DLHashTable<T> {
+template <typename P, typename T>
+class KeyTableImpl : public DLHashTableImpl<P, T> {
 public:
-  KeyTable(ArrayPool<T>& pool) :
-    DLHashTable<T>(pool) {
+  KeyTableImpl(P & pool) :
+    DLHashTableImpl<P, T>(pool) {
   }
 
   bool find(Ptr<T>& ptr, const T& rec) const {
-    return DLHashTable<T>::find(ptr, rec);
+    return DLHashTableImpl<P, T>::find(ptr, rec);
   }
 
   bool find(Ptr<T>& ptr, Uint32 key) const {
     T rec;
     rec.key = key;
-    return DLHashTable<T>::find(ptr, rec);
+    return DLHashTableImpl<P, T>::find(ptr, rec);
   }
+};
+
+// Specializations
+
+template <typename T>
+class KeyTable : public KeyTableImpl<ArrayPool<T>, T>
+{
+public:
+  KeyTable(ArrayPool<T> & p) : KeyTableImpl<ArrayPool<T>, T>(p) {}
 };
 
 #endif
Thread
bk commit into 5.1 tree (jonas:1.2216)jonas3 Mar