~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
namespace plugin
76
76
{
77
77
 
 
78
const std::string UNKNOWN_STRING("UNKNOWN");
 
79
 
78
80
class TableNameIteratorImplementation;
79
81
/*
80
82
  StorageEngine is a singleton structure - one instance per storage engine -
324
326
    (void)database;
325
327
    return NULL;
326
328
  }
 
329
 
 
330
 
 
331
  static void add(plugin::StorageEngine *engine);
 
332
  static void remove(plugin::StorageEngine *engine);
 
333
 
 
334
  static int getTableProto(const char* path, message::Table *table_proto);
 
335
 
 
336
  static plugin::StorageEngine *findByName(Session *session,
 
337
                                           std::string find_str);
 
338
  static void closeConnection(Session* session);
 
339
  static void dropDatabase(char* path);
 
340
  static int commitOrRollbackByXID(XID *xid, bool commit);
 
341
  static int releaseTemporaryLatches(Session *session);
 
342
  static bool flushLogs(plugin::StorageEngine *db_type);
 
343
  static int recover(HASH *commit_list);
 
344
  static int startConsistentSnapshot(Session *session);
 
345
  static int deleteTable(Session *session, const char *path, const char *db,
 
346
                         const char *alias, bool generate_warning);
 
347
  static inline const std::string &resolveName(const StorageEngine *engine)
 
348
  {
 
349
    return engine == NULL ? UNKNOWN_STRING : engine->getName();
 
350
  }
 
351
 
327
352
};
328
353
 
329
354
class TableNameIteratorImplementation
339
364
 
340
365
};
341
366
 
 
367
class TableNameIterator
 
368
{
 
369
private:
 
370
  ::drizzled::Registry<plugin::StorageEngine *>::iterator engine_iter;
 
371
  plugin::TableNameIteratorImplementation *current_implementation;
 
372
  plugin::TableNameIteratorImplementation *default_implementation;
 
373
  std::string database;
 
374
public:
 
375
  TableNameIterator(const std::string &db);
 
376
  ~TableNameIterator();
 
377
 
 
378
  int next(std::string *name);
 
379
};
 
380
 
342
381
 
343
382
} /* namespace plugin */
344
383
} /* namespace drizzled */
357
396
 
358
397
handler *get_new_handler(TableShare *share, MEM_ROOT *alloc,
359
398
                         drizzled::plugin::StorageEngine *db_type);
360
 
const std::string ha_resolve_storage_engine_name(const drizzled::plugin::StorageEngine *db_type);
 
399
 
 
400
 
 
401
 
 
402
/** @TODO remove each of the following convenience naming methods */
 
403
 
 
404
static inline void ha_close_connection(Session *session)
 
405
{
 
406
  drizzled::plugin::StorageEngine::closeConnection(session);
 
407
}
 
408
 
 
409
static inline void ha_drop_database(char* path)
 
410
{
 
411
  drizzled::plugin::StorageEngine::dropDatabase(path);
 
412
}
 
413
 
 
414
static inline int ha_commit_or_rollback_by_xid(XID *xid, bool commit)
 
415
{
 
416
  return drizzled::plugin::StorageEngine::commitOrRollbackByXID(xid, commit);
 
417
}
 
418
 
 
419
/* report to InnoDB that control passes to the client */
 
420
static inline int ha_release_temporary_latches(Session *session)
 
421
{
 
422
  return drizzled::plugin::StorageEngine::releaseTemporaryLatches(session);
 
423
}
 
424
 
 
425
static inline bool ha_flush_logs(drizzled::plugin::StorageEngine *engine)
 
426
{
 
427
  return drizzled::plugin::StorageEngine::flushLogs(engine);
 
428
}
 
429
 
 
430
static inline int ha_recover(HASH *commit_list)
 
431
{
 
432
  return drizzled::plugin::StorageEngine::recover(commit_list);
 
433
}
 
434
 
 
435
static inline int ha_start_consistent_snapshot(Session *session)
 
436
{
 
437
  return drizzled::plugin::StorageEngine::startConsistentSnapshot(session);
 
438
}
 
439
 
 
440
static inline int ha_delete_table(Session *session, const char *path,
 
441
                    const char *db, const char *alias, bool generate_warning)
 
442
{
 
443
  return drizzled::plugin::StorageEngine::deleteTable(session, path, db,
 
444
                                            alias, generate_warning);
 
445
}
361
446
 
362
447
 
363
448
#endif /* DRIZZLED_PLUGIN_STORAGE_ENGINE_H */