~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blitzdb/ha_blitz.cc

  • Committer: Monty Taylor
  • Date: 2010-12-03 19:56:07 UTC
  • mto: (1975.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1976.
  • Revision ID: mordred@inaugust.com-20101203195607-yw50aynlw04dt5k6
All protocol stuff except for the buffer_length. WTF?

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include "config.h"
21
 
 
22
21
#include "ha_blitz.h"
23
 
#include <drizzled/plugin/storage_engine.h>
24
22
 
25
23
using namespace std;
26
24
using namespace drizzled;
67
65
 
68
66
  int doCreateTable(drizzled::Session &session,
69
67
                    drizzled::Table &table_arg,
70
 
                    const drizzled::identifier::Table &identifier,
 
68
                    const drizzled::TableIdentifier &identifier,
71
69
                    drizzled::message::Table &table_proto);
72
70
 
73
71
  int doRenameTable(drizzled::Session &session,
74
 
                    const drizzled::identifier::Table &from_identifier,
75
 
                    const drizzled::identifier::Table &to_identifier);
 
72
                    const drizzled::TableIdentifier &from_identifier,
 
73
                    const drizzled::TableIdentifier &to_identifier);
76
74
 
77
75
  int doDropTable(drizzled::Session &session,
78
 
                  const drizzled::identifier::Table &identifier);
 
76
                  const drizzled::TableIdentifier &identifier);
79
77
 
80
78
  int doGetTableDefinition(drizzled::Session &session,
81
 
                           const drizzled::identifier::Table &identifier,
 
79
                           const drizzled::TableIdentifier &identifier,
82
80
                           drizzled::message::Table &table_proto);
83
81
 
84
82
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
85
 
                             const drizzled::identifier::Schema &schema_identifier,
86
 
                             drizzled::identifier::Table::vector &set_of_identifiers);
 
83
                             const drizzled::SchemaIdentifier &schema_identifier,
 
84
                             drizzled::TableIdentifier::vector &set_of_identifiers);
87
85
 
88
86
  bool doDoesTableExist(drizzled::Session &session,
89
 
                        const drizzled::identifier::Table &identifier);
 
87
                        const drizzled::TableIdentifier &identifier);
90
88
 
91
89
  bool validateCreateTableOption(const std::string &key,
92
90
                                 const std::string &state);
123
121
 
124
122
int BlitzEngine::doCreateTable(drizzled::Session &,
125
123
                               drizzled::Table &table,
126
 
                               const drizzled::identifier::Table &identifier,
 
124
                               const drizzled::TableIdentifier &identifier,
127
125
                               drizzled::message::Table &proto) {
128
126
  BlitzData dict;
129
127
  BlitzTree btree;
164
162
}
165
163
 
166
164
int BlitzEngine::doRenameTable(drizzled::Session &,
167
 
                               const drizzled::identifier::Table &from,
168
 
                               const drizzled::identifier::Table &to) {
 
165
                               const drizzled::TableIdentifier &from,
 
166
                               const drizzled::TableIdentifier &to) {
169
167
  int rv = 0;
170
168
 
171
169
  BlitzData blitz_table;
243
241
}
244
242
 
245
243
int BlitzEngine::doDropTable(drizzled::Session &,
246
 
                             const drizzled::identifier::Table &identifier) {
 
244
                             const drizzled::TableIdentifier &identifier) {
247
245
  BlitzData dict;
248
246
  BlitzTree btree;
249
247
  char buf[FN_REFLEN];
284
282
}
285
283
 
286
284
int BlitzEngine::doGetTableDefinition(drizzled::Session &,
287
 
                                      const drizzled::identifier::Table &identifier,
 
285
                                      const drizzled::TableIdentifier &identifier,
288
286
                                      drizzled::message::Table &proto) {
289
287
  struct stat stat_info;
290
288
  std::string path(identifier.getPath());
326
324
}
327
325
 
328
326
void BlitzEngine::doGetTableIdentifiers(drizzled::CachedDirectory &directory,
329
 
                                        const drizzled::identifier::Schema &schema_id,
330
 
                                        drizzled::identifier::Table::vector &ids) {
 
327
                                        const drizzled::SchemaIdentifier &schema_id,
 
328
                                        drizzled::TableIdentifier::vector &ids) {
331
329
  drizzled::CachedDirectory::Entries entries = directory.getEntries();
332
330
 
333
331
  for (drizzled::CachedDirectory::Entries::iterator entry_iter = entries.begin();
346
344
      char uname[NAME_LEN + 1];
347
345
      uint32_t file_name_len;
348
346
 
349
 
      file_name_len = identifier::Table::filename_to_tablename(filename->c_str(),
 
347
      file_name_len = TableIdentifier::filename_to_tablename(filename->c_str(),
350
348
                                                             uname,
351
349
                                                             sizeof(uname));
352
350
 
353
351
      uname[file_name_len - sizeof(BLITZ_DATA_EXT) + 1]= '\0';
354
 
      ids.push_back(identifier::Table(schema_id, uname));
 
352
      ids.push_back(TableIdentifier(schema_id, uname));
355
353
    }
356
354
  }
357
355
}
358
356
 
359
357
bool BlitzEngine::doDoesTableExist(drizzled::Session &,
360
 
                                   const drizzled::identifier::Table &identifier) {
 
358
                                   const drizzled::TableIdentifier &identifier) {
361
359
  std::string proto_path(identifier.getPath());
362
360
  proto_path.append(BLITZ_DATA_EXT);
363
361
 
499
497
 
500
498
int ha_blitz::doStartTableScan(bool scan) {
501
499
  /* Obtain the query type for this scan */
502
 
  sql_command_type = getTable()->getSession()->getSqlCommand();
 
500
  sql_command_type = session_sql_command(getTable()->getSession());
503
501
  table_scan = scan;
504
502
  table_based = true;
505
503
 
624
622
 
625
623
int ha_blitz::doStartIndexScan(uint32_t key_num, bool) {
626
624
  active_index = key_num;
627
 
  sql_command_type = getTable()->getSession()->getSqlCommand();
 
625
  sql_command_type = session_sql_command(getTable()->getSession());
628
626
 
629
627
  /* This is unlikely to happen but just for assurance, re-obtain
630
628
     the lock if this thread already has a certain lock. This makes