summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi/NdbDictionaryImpl.hpp
diff options
context:
space:
mode:
authortomas@poseidon.(none) <>2004-09-14 08:52:21 +0000
committertomas@poseidon.(none) <>2004-09-14 08:52:21 +0000
commit21a4b1b4e60ae67304197c9030d11c33d7ebbde7 (patch)
tree831e0140e9ce404765e5a139b988a78d6a7d1f54 /ndb/src/ndbapi/NdbDictionaryImpl.hpp
parent74336d596f9056994c9418d707459e227cf94c06 (diff)
downloadmariadb-git-21a4b1b4e60ae67304197c9030d11c33d7ebbde7.tar.gz
moved all ndb thread specific data into new placeholder
new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization new methods to keep "records" up to datecorrect record field in ndbcluster handler new method for ndbcluster handler to store/retrieve table and thread specific data changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl hanged deleteKey to return ponter to deleted object moved heavy global cache fetch from inline to separate method
Diffstat (limited to 'ndb/src/ndbapi/NdbDictionaryImpl.hpp')
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.hpp59
1 files changed, 22 insertions, 37 deletions
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
index 8f197856f57..cd0463f7126 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
@@ -390,8 +390,8 @@ public:
int listObjects(List& list, NdbDictionary::Object::Type type);
int listIndexes(List& list, const char * tableName);
- NdbTableImpl * getTable(const char * tableName);
- NdbTableImpl * getTableImpl(const char * internalName);
+ NdbTableImpl * getTable(const char * tableName, void **data= 0);
+ Ndb_local_table_info * get_local_table_info(const char * internalName);
NdbIndexImpl * getIndex(const char * indexName,
const char * tableName);
NdbIndexImpl * getIndexImpl(const char * name, const char * internalName);
@@ -410,6 +410,8 @@ public:
NdbDictInterface m_receiver;
Ndb & m_ndb;
+private:
+ Ndb_local_table_info * fetchGlobalTableImpl(const char * internalName);
};
inline
@@ -598,45 +600,28 @@ NdbDictionaryImpl::getImpl(const NdbDictionary::Dictionary & t){
inline
NdbTableImpl *
-NdbDictionaryImpl::getTable(const char * tableName)
+NdbDictionaryImpl::getTable(const char * tableName, void **data)
{
const char * internalTableName = m_ndb.internalizeTableName(tableName);
-
- return getTableImpl(internalTableName);
+ Ndb_local_table_info *info= get_local_table_info(internalTableName);
+ if (info == 0) {
+ return 0;
+ }
+ if (data) {
+ *data= info->m_local_data;
+ }
+ return info->m_table_impl;
}
inline
-NdbTableImpl *
-NdbDictionaryImpl::getTableImpl(const char * internalTableName)
+Ndb_local_table_info *
+NdbDictionaryImpl::get_local_table_info(const char * internalTableName)
{
- NdbTableImpl *ret = m_localHash.get(internalTableName);
-
- if (ret != 0) {
- return ret; // autoincrement already initialized
+ Ndb_local_table_info *info= m_localHash.get(internalTableName);
+ if (info != 0) {
+ return info; // autoincrement already initialized
}
-
- m_globalHash->lock();
- ret = m_globalHash->get(internalTableName);
- m_globalHash->unlock();
-
- if (ret == 0){
- ret = m_receiver.getTable(internalTableName, m_ndb.usingFullyQualifiedNames());
- m_globalHash->lock();
- m_globalHash->put(internalTableName, ret);
- m_globalHash->unlock();
-
- if(ret == 0){
- return 0;
- }
- }
- m_localHash.put(internalTableName, ret);
-
- m_ndb.theFirstTupleId[ret->getTableId()] = ~0;
- m_ndb.theLastTupleId[ret->getTableId()] = ~0;
-
- addBlobTables(*ret);
-
- return ret;
+ return fetchGlobalTableImpl(internalTableName);
}
inline
@@ -654,9 +639,9 @@ NdbDictionaryImpl::getIndex(const char * indexName,
internalIndexName = m_ndb.internalizeTableName(indexName); // Index is also a table
}
if (internalIndexName) {
- NdbTableImpl * tab = getTableImpl(internalIndexName);
-
- if (tab) {
+ Ndb_local_table_info * info = get_local_table_info(internalIndexName);
+ if (info) {
+ NdbTableImpl * tab = info->m_table_impl;
if (tab->m_index == 0)
tab->m_index = getIndexImpl(indexName, internalIndexName);
if (tab->m_index != 0)