~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/ha_archive.cc

  • Committer: Monty Taylor
  • Date: 2010-08-12 20:27:32 UTC
  • mto: (1720.1.5 build)
  • mto: This revision was merged to the branch mainline in revision 1722.
  • Revision ID: mordred@inaugust.com-20100812202732-9kzchbkvkyki4n3u
Merged libdrizzle directly into tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
  You should have received a copy of the GNU General Public License
14
14
  along with this program; if not, write to the Free Software
15
 
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
16
 
 
17
 
 
18
 
#include <config.h>
19
 
 
20
 
#include <plugin/archive/archive_engine.h>
21
 
#include <memory>
22
 
#include <boost/scoped_ptr.hpp>
 
15
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
16
 
 
17
 
 
18
#include "config.h"
 
19
 
 
20
#include "plugin/archive/archive_engine.h"
23
21
 
24
22
using namespace std;
25
23
using namespace drizzled;
131
129
}
132
130
 
133
131
 
134
 
int ArchiveEngine::doDropTable(Session&, const identifier::Table &identifier)
 
132
void ArchiveEngine::doGetTableNames(drizzled::CachedDirectory &directory, 
 
133
                                    const SchemaIdentifier&,
 
134
                                    set<string>& set_of_names)
 
135
{
 
136
  drizzled::CachedDirectory::Entries entries= directory.getEntries();
 
137
 
 
138
  for (drizzled::CachedDirectory::Entries::iterator entry_iter= entries.begin(); 
 
139
       entry_iter != entries.end(); ++entry_iter)
 
140
  {
 
141
    drizzled::CachedDirectory::Entry *entry= *entry_iter;
 
142
    const string *filename= &entry->filename;
 
143
 
 
144
    assert(filename->size());
 
145
 
 
146
    const char *ext= strchr(filename->c_str(), '.');
 
147
 
 
148
    if (ext == NULL || my_strcasecmp(system_charset_info, ext, ARZ) ||
 
149
        (filename->compare(0, strlen(TMP_FILE_PREFIX), TMP_FILE_PREFIX) == 0))
 
150
    {  }
 
151
    else
 
152
    {
 
153
      char uname[NAME_LEN + 1];
 
154
      uint32_t file_name_len;
 
155
 
 
156
      file_name_len= TableIdentifier::filename_to_tablename(filename->c_str(), uname, sizeof(uname));
 
157
      // TODO: Remove need for memory copy here
 
158
      uname[file_name_len - sizeof(ARZ) + 1]= '\0'; // Subtract ending, place NULL 
 
159
      set_of_names.insert(uname);
 
160
    }
 
161
  }
 
162
}
 
163
 
 
164
 
 
165
int ArchiveEngine::doDropTable(Session&, const TableIdentifier &identifier)
135
166
{
136
167
  string new_path(identifier.getPath());
137
168
 
148
179
}
149
180
 
150
181
int ArchiveEngine::doGetTableDefinition(Session&,
151
 
                                        const identifier::Table &identifier,
 
182
                                        const TableIdentifier &identifier,
152
183
                                        drizzled::message::Table &table_proto)
153
184
{
154
185
  struct stat stat_info;
166
197
    error= EEXIST;
167
198
 
168
199
  {
169
 
    boost::scoped_ptr<azio_stream> proto_stream(new azio_stream);
 
200
    azio_stream proto_stream;
170
201
    char* proto_string;
171
 
    if (azopen(proto_stream.get(), proto_path.c_str(), O_RDONLY, AZ_METHOD_BLOCK) == 0)
 
202
    if (azopen(&proto_stream, proto_path.c_str(), O_RDONLY, AZ_METHOD_BLOCK) == 0)
172
203
      return HA_ERR_CRASHED_ON_USAGE;
173
204
 
174
 
    proto_string= (char*)malloc(sizeof(char) * proto_stream->frm_length);
 
205
    proto_string= (char*)malloc(sizeof(char) * proto_stream.frm_length);
175
206
    if (proto_string == NULL)
176
207
    {
177
 
      azclose(proto_stream.get());
 
208
      azclose(&proto_stream);
178
209
      return ENOMEM;
179
210
    }
180
211
 
181
 
    azread_frm(proto_stream.get(), proto_string);
 
212
    azread_frm(&proto_stream, proto_string);
182
213
 
183
 
    if (table_proto.ParseFromArray(proto_string, proto_stream->frm_length) == false)
 
214
    if (table_proto.ParseFromArray(proto_string, proto_stream.frm_length) == false)
184
215
      error= HA_ERR_CRASHED_ON_USAGE;
185
216
 
186
 
    azclose(proto_stream.get());
 
217
    azclose(&proto_stream);
187
218
    free(proto_string);
188
219
  }
189
220
 
198
229
 
199
230
 
200
231
ha_archive::ha_archive(drizzled::plugin::StorageEngine &engine_arg,
201
 
                       Table &table_arg)
 
232
                       TableShare &table_arg)
202
233
  :Cursor(engine_arg, table_arg), delayed_insert(0), bulk_insert(0)
203
234
{
204
235
  /* Set our original buffer from pre-allocated memory */
236
267
{
237
268
  memset(&archive_write, 0, sizeof(azio_stream));     /* Archive file we are working with */
238
269
  table_name.append(name);
239
 
  data_file_name.assign(table_name);
240
 
  data_file_name.append(ARZ);
 
270
  internal::fn_format(data_file_name, table_name.c_str(), "",
 
271
            ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME);
241
272
  /*
242
273
    We will use this lock for rows.
243
274
  */
261
292
 
262
293
bool ArchiveShare::prime(uint64_t *auto_increment)
263
294
{
264
 
  boost::scoped_ptr<azio_stream> archive_tmp(new azio_stream);
 
295
  azio_stream archive_tmp;
265
296
 
266
297
  /*
267
298
    We read the meta file, but do not mark it dirty. Since we are not
269
300
    anything but reading... open it for write and we will generate null
270
301
    compression writes).
271
302
  */
272
 
  if (!(azopen(archive_tmp.get(), data_file_name.c_str(), O_RDONLY,
 
303
  if (!(azopen(&archive_tmp, data_file_name, O_RDONLY,
273
304
               AZ_METHOD_BLOCK)))
274
305
    return false;
275
306
 
276
 
  *auto_increment= archive_tmp->auto_increment + 1;
277
 
  rows_recorded= (ha_rows)archive_tmp->rows;
278
 
  crashed= archive_tmp->dirty;
 
307
  *auto_increment= archive_tmp.auto_increment + 1;
 
308
  rows_recorded= (ha_rows)archive_tmp.rows;
 
309
  crashed= archive_tmp.dirty;
279
310
  if (version < global_version)
280
311
  {
281
312
    version_rows= rows_recorded;
282
313
    version= global_version;
283
314
  }
284
 
  azclose(archive_tmp.get());
 
315
  azclose(&archive_tmp);
285
316
 
286
317
  return true;
287
318
}
296
327
*/
297
328
ArchiveShare *ha_archive::get_share(const char *table_name, int *rc)
298
329
{
299
 
  ArchiveEngine *a_engine= static_cast<ArchiveEngine *>(getEngine());
 
330
  ArchiveEngine *a_engine= static_cast<ArchiveEngine *>(engine);
300
331
 
301
332
  pthread_mutex_lock(&a_engine->mutex());
302
333
 
341
372
*/
342
373
int ha_archive::free_share()
343
374
{
344
 
  ArchiveEngine *a_engine= static_cast<ArchiveEngine *>(getEngine());
 
375
  ArchiveEngine *a_engine= static_cast<ArchiveEngine *>(engine);
345
376
 
346
377
  pthread_mutex_lock(&a_engine->mutex());
347
378
  if (!--share->use_count)
361
392
    a gzip file that can be both read and written we keep a writer open
362
393
    that is shared amoung all open tables.
363
394
  */
364
 
  if (!(azopen(&(share->archive_write), share->data_file_name.c_str(),
 
395
  if (!(azopen(&(share->archive_write), share->data_file_name,
365
396
               O_RDWR, AZ_METHOD_BLOCK)))
366
397
  {
367
398
    share->crashed= true;
387
418
  {
388
419
    az_method method;
389
420
 
390
 
    if (archive_aio_state())
 
421
    switch (archive_aio_state())
391
422
    {
 
423
    case false:
 
424
      method= AZ_METHOD_BLOCK;
 
425
      break;
 
426
    case true:
392
427
      method= AZ_METHOD_AIO;
393
 
    }
394
 
    else
395
 
    {
 
428
      break;
 
429
    default:
396
430
      method= AZ_METHOD_BLOCK;
397
431
    }
398
 
    if (!(azopen(&archive, share->data_file_name.c_str(), O_RDONLY,
 
432
    if (!(azopen(&archive, share->data_file_name, O_RDONLY,
399
433
                 method)))
400
434
    {
401
435
      share->crashed= true;
413
447
  Init out lock.
414
448
  We open the file we will read from.
415
449
*/
416
 
int ha_archive::doOpen(const identifier::Table &identifier, int , uint32_t )
 
450
int ha_archive::doOpen(const TableIdentifier &identifier, int , uint32_t )
417
451
{
418
452
  int rc= 0;
419
453
  share= get_share(identifier.getPath().c_str(), &rc);
437
471
 
438
472
  assert(share);
439
473
 
440
 
  record_buffer.resize(getTable()->getShare()->getRecordLength() + ARCHIVE_ROW_HEADER_SIZE);
 
474
  record_buffer.resize(table->getShare()->getRecordLength() + ARCHIVE_ROW_HEADER_SIZE);
441
475
 
442
476
  lock.init(&share->_lock);
443
477
 
499
533
 
500
534
int ArchiveEngine::doCreateTable(Session &,
501
535
                                 Table& table_arg,
502
 
                                 const drizzled::identifier::Table &identifier,
 
536
                                 const drizzled::TableIdentifier &identifier,
503
537
                                 drizzled::message::Table& proto)
504
538
{
 
539
  char name_buff[FN_REFLEN];
505
540
  int error= 0;
506
 
  boost::scoped_ptr<azio_stream> create_stream(new azio_stream);
 
541
  azio_stream create_stream;            /* Archive file we are working with */
507
542
  uint64_t auto_increment_value;
508
543
  string serialized_proto;
509
544
 
521
556
 
522
557
      if (!(field->flags & AUTO_INCREMENT_FLAG))
523
558
      {
524
 
        return -1;
 
559
        error= -1;
 
560
        goto error;
525
561
      }
526
562
    }
527
563
  }
528
564
 
529
 
  std::string named_file= identifier.getPath();
530
 
  named_file.append(ARZ);
 
565
  /*
 
566
    We reuse name_buff since it is available.
 
567
  */
 
568
  internal::fn_format(name_buff, identifier.getPath().c_str(), "", ARZ,
 
569
                      MY_REPLACE_EXT | MY_UNPACK_FILENAME);
531
570
 
532
571
  errno= 0;
533
 
  if (azopen(create_stream.get(), named_file.c_str(), O_CREAT|O_RDWR,
 
572
  if (azopen(&create_stream, name_buff, O_CREAT|O_RDWR,
534
573
             AZ_METHOD_BLOCK) == 0)
535
574
  {
536
575
    error= errno;
537
 
    unlink(named_file.c_str());
538
 
 
539
 
    return(error ? error : -1);
 
576
    goto error2;
540
577
  }
541
578
 
542
579
  try {
544
581
  }
545
582
  catch (...)
546
583
  {
547
 
    unlink(named_file.c_str());
548
 
 
549
 
    return(error ? error : -1);
 
584
    goto error2;
550
585
  }
551
586
 
552
 
  if (azwrite_frm(create_stream.get(), serialized_proto.c_str(),
 
587
  if (azwrite_frm(&create_stream, serialized_proto.c_str(),
553
588
                  serialized_proto.length()))
554
589
  {
555
 
    unlink(named_file.c_str());
556
 
 
557
 
    return(error ? error : -1);
 
590
    goto error2;
558
591
  }
559
592
 
560
593
  if (proto.options().has_comment())
561
594
  {
562
595
    int write_length;
563
596
 
564
 
    write_length= azwrite_comment(create_stream.get(),
 
597
    write_length= azwrite_comment(&create_stream,
565
598
                                  proto.options().comment().c_str(),
566
599
                                  proto.options().comment().length());
567
600
 
568
601
    if (write_length < 0)
569
602
    {
570
603
      error= errno;
571
 
      unlink(named_file.c_str());
572
 
 
573
 
      return(error ? error : -1);
 
604
      goto error2;
574
605
    }
575
606
  }
576
607
 
578
609
    Yes you need to do this, because the starting value
579
610
    for the autoincrement may not be zero.
580
611
  */
581
 
  create_stream->auto_increment= auto_increment_value ?
 
612
  create_stream.auto_increment= auto_increment_value ?
582
613
    auto_increment_value - 1 : 0;
583
614
 
584
 
  if (azclose(create_stream.get()))
 
615
  if (azclose(&create_stream))
585
616
  {
586
617
    error= errno;
587
 
    unlink(named_file.c_str());
588
 
 
589
 
    return(error ? error : -1);
 
618
    goto error2;
590
619
  }
591
620
 
592
621
  return(0);
 
622
 
 
623
error2:
 
624
  unlink(name_buff);
 
625
 
 
626
error:
 
627
  /* Return error number, if we got one */
 
628
  return(error ? error : -1);
593
629
}
594
630
 
595
631
/*
623
659
 
624
660
uint32_t ha_archive::max_row_length(const unsigned char *)
625
661
{
626
 
  uint32_t length= (uint32_t)(getTable()->getRecordLength() + getTable()->sizeFields()*2);
 
662
  uint32_t length= (uint32_t)(table->getRecordLength() + table->sizeFields()*2);
627
663
  length+= ARCHIVE_ROW_HEADER_SIZE;
628
664
 
629
665
  uint32_t *ptr, *end;
630
 
  for (ptr= getTable()->getBlobField(), end=ptr + getTable()->sizeBlobFields();
 
666
  for (ptr= table->getBlobField(), end=ptr + table->sizeBlobFields();
631
667
       ptr != end ;
632
668
       ptr++)
633
669
  {
634
 
      length += 2 + ((Field_blob*)getTable()->getField(*ptr))->get_length();
 
670
      length += 2 + ((Field_blob*)table->getField(*ptr))->get_length();
635
671
  }
636
672
 
637
673
  return length;
646
682
    return(HA_ERR_OUT_OF_MEM);
647
683
 
648
684
  /* Copy null bits */
649
 
  memcpy(&record_buffer[0], record, getTable()->getShare()->null_bytes);
650
 
  ptr= &record_buffer[0] + getTable()->getShare()->null_bytes;
 
685
  memcpy(&record_buffer[0], record, table->getShare()->null_bytes);
 
686
  ptr= &record_buffer[0] + table->getShare()->null_bytes;
651
687
 
652
 
  for (Field **field=getTable()->getFields() ; *field ; field++)
 
688
  for (Field **field=table->getFields() ; *field ; field++)
653
689
  {
654
690
    if (!((*field)->is_null()))
655
691
      ptr= (*field)->pack(ptr, record + (*field)->offset(record));
673
709
  int rc;
674
710
  unsigned char *read_buf= NULL;
675
711
  uint64_t temp_auto;
676
 
  unsigned char *record=  getTable()->getInsertRecord();
 
712
  unsigned char *record=  table->getInsertRecord();
677
713
 
678
714
  if (share->crashed)
679
715
    return(HA_ERR_CRASHED_ON_USAGE);
685
721
      return(HA_ERR_CRASHED_ON_USAGE);
686
722
 
687
723
 
688
 
  if (getTable()->next_number_field && record == getTable()->getInsertRecord())
 
724
  if (table->next_number_field && record == table->getInsertRecord())
689
725
  {
690
726
    update_auto_increment();
691
 
    temp_auto= getTable()->next_number_field->val_int();
 
727
    temp_auto= table->next_number_field->val_int();
692
728
 
693
729
    /*
694
730
      We don't support decremening auto_increment. They make the performance
695
731
      just cry.
696
732
    */
697
733
    if (temp_auto <= share->archive_write.auto_increment &&
698
 
        getTable()->getShare()->getKeyInfo(0).flags & HA_NOSAME)
 
734
        table->getShare()->getKeyInfo(0).flags & HA_NOSAME)
699
735
    {
700
736
      rc= HA_ERR_FOUND_DUPP_KEY;
701
737
      goto error;
747
783
{
748
784
  int rc;
749
785
  bool found= 0;
750
 
  current_k_offset= getTable()->getShare()->getKeyInfo(0).key_part->offset;
 
786
  current_k_offset= table->getShare()->getKeyInfo(0).key_part->offset;
751
787
  current_key= key;
752
788
  current_key_len= key_len;
753
789
 
852
888
  }
853
889
 
854
890
  /* Copy null bits */
855
 
  memcpy(record, ptr, getTable()->getNullBytes());
856
 
  ptr+= getTable()->getNullBytes();
857
 
  for (Field **field= getTable()->getFields() ; *field ; field++)
 
891
  memcpy(record, ptr, table->getNullBytes());
 
892
  ptr+= table->getNullBytes();
 
893
  for (Field **field= table->getFields() ; *field ; field++)
858
894
  {
859
895
    if (!((*field)->is_null()))
860
896
    {
861
 
      ptr= (*field)->unpack(record + (*field)->offset(getTable()->getInsertRecord()), ptr);
 
897
      ptr= (*field)->unpack(record + (*field)->offset(table->getInsertRecord()), ptr);
862
898
    }
863
899
  }
864
900
  return(0);
893
929
  current_position= aztell(&archive);
894
930
  rc= get_row(&archive, buf);
895
931
 
896
 
  getTable()->status=rc ? STATUS_NOT_FOUND: 0;
 
932
  table->status=rc ? STATUS_NOT_FOUND: 0;
897
933
 
898
934
  return(rc);
899
935
}
951
987
int ha_archive::optimize()
952
988
{
953
989
  int rc= 0;
954
 
  boost::scoped_ptr<azio_stream> writer(new azio_stream);
 
990
  azio_stream writer;
 
991
  char writer_filename[FN_REFLEN];
955
992
 
956
993
  init_archive_reader();
957
994
 
971
1008
  azread_frm(&archive, proto_string);
972
1009
 
973
1010
  /* Lets create a file to contain the new data */
974
 
  std::string writer_filename= share->table_name;
975
 
  writer_filename.append(ARN);
 
1011
  internal::fn_format(writer_filename, share->table_name.c_str(), "", ARN,
 
1012
            MY_REPLACE_EXT | MY_UNPACK_FILENAME);
976
1013
 
977
 
  if (!(azopen(writer.get(), writer_filename.c_str(), O_CREAT|O_RDWR, AZ_METHOD_BLOCK)))
 
1014
  if (!(azopen(&writer, writer_filename, O_CREAT|O_RDWR, AZ_METHOD_BLOCK)))
978
1015
  {
979
1016
    free(proto_string);
980
1017
    return(HA_ERR_CRASHED_ON_USAGE);
981
1018
  }
982
1019
 
983
 
  azwrite_frm(writer.get(), proto_string, archive.frm_length);
 
1020
  azwrite_frm(&writer, proto_string, archive.frm_length);
984
1021
 
985
1022
  /*
986
1023
    An extended rebuild is a lot more effort. We open up each row and re-record it.
1013
1050
 
1014
1051
      for (uint64_t x= 0; x < rows_restored ; x++)
1015
1052
      {
1016
 
        rc= get_row(&archive, getTable()->getInsertRecord());
 
1053
        rc= get_row(&archive, table->getInsertRecord());
1017
1054
 
1018
1055
        if (rc != 0)
1019
1056
          break;
1020
1057
 
1021
 
        real_write_row(getTable()->getInsertRecord(), writer.get());
 
1058
        real_write_row(table->getInsertRecord(), &writer);
1022
1059
        /*
1023
1060
          Long term it should be possible to optimize this so that
1024
1061
          it is not called on each row.
1025
1062
        */
1026
 
        if (getTable()->found_next_number_field)
 
1063
        if (table->found_next_number_field)
1027
1064
        {
1028
 
          Field *field= getTable()->found_next_number_field;
 
1065
          Field *field= table->found_next_number_field;
1029
1066
 
1030
1067
          /* Since we will need to use field to translate, we need to flip its read bit */
1031
1068
          field->setReadSet();
1032
1069
 
1033
1070
          uint64_t auto_value=
1034
 
            (uint64_t) field->val_int_internal(getTable()->getInsertRecord() +
1035
 
                                               field->offset(getTable()->getInsertRecord()));
 
1071
            (uint64_t) field->val_int(table->getInsertRecord() +
 
1072
                                       field->offset(table->getInsertRecord()));
1036
1073
          if (share->archive_write.auto_increment < auto_value)
1037
1074
            stats.auto_increment_value=
1038
1075
              (share->archive_write.auto_increment= auto_value) + 1;
1039
1076
        }
1040
1077
      }
1041
 
      share->rows_recorded= (ha_rows)writer->rows;
 
1078
      share->rows_recorded= (ha_rows)writer.rows;
1042
1079
    }
1043
1080
 
1044
1081
    if (rc && rc != HA_ERR_END_OF_FILE)
1047
1084
    }
1048
1085
  }
1049
1086
 
1050
 
  azclose(writer.get());
 
1087
  azclose(&writer);
1051
1088
  share->dirty= false;
1052
1089
 
1053
1090
  azclose(&archive);
1054
1091
 
1055
1092
  // make the file we just wrote be our data file
1056
 
  rc = internal::my_rename(writer_filename.c_str(), share->data_file_name.c_str(), MYF(0));
 
1093
  rc = internal::my_rename(writer_filename,share->data_file_name,MYF(0));
1057
1094
 
1058
1095
  free(proto_string);
1059
1096
  return(rc);
1060
1097
error:
1061
1098
  free(proto_string);
1062
 
  azclose(writer.get());
 
1099
  azclose(&writer);
1063
1100
 
1064
1101
  return(rc);
1065
1102
}
1084
1121
 
1085
1122
    if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
1086
1123
         lock_type <= TL_WRITE)
1087
 
        && ! session->doing_tablespace_operation())
 
1124
        && !session_tablespace_op(session))
1088
1125
      lock_type = TL_WRITE_ALLOW_WRITE;
1089
1126
 
1090
1127
    /*
1144
1181
  {
1145
1182
    struct stat file_stat;  // Stat information for the data file
1146
1183
 
1147
 
    stat(share->data_file_name.c_str(), &file_stat);
 
1184
    stat(share->data_file_name, &file_stat);
1148
1185
 
1149
 
    stats.mean_rec_length= getTable()->getRecordLength()+ buffer.alloced_length();
 
1186
    stats.mean_rec_length= table->getRecordLength()+ buffer.alloced_length();
1150
1187
    stats.data_file_length= file_stat.st_size;
1151
1188
    stats.create_time= file_stat.st_ctime;
1152
1189
    stats.update_time= file_stat.st_mtime;
1212
1249
  int rc= 0;
1213
1250
  const char *old_proc_info;
1214
1251
 
1215
 
  old_proc_info= session->get_proc_info();
1216
 
  session->set_proc_info("Checking table");
 
1252
  old_proc_info= get_session_proc_info(session);
 
1253
  set_session_proc_info(session, "Checking table");
1217
1254
  /* Flush any waiting data */
1218
1255
  pthread_mutex_lock(&share->mutex());
1219
1256
  azflush(&(share->archive_write), Z_SYNC_FLUSH);
1228
1265
  read_data_header(&archive);
1229
1266
  for (uint64_t x= 0; x < share->archive_write.rows; x++)
1230
1267
  {
1231
 
    rc= get_row(&archive, getTable()->getInsertRecord());
 
1268
    rc= get_row(&archive, table->getInsertRecord());
1232
1269
 
1233
1270
    if (rc != 0)
1234
1271
      break;
1235
1272
  }
1236
1273
 
1237
 
  session->set_proc_info(old_proc_info);
 
1274
  set_session_proc_info(session, old_proc_info);
1238
1275
 
1239
1276
  if ((rc && rc != HA_ERR_END_OF_FILE))
1240
1277
  {
1247
1284
  }
1248
1285
}
1249
1286
 
1250
 
int ArchiveEngine::doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to)
 
1287
int ArchiveEngine::doRenameTable(Session&, const TableIdentifier &from, const TableIdentifier &to)
1251
1288
{
1252
1289
  int error= 0;
1253
1290
 
1265
1302
}
1266
1303
 
1267
1304
bool ArchiveEngine::doDoesTableExist(Session&,
1268
 
                                     const identifier::Table &identifier)
 
1305
                                     const TableIdentifier &identifier)
1269
1306
{
1270
1307
  string proto_path(identifier.getPath());
1271
1308
  proto_path.append(ARZ);
1279
1316
}
1280
1317
 
1281
1318
void ArchiveEngine::doGetTableIdentifiers(drizzled::CachedDirectory &directory,
1282
 
                                          const drizzled::identifier::Schema &schema_identifier,
1283
 
                                          drizzled::identifier::Table::vector &set_of_identifiers)
 
1319
                                          const drizzled::SchemaIdentifier &schema_identifier,
 
1320
                                          drizzled::TableIdentifiers &set_of_identifiers)
1284
1321
{
1285
1322
  drizzled::CachedDirectory::Entries entries= directory.getEntries();
1286
1323
 
1302
1339
      char uname[NAME_LEN + 1];
1303
1340
      uint32_t file_name_len;
1304
1341
 
1305
 
      file_name_len= identifier::Table::filename_to_tablename(filename->c_str(), uname, sizeof(uname));
 
1342
      file_name_len= TableIdentifier::filename_to_tablename(filename->c_str(), uname, sizeof(uname));
1306
1343
      // TODO: Remove need for memory copy here
1307
1344
      uname[file_name_len - sizeof(ARZ) + 1]= '\0'; // Subtract ending, place NULL 
1308
1345
 
1309
 
      set_of_identifiers.push_back(identifier::Table(schema_identifier, uname));
 
1346
      set_of_identifiers.push_back(TableIdentifier(schema_identifier, uname));
1310
1347
    }
1311
1348
  }
1312
1349
}
 
1350