#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <ups/upscaledb.h>
#include <ups/upscaledb_uqi.h>
Go to the source code of this file.
|
void | error (const char *foo, ups_status_t st) |
|
static void * | mycount_init (int flags, int key_type, uint32_t key_size, int record_type, uint32_t record_size, const char *reserved) |
|
static void | mycount_cleanup (void *state) |
|
static void | mycount_single (void *state, const void *key_data, uint32_t key_size, const void *record_data, uint32_t record_size) |
|
static void | mycount_many (void *state, const void *key_data_list, const void *record_data_list, size_t list_length) |
|
static void | mycount_results (void *state, uqi_result_t *result) |
|
static int | equals10_predicate (void *state, const void *key_data, uint32_t key_size, const void *record_data, uint32_t record_size) |
|
int | main (int argc, char **argv) |
|
This example demonstrates a more complex UQI queries which applies a user-supplied predicate function to filter data
Definition at line 31 of file uqi2.c.
Referenced by main().
static int equals10_predicate |
( |
void * |
state, |
|
|
const void * |
key_data, |
|
|
uint32_t |
key_size, |
|
|
const void * |
record_data, |
|
|
uint32_t |
record_size |
|
) |
| |
|
static |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 110 of file uqi2.c.
References uqi_plugin_t::agg_many, uqi_plugin_t::agg_single, uqi_plugin_t::cleanup, ups_record_t::data, DATABASE_NAME, equals10_predicate(), error(), uqi_plugin_t::init, mycount_cleanup(), mycount_init(), mycount_many(), mycount_results(), mycount_single(), uqi_plugin_t::name, uqi_plugin_t::pred, uqi_plugin_t::results, uqi_plugin_t::type, UPS_AUTO_CLEANUP, ups_db_insert(), ups_env_close(), ups_env_create(), ups_env_create_db(), ups_make_record, UPS_PARAM_KEY_TYPE, UPS_PARAM_RECORD_TYPE, UPS_RECORD_NUMBER32, UPS_SUCCESS, UPS_TYPE_UINT32, UQI_PLUGIN_AGGREGATE, UQI_PLUGIN_PREDICATE, uqi_register_plugin(), uqi_result_close(), uqi_result_get_record(), and uqi_select().
static void mycount_cleanup |
( |
void * |
state | ) |
|
|
static |
static void* mycount_init |
( |
int |
flags, |
|
|
int |
key_type, |
|
|
uint32_t |
key_size, |
|
|
int |
record_type, |
|
|
uint32_t |
record_size, |
|
|
const char * |
reserved |
|
) |
| |
|
static |
static void mycount_many |
( |
void * |
state, |
|
|
const void * |
key_data_list, |
|
|
const void * |
record_data_list, |
|
|
size_t |
list_length |
|
) |
| |
|
static |
static void mycount_results |
( |
void * |
state, |
|
|
uqi_result_t * |
result |
|
) |
| |
|
static |
static void mycount_single |
( |
void * |
state, |
|
|
const void * |
key_data, |
|
|
uint32_t |
key_size, |
|
|
const void * |
record_data, |
|
|
uint32_t |
record_size |
|
) |
| |
|
static |