~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/catalog.cc

  • Committer: Lee Bieber
  • Date: 2011-04-17 02:05:51 UTC
  • mfrom: (2279.1.3 build)
  • Revision ID: kalebral@gmail.com-20110417020551-59m0hx1p10b0up1x
Merge Joe - 760367: DATA_DICTIONARY.CUMULATIVE_USER_STATS.CONNECTED_TIME_SEC reports bogus results
Merge Olaf - Refactor Catalog Cache
Merge Olaf - Delete unused functions

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
  drizzled::error_t error;
128
128
  
129
129
  // We insert a lock into the cache, if this fails we bail.
130
 
  if (not catalog::Cache::singleton().lock(identifier, error))
 
130
  if (not catalog::Cache::lock(identifier, error))
131
131
  {
132
132
    my_error(error, identifier);
133
133
 
141
141
bool Catalog::unlock(const identifier::Catalog& identifier)
142
142
{
143
143
  drizzled::error_t error;
144
 
  if (not catalog::Cache::singleton().unlock(identifier, error))
 
144
  if (not catalog::Cache::unlock(identifier, error))
145
145
  {
146
146
    my_error(error, identifier);
147
147
  }
158
158
 
159
159
bool plugin::Catalog::exist(const identifier::Catalog& identifier)
160
160
{
161
 
  if (catalog::Cache::singleton().exist(identifier))
 
161
  if (catalog::Cache::exist(identifier))
162
162
    return true;
163
163
 
164
164
  BOOST_FOREACH(catalog::Engine::vector::const_reference ref, Engines::singleton().catalogs())
189
189
message::catalog::shared_ptr plugin::Catalog::getMessage(const identifier::Catalog& identifier)
190
190
{
191
191
  drizzled::error_t error;
192
 
  catalog::Instance::shared_ptr instance= catalog::Cache::singleton().find(identifier, error);
 
192
  catalog::Instance::shared_ptr instance= catalog::Cache::find(identifier, error);
193
193
  message::catalog::shared_ptr message;
194
194
 
195
195
  if (instance and instance->message())
209
209
catalog::Instance::shared_ptr plugin::Catalog::getInstance(const identifier::Catalog& identifier)
210
210
{
211
211
  drizzled::error_t error;
212
 
  catalog::Instance::shared_ptr instance= catalog::Cache::singleton().find(identifier, error);
 
212
  catalog::Instance::shared_ptr instance= catalog::Cache::find(identifier, error);
213
213
 
214
214
  if (instance)
215
215
    return instance;
222
222
      instance= catalog::Instance::make_shared(message);
223
223
      // If this should fail inserting into the cache, we are in a world of
224
224
      // pain.
225
 
      catalog::Cache::singleton().insert(identifier, instance, error);
 
225
      catalog::Cache::insert(identifier, instance, error);
226
226
 
227
227
      return instance;
228
228
    }