~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/archive_engine.h

  • Committer: Vijay Samuel
  • Date: 2010-08-04 17:46:49 UTC
  • mto: (1685.1.7 build)
  • mto: This revision was merged to the branch mainline in revision 1688.
  • Revision ID: vijay@vijay-20100804174649-ed61v9usifb9zujc
Merge refactored command line for tests/resolve_stack_dump`

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 */
 
15
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
16
16
 
17
17
#include "drizzled/field.h"
18
18
#include "drizzled/field/blob.h"
31
31
#include <unistd.h>
32
32
#include <zlib.h>
33
33
 
34
 
#include <boost/unordered_map.hpp>
35
 
#include "drizzled/util/string.h"
36
 
 
37
34
#include "azio.h"
38
35
#include "plugin/archive/ha_archive.h"
39
36
 
61
58
 
62
59
class ArchiveEngine : public drizzled::plugin::StorageEngine
63
60
{
64
 
  typedef boost::unordered_map<std::string, ArchiveShare *, drizzled::util::insensitive_hash, drizzled::util::insensitive_equal_to> ArchiveMap;
 
61
  typedef std::map<std::string, ArchiveShare*> ArchiveMap;
65
62
  ArchiveMap archive_open_tables;
66
63
 
67
 
  /* Variables for archive share methods */
68
 
  pthread_mutex_t _mutex;
69
 
 
70
64
public:
71
65
  ArchiveEngine() :
72
66
    drizzled::plugin::StorageEngine("ARCHIVE",
74
68
                                    drizzled::HTON_HAS_RECORDS),
75
69
    archive_open_tables()
76
70
  {
77
 
    pthread_mutex_init(&_mutex, NULL);
78
71
    table_definition_ext= ARZ;
79
72
  }
80
 
  ~ArchiveEngine()
81
 
  {
82
 
    pthread_mutex_destroy(&_mutex);
83
 
  }
84
 
 
85
 
  pthread_mutex_t &mutex()
86
 
  {
87
 
    return _mutex;
88
 
  }
89
 
 
90
 
  virtual drizzled::Cursor *create(drizzled::Table &table)
 
73
 
 
74
  virtual drizzled::Cursor *create(drizzled::TableShare &table)
91
75
  {
92
76
    return new ha_archive(*this, table);
93
77
  }
105
89
                           const drizzled::TableIdentifier &identifier,
106
90
                           drizzled::message::Table &table_message);
107
91
 
 
92
  void doGetTableNames(drizzled::CachedDirectory &directory, const drizzled::SchemaIdentifier&, std::set<std::string>& set_of_names);
 
93
 
108
94
  int doDropTable(drizzled::Session&, const drizzled::TableIdentifier &identifier);
109
95
 
110
96
  ArchiveShare *findOpenTable(const std::string table_name);
125
111
 
126
112
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
127
113
                             const drizzled::SchemaIdentifier &schema_identifier,
128
 
                             drizzled::TableIdentifier::vector &set_of_identifiers);
 
114
                             drizzled::TableIdentifiers &set_of_identifiers);
129
115
};
130
116
 
131
117
#endif /* PLUGIN_ARCHIVE_ARCHIVE_ENGINE_H */