12
12
You should have received a copy of the GNU General Public License
13
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
16
#ifndef PLUGIN_ARCHIVE_HA_ARCHIVE_H
17
17
#define PLUGIN_ARCHIVE_HA_ARCHIVE_H
31
37
bool prime(uint64_t *auto_increment);
33
39
std::string table_name;
34
std::string data_file_name;
40
char data_file_name[FN_REFLEN];
35
41
uint32_t use_count;
36
pthread_mutex_t _mutex;
37
drizzled::THR_LOCK _lock;
42
pthread_mutex_t mutex;
43
drizzled::THR_LOCK lock;
38
44
azio_stream archive_write; /* Archive file we are working with */
39
45
bool archive_write_open;
40
46
bool dirty; /* Flag for if a flush should occur */
74
75
const unsigned char *current_key;
75
76
uint32_t current_key_len;
76
77
uint32_t current_k_offset;
77
std::vector <unsigned char> record_buffer;
78
archive_record_buffer *record_buffer;
78
79
bool archive_reader_open;
81
archive_record_buffer *create_record_buffer(unsigned int length);
82
void destroy_record_buffer(archive_record_buffer *r);
81
85
ha_archive(drizzled::plugin::StorageEngine &engine_arg,
82
drizzled::Table &table_arg);
86
drizzled::TableShare &table_arg);
88
92
void get_auto_increment(uint64_t, uint64_t, uint64_t,
89
93
uint64_t *first_value, uint64_t *nb_reserved_values);
90
94
drizzled::ha_rows records() { return share->rows_recorded; }
91
int doStartIndexScan(uint32_t keynr, bool sorted);
95
int index_init(uint32_t keynr, bool sorted);
92
96
virtual int index_read(unsigned char * buf, const unsigned char * key,
94
98
drizzled::ha_rkey_function find_flag);
99
virtual int index_read_idx(unsigned char * buf, uint32_t index,
100
const unsigned char * key,
102
drizzled::ha_rkey_function find_flag);
95
103
int index_next(unsigned char * buf);
96
int doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked);
97
104
int open(const char *name, int mode, uint32_t test_if_locked);
99
int doInsertRecord(unsigned char * buf);
106
int write_row(unsigned char * buf);
100
107
int real_write_row(unsigned char *buf, azio_stream *writer);
101
108
int delete_all_rows();
102
int doStartTableScan(bool scan=1);
109
int rnd_init(bool scan=1);
103
110
int rnd_next(unsigned char *buf);
104
111
int rnd_pos(unsigned char * buf, unsigned char *pos);
105
112
ArchiveShare *get_share(const char *table_name, int *rc);
119
126
void start_bulk_insert(drizzled::ha_rows rows);
120
127
int end_bulk_insert();
128
enum drizzled::row_type get_row_type() const
130
return drizzled::ROW_TYPE_COMPRESSED;
122
132
drizzled::THR_LOCK_DATA **store_lock(drizzled::Session *session,
123
133
drizzled::THR_LOCK_DATA **to,
124
134
drizzled::thr_lock_type lock_type);