19 #ifndef NdbIndexStat_H
20 #define NdbIndexStat_H
22 #include <ndb_types.h>
23 #include "NdbDictionary.hpp"
24 #include "NdbError.hpp"
25 #include "NdbIndexScanOperation.hpp"
45 int alloc_cache(Uint32 entries) {
return 0; }
46 enum { RR_UseDb = 1, RR_NoUpdate = 2 };
57 const Error& getNdbError()
const;
102 InternalError = 4719,
104 HaveSysTables = 4244,
106 BadSysEvents = BadSysTables,
124 int create_systables(
Ndb* ndb);
125 int drop_systables(
Ndb* ndb);
126 int check_systables(
Ndb* ndb);
143 int update_stat(
Ndb* ndb);
148 int delete_stat(
Ndb* ndb);
179 Uint32 m_sampleCount;
200 Uint32 m_indexVersion;
203 Uint32 m_valueFormat;
204 Uint32 m_sampleVersion;
206 Uint32 m_sampleCount;
214 void get_head(
Head& head)
const;
221 int read_head(
Ndb* ndb);
227 int read_stat(
Ndb* ndb);
235 enum { BoundBufferBytes = 8192 };
245 int add_bound(
Bound& bound,
const void* value);
250 int add_bound_null(
Bound& bound);
256 void set_bound_strict(
Bound& bound,
int strict);
261 void reset_bound(
Bound& bound);
277 int finalize_range(
Range& range);
282 void reset_range(
Range& range);
288 int convert_range(
Range& range,
296 enum { StatBufferBytes = 2048 };
307 int query_stat(
const Range& range,
Stat& stat);
314 static void get_empty(
const Stat& stat,
bool* empty);
320 static void get_rir(
const Stat& stat,
double* rir);
326 static void get_rpk(
const Stat& stat, Uint32 k,
double* rpk);
331 enum { RuleBufferBytes = 80 };
332 static void get_rule(
const Stat& stat,
char* buffer);
338 int create_sysevents(
Ndb* ndb);
339 int drop_sysevents(
Ndb* ndb);
340 int check_sysevents(
Ndb* ndb);
345 int create_listener(
Ndb* ndb);
350 int execute_listener(
Ndb* ndb);
356 int poll_listener(
Ndb* ndb,
int max_wait_ms);
363 int next_listener(
Ndb* ndb);
368 int drop_listener(
Ndb* ndb);
378 virtual void* mem_alloc(UintPtr
size) = 0;
379 virtual void mem_free(
void* ptr) = 0;
385 void set_mem_handler(
Mem* mem);
392 const char* keyRecordData,