~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/archive_engine.h

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2010-06-29 13:41:05 UTC
  • mto: (1643.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1644.
  • Revision ID: barry.leslie@primebase.com-20100629134105-6bb2u2r6620k64n2
Fixed warnings reported from solaris builds.

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)
91
 
  {
92
 
    return new ha_archive(*this, table);
 
73
 
 
74
  virtual drizzled::Cursor *create(drizzled::TableShare &table,
 
75
                                   drizzled::memory::Root *mem_root)
 
76
  {
 
77
    return new (mem_root) ha_archive(*this, table);
93
78
  }
94
79
 
95
80
  const char **bas_ext() const {
105
90
                           const drizzled::TableIdentifier &identifier,
106
91
                           drizzled::message::Table &table_message);
107
92
 
 
93
  void doGetTableNames(drizzled::CachedDirectory &directory, drizzled::SchemaIdentifier&, std::set<std::string>& set_of_names);
 
94
 
108
95
  int doDropTable(drizzled::Session&, const drizzled::TableIdentifier &identifier);
109
96
 
110
97
  ArchiveShare *findOpenTable(const std::string table_name);
124
111
  int doRenameTable(drizzled::Session&, const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to);
125
112
 
126
113
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
127
 
                             const drizzled::SchemaIdentifier &schema_identifier,
128
 
                             drizzled::TableIdentifier::vector &set_of_identifiers);
 
114
                             drizzled::SchemaIdentifier &schema_identifier,
 
115
                             drizzled::TableIdentifiers &set_of_identifiers);
129
116
};
130
117
 
131
118
#endif /* PLUGIN_ARCHIVE_ARCHIVE_ENGINE_H */