~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/ha_archive.h

  • Committer: Monty Taylor
  • Date: 2010-02-04 08:14:46 UTC
  • mfrom: (1277.2.1 build) (1280.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1283.
  • Revision ID: mordred@inaugust.com-20100204081446-ldh9m486va30uap6
Put everything in drizzled into drizzled namespace.
Put internal stuff into drizzled::internal namespace.
Removed some cruft.
Now every symbol that is shipped in a header is in the drizzled namespace
and everything in the server that's not shipped is labeled internal. woot. 
Removed a lot of the extra extern "C" stuff that was in there. Less ugliness for
internal callbacks now for Sun Studio.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  char data_file_name[FN_REFLEN];
49
49
  uint32_t use_count;
50
50
  pthread_mutex_t mutex;
51
 
  THR_LOCK lock;
 
51
  drizzled::THR_LOCK lock;
52
52
  azio_stream archive_write;     /* Archive file we are working with */
53
53
  bool archive_write_open;
54
54
  bool dirty;               /* Flag for if a flush should occur */
56
56
  uint64_t mean_rec_length;
57
57
  char real_path[FN_REFLEN];
58
58
  unsigned int  version;
59
 
  ha_rows rows_recorded;    /* Number of rows in tables */
60
 
  ha_rows version_rows;
 
59
  drizzled::ha_rows rows_recorded;    /* Number of rows in tables */
 
60
  drizzled::ha_rows version_rows;
61
61
};
62
62
 
63
63
/*
68
68
*/
69
69
#define ARCHIVE_VERSION 3
70
70
 
71
 
class ha_archive: public Cursor
 
71
class ha_archive: public drizzled::Cursor
72
72
{
73
 
  THR_LOCK_DATA lock;        /* MySQL lock */
 
73
  drizzled::THR_LOCK_DATA lock;        /* MySQL lock */
74
74
  ArchiveShare *share;      /* Shared lock info */
75
75
 
76
76
  azio_stream archive;            /* Archive file we are working with */
77
 
  my_off_t current_position;  /* The position of the row we just read */
 
77
  drizzled::internal::my_off_t current_position;  /* The position of the row we just read */
78
78
  unsigned char byte_buffer[IO_SIZE]; /* Initial buffer for our string */
79
 
  String buffer;             /* Buffer used for blob storage */
80
 
  ha_rows scan_rows;         /* Number of rows left in scan */
 
79
  drizzled::String buffer;             /* Buffer used for blob storage */
 
80
  drizzled::ha_rows scan_rows;         /* Number of rows left in scan */
81
81
  bool delayed_insert;       /* If the insert is delayed */
82
82
  bool bulk_insert;          /* If we are performing a bulk insert */
83
83
  const unsigned char *current_key;
91
91
 
92
92
public:
93
93
  ha_archive(drizzled::plugin::StorageEngine &engine_arg,
94
 
             TableShare &table_arg);
 
94
             drizzled::TableShare &table_arg);
95
95
  ~ha_archive()
96
96
  { }
97
97
 
99
99
  { return "NONE"; }
100
100
  void get_auto_increment(uint64_t, uint64_t, uint64_t,
101
101
                          uint64_t *first_value, uint64_t *nb_reserved_values);
102
 
  ha_rows records() { return share->rows_recorded; }
 
102
  drizzled::ha_rows records() { return share->rows_recorded; }
103
103
  int index_init(uint32_t keynr, bool sorted);
104
104
  virtual int index_read(unsigned char * buf, const unsigned char * key,
105
 
                         uint32_t key_len, enum ha_rkey_function find_flag);
106
 
  virtual int index_read_idx(unsigned char * buf, uint32_t index, const unsigned char * key,
107
 
                             uint32_t key_len, enum ha_rkey_function find_flag);
 
105
                         uint32_t key_len,
 
106
                         drizzled::ha_rkey_function find_flag);
 
107
  virtual int index_read_idx(unsigned char * buf, uint32_t index,
 
108
                             const unsigned char * key,
 
109
                             uint32_t key_len,
 
110
                             drizzled::ha_rkey_function find_flag);
108
111
  int index_next(unsigned char * buf);
109
112
  int open(const char *name, int mode, uint32_t test_if_locked);
110
113
  int close(void);
128
131
  int optimize();
129
132
  int repair();
130
133
public:
131
 
  void start_bulk_insert(ha_rows rows);
 
134
  void start_bulk_insert(drizzled::ha_rows rows);
132
135
  int end_bulk_insert();
133
 
  enum row_type get_row_type() const
 
136
  enum drizzled::row_type get_row_type() const
134
137
  {
135
 
    return ROW_TYPE_COMPRESSED;
 
138
    return drizzled::ROW_TYPE_COMPRESSED;
136
139
  }
137
 
  THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
138
 
                             enum thr_lock_type lock_type);
139
 
  int check(Session* session);
140
 
  bool check_and_repair(Session *session);
 
140
  drizzled::THR_LOCK_DATA **store_lock(drizzled::Session *session,
 
141
                                       drizzled::THR_LOCK_DATA **to,
 
142
                                       drizzled::thr_lock_type lock_type);
 
143
  int check(drizzled::Session* session);
 
144
  bool check_and_repair(drizzled::Session *session);
141
145
  uint32_t max_row_length(const unsigned char *buf);
142
146
  bool fix_rec_buff(unsigned int length);
143
147
  int unpack_row(azio_stream *file_to_read, unsigned char *record);