1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_SLOT_STORAGE_ENGINE_H
21
#define DRIZZLED_SLOT_STORAGE_ENGINE_H
23
#include "drizzled/registry.h"
29
typedef struct st_hash HASH;
37
class TableNameIteratorImplementation;
49
* Class to handle all Storage Engine plugins
55
Registry<plugin::StorageEngine *> all_engines;
62
void add(plugin::StorageEngine *engine);
63
void remove(plugin::StorageEngine *engine);
65
Registry<plugin::StorageEngine *>::iterator begin()
67
return all_engines.begin();
70
Registry<plugin::StorageEngine *>::iterator end()
72
return all_engines.end();
75
int getTableProto(const char* path, message::Table *table_proto);
77
plugin::StorageEngine *findByName(Session *session,
78
std::string find_str);
79
void closeConnection(Session* session);
80
void dropDatabase(char* path);
81
int commitOrRollbackByXID(XID *xid, bool commit);
82
int releaseTemporaryLatches(Session *session);
83
bool flushLogs(plugin::StorageEngine *db_type);
84
int recover(HASH *commit_list);
85
int startConsistentSnapshot(Session *session);
86
int deleteTable(Session *session, const char *path, const char *db,
87
const char *alias, bool generate_warning);
91
class TableNameIterator
94
Registry<plugin::StorageEngine *>::iterator engine_iter;
95
plugin::TableNameIteratorImplementation *current_implementation;
96
plugin::TableNameIteratorImplementation *default_implementation;
99
TableNameIterator(const std::string &db);
100
~TableNameIterator();
102
int next(std::string *name);
105
} /* namespace slot */
106
} /* namespace drizzled */
109
Return the storage engine plugin::StorageEngine for the supplied name
111
@param session current thread
112
@param name name of storage engine
115
pointer to storage engine plugin handle
117
drizzled::plugin::StorageEngine *ha_resolve_by_name(Session *session,
118
const std::string &find_str);
120
void ha_close_connection(Session* session);
121
void ha_drop_database(char* path);
122
int ha_commit_or_rollback_by_xid(XID *xid, bool commit);
124
/* report to InnoDB that control passes to the client */
125
int ha_release_temporary_latches(Session *session);
126
bool ha_flush_logs(drizzled::plugin::StorageEngine *db_type);
127
int ha_recover(HASH *commit_list);
128
int ha_start_consistent_snapshot(Session *session);
129
int ha_delete_table(Session *session, const char *path,
130
const char *db, const char *alias, bool generate_warning);
132
#endif /* DRIZZLED_SLOT_STORAGE_ENGINE_H */