1
1
/*
2
- Copyright (c) 2012, Monty Program Ab
2
+ Copyright (c) 2012, 2020, MariaDB Corporation.
3
3
4
4
This program is free software; you can redistribute it and/or modify
5
5
it under the terms of the GNU General Public License as published by
@@ -129,13 +129,13 @@ class ha_cassandra: public handler
129
129
The name of the index type that will be used for display.
130
130
Don't implement this method unless you really have indexes.
131
131
*/
132
- const char *index_type (uint inx) { return " HASH" ; }
132
+ const char *index_type (uint) override { return " HASH" ; }
133
133
134
134
/* * @brief
135
135
This is a list of flags that indicate what functionality the storage engine
136
136
implements. The current table flags are documented in handler.h
137
137
*/
138
- ulonglong table_flags () const
138
+ ulonglong table_flags () const override
139
139
{
140
140
return HA_BINLOG_STMT_CAPABLE |
141
141
HA_REC_NOT_IN_SEQ |
@@ -157,7 +157,7 @@ class ha_cassandra: public handler
157
157
If all_parts is set, MySQL wants to know the flags for the combined
158
158
index, up to and including 'part'.
159
159
*/
160
- ulong index_flags (uint inx , uint part , bool all_parts ) const
160
+ ulong index_flags (uint, uint, bool ) const override
161
161
{
162
162
return 0 ;
163
163
}
@@ -169,11 +169,11 @@ class ha_cassandra: public handler
169
169
send. Return *real* limits of your storage engine here; MySQL will do
170
170
min(your_limits, MySQL_limits) automatically.
171
171
*/
172
- uint max_supported_record_length () const { return HA_MAX_REC_LENGTH; }
172
+ uint max_supported_record_length () const override { return HA_MAX_REC_LENGTH;}
173
173
174
174
/* Support only one Primary Key, for now */
175
- uint max_supported_keys () const { return 1 ; }
176
- uint max_supported_key_parts () const { return 1 ; }
175
+ uint max_supported_keys () const override { return 1 ; }
176
+ uint max_supported_key_parts () const override { return 1 ; }
177
177
178
178
/* * @brief
179
179
unireg.cc will call this to make sure that the storage engine can handle
@@ -184,42 +184,48 @@ class ha_cassandra: public handler
184
184
There is no need to implement ..._key_... methods if your engine doesn't
185
185
support indexes.
186
186
*/
187
- uint max_supported_key_length () const { return 16 *1024 ; /* just to return something*/ }
187
+ uint max_supported_key_length () const override
188
+ { return 16 *1024 ; /* just to return something*/ }
188
189
189
- int index_init (uint idx, bool sorted);
190
+ int index_init (uint idx, bool sorted) override ;
190
191
191
192
int index_read_map (uchar * buf, const uchar * key,
192
193
key_part_map keypart_map,
193
- enum ha_rkey_function find_flag);
194
+ enum ha_rkey_function find_flag) override ;
194
195
195
196
/* * @brief
196
197
Called in test_quick_select to determine if indexes should be used.
197
198
*/
198
- virtual double scan_time () { return (double ) (stats.records +stats.deleted ) / 20.0 +10 ; }
199
+ double scan_time () override
200
+ { return (double ) (stats.records +stats.deleted ) / 20.0 +10 ; }
199
201
200
202
/* * @brief
201
203
This method will never be called if you do not implement indexes.
202
204
*/
203
- virtual double read_time (uint, uint, ha_rows rows)
205
+ double read_time (uint, uint, ha_rows rows) override
204
206
{ return (double ) rows / 20.0 +1 ; }
205
207
206
- virtual void start_bulk_insert (ha_rows rows, uint flags);
207
- virtual int end_bulk_insert ();
208
+ void start_bulk_insert (ha_rows rows, uint flags) override ;
209
+ int end_bulk_insert () override ;
208
210
209
- virtual int reset ();
211
+ int reset () override ;
210
212
211
213
212
214
int multi_range_read_init (RANGE_SEQ_IF *seq, void *seq_init_param,
213
- uint n_ranges, uint mode, HANDLER_BUFFER *buf);
214
- int multi_range_read_next (range_id_t *range_info);
215
+ uint n_ranges, uint mode, HANDLER_BUFFER *buf)
216
+ override ;
217
+ int multi_range_read_next (range_id_t *range_info) override ;
215
218
ha_rows multi_range_read_info_const (uint keyno, RANGE_SEQ_IF *seq,
216
219
void *seq_init_param,
217
220
uint n_ranges, uint *bufsz,
218
- uint *flags, Cost_estimate *cost);
221
+ uint *flags, Cost_estimate *cost)
222
+ override ;
219
223
ha_rows multi_range_read_info (uint keyno, uint n_ranges, uint keys,
220
224
uint key_parts, uint *bufsz,
221
- uint *flags, Cost_estimate *cost);
222
- int multi_range_read_explain_info (uint mrr_mode, char *str, size_t size);
225
+ uint *flags, Cost_estimate *cost)
226
+ override ;
227
+ int multi_range_read_explain_info (uint mrr_mode, char *str, size_t size)
228
+ override ;
223
229
224
230
private:
225
231
bool source_exhausted;
@@ -236,12 +242,12 @@ class ha_cassandra: public handler
236
242
CASSANDRA_TYPE_DEF * get_cassandra_field_def (char *cass_name,
237
243
int cass_name_length);
238
244
public:
239
- int open (const char *name, int mode, uint test_if_locked);
240
- int close (void ) ;
245
+ int open (const char *name, int mode, uint test_if_locked) override ;
246
+ int close () override ;
241
247
242
- int write_row (const uchar *buf);
243
- int update_row (const uchar *old_data, const uchar *new_data);
244
- int delete_row (const uchar *buf);
248
+ int write_row (const uchar *buf) override ;
249
+ int update_row (const uchar *old_data, const uchar *new_data) override ;
250
+ int delete_row (const uchar *buf) override ;
245
251
246
252
/* * @brief
247
253
Unlike index_init(), rnd_init() can be called two consecutive times
@@ -251,29 +257,31 @@ class ha_cassandra: public handler
251
257
cursor to the start of the table; no need to deallocate and allocate
252
258
it again. This is a required method.
253
259
*/
254
- int rnd_init (bool scan); // required
255
- int rnd_end ();
256
- int rnd_next (uchar *buf); // /< required
257
- int rnd_pos (uchar *buf, uchar *pos); // /< required
258
- void position (const uchar *record); // /< required
259
- int info (uint); // /< required
260
- int delete_all_rows (void ) ;
261
- ha_rows records_in_range (uint inx , const key_range *min_key,
260
+ int rnd_init (bool scan) override ;
261
+ int rnd_end () override ;
262
+ int rnd_next (uchar *buf) override ;
263
+ int rnd_pos (uchar *buf, uchar *pos) override ;
264
+ void position (const uchar *record) override ;
265
+ int info (uint) override ;
266
+ int delete_all_rows () override ;
267
+ ha_rows records_in_range (uint, const key_range *min_key,
262
268
const key_range *max_key,
263
- page_range *res);
269
+ page_range *res) override
270
+ { return HA_POS_ERROR; /* Range scans are not supported */ }
271
+
264
272
int create (const char *name, TABLE *form,
265
- HA_CREATE_INFO *create_info); // /< required
273
+ HA_CREATE_INFO *create_info) override ;
266
274
bool check_if_incompatible_data (HA_CREATE_INFO *info,
267
- uint table_changes);
275
+ uint table_changes) override ;
268
276
269
277
THR_LOCK_DATA **store_lock (THD *thd, THR_LOCK_DATA **to,
270
- enum thr_lock_type lock_type); // /< required
278
+ enum thr_lock_type lock_type) override ;
271
279
272
280
my_bool register_query_cache_table (THD *thd, const char *table_key,
273
281
uint key_length,
274
282
qc_engine_callback
275
283
*engine_callback,
276
- ulonglong *engine_data)
284
+ ulonglong *engine_data) override
277
285
{
278
286
/*
279
287
Do not put data from Cassandra tables into query cache (because there
0 commit comments