#include <common/xroad_common_fwd.h>
#include <common/xroad_xml.h>
#include "xroad_storage_fwd.h"
#include "xroad_objects.h"
Go to the source code of this file.
Macros | |
#define | __xroad_cursor_dtor__ __dtor__(xroad_cursor_destructor) |
Typedefs | |
typedef struct xroad_cache_s | xroad_cache_t |
Functions | |
xroad_cache_t * | xroad_cache_open (xroad_str_t root_dir) |
void | xroad_cache_destroy (xroad_cache_t *cache) |
void * | xroad_cache_create_object (xroad_cache_t *cache, xroad_object_type_t type) |
void * | xroad_cache_get_object (xroad_cache_t *cache, xroad_object_type_t type, xroad_object_id_t id) |
void * | xroad_cache_clone_object (xroad_cache_t *cache, const void *obj) |
void * | xroad_cache_copy_object (xroad_cache_t *cache, const void *obj, xroad_object_id_t id) |
const xroad_storage_info_t * | xroad_cache_get_info (xroad_cache_t *cache, xroad_object_type_t type) |
xroad_storage_stat_t | xroad_cache_get_stat (xroad_cache_t *cache, xroad_object_type_t type) |
xroad_cursor_t * | xroad_cache_create_cursor (xroad_cache_t *cache, xroad_object_type_t type) |
void | xroad_cache_destroy_cursor (xroad_cursor_t *cursor) |
void | xroad_cursor_destructor (xroad_cursor_t **cursor) |
void * | xroad_cache_cursor_get_first (xroad_cursor_t *cursor) |
void * | xroad_cache_cursor_get_last (xroad_cursor_t *cursor) |
void * | xroad_cache_cursor_get_next (xroad_cursor_t *cursor) |
void * | xroad_cache_cursor_get_prev (xroad_cursor_t *cursor) |
void * | xroad_cache_cursor_offset (xroad_cursor_t *cursor, int64_t offset) |
xroad_errno_t | xroad_cache_clear (xroad_cache_t *cache, xroad_object_type_t type, bool force) |
storage_heap_ref_t | xroad_cache_heap_alloc (xroad_cache_t *cache, xroad_object_type_t type, storage_heap_ref_t ref, const void *data, uint32_t len) |
xroad_errno_t | xroad_cache_heap_free (xroad_cache_t *cache, xroad_object_type_t type, storage_heap_ref_t ref) |
storage_heap_data_t | xroad_cache_heap_get (xroad_cache_t *cache, xroad_object_type_t type, storage_heap_ref_t ref) |
void | xroad_cache_check_fill (xroad_cache_t *cache, double fill_factor) |
void | xroad_cache_check_storage_deadlock (xroad_cache_t *cache) |
xroad_errno_t | xroad_cache_check_object_deadlocks_by_type (xroad_cache_t *cache, xroad_object_type_t type) |
xroad_errno_t | xroad_cache_check_object_deadlocks_by_pid (xroad_cache_t *cache) |
void * | xroad_cache_lock_object (xroad_cache_t *cache, void *obj) |
void | xroad_cache_unlock_object (xroad_cache_t *cache, void *obj) |
#define __xroad_cursor_dtor__ __dtor__(xroad_cursor_destructor) |
node automatic destructor
void xroad_cache_check_fill | ( | xroad_cache_t * | cache, |
double | fill_factor | ||
) |
check storages for filling. And if fill factor exceeded, new pages added
[in] | cache | - cache to check |
[in] | fill_factor | - fill factor in percent |
xroad_errno_t xroad_cache_check_object_deadlocks_by_pid | ( | xroad_cache_t * | cache | ) |
check object cache for locks by pid using lock_by_pid table
[in] | cache | - cache to check |
xroad_errno_t xroad_cache_check_object_deadlocks_by_type | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type | ||
) |
check object cache for locks by type
[in] | cache | - cache to check |
[in] | type | - object type to check |
void xroad_cache_check_storage_deadlock | ( | xroad_cache_t * | cache | ) |
check cache storages for deadlocks
[in] | cache | - cache pointer |
xroad_errno_t xroad_cache_clear | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type, | ||
bool | force | ||
) |
clear storage
[in] | cache | - cache instance |
[in] | type | - storage type |
[in] | force | - force clear |
void* xroad_cache_clone_object | ( | xroad_cache_t * | cache, |
const void * | obj | ||
) |
clone object in cache
[in] | cache | - cache instance |
[in] | obj | - obejct to clone |
void* xroad_cache_copy_object | ( | xroad_cache_t * | cache, |
const void * | obj, | ||
xroad_object_id_t | id | ||
) |
copy object in cache
[in] | cache | - cache instance |
[in] | obj | - object to copy |
[in] | id | - id of source object |
xroad_cursor_t* xroad_cache_create_cursor | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type | ||
) |
create cache cursor. cusrsor MUST be destroed after usage
[in] | cache | - cache instance |
[in] | type | - storage type |
void* xroad_cache_create_object | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type | ||
) |
create object in cache
[in] | cache | - cache instance |
[in] | type | - type og object to create |
void* xroad_cache_cursor_get_first | ( | xroad_cursor_t * | cursor | ) |
get first object by cursor
[in] | cursor | - cursor instance |
void* xroad_cache_cursor_get_last | ( | xroad_cursor_t * | cursor | ) |
get last object by cursor
[in] | cursor | - cursor instance |
void* xroad_cache_cursor_get_next | ( | xroad_cursor_t * | cursor | ) |
get next object by cursor
[in] | cursor | - cursor instance |
void* xroad_cache_cursor_get_prev | ( | xroad_cursor_t * | cursor | ) |
get previous object by cursor
[in] | cursor | - cursor instance |
void* xroad_cache_cursor_offset | ( | xroad_cursor_t * | cursor, |
int64_t | offset | ||
) |
offset cursor by number of rows
[in] | offset | - cursor offset value. Can be negative |
void xroad_cache_destroy | ( | xroad_cache_t * | cache | ) |
close all opened storages and destroy cache instance
[in] | cache | - instance of cache to destroy |
void xroad_cache_destroy_cursor | ( | xroad_cursor_t * | cursor | ) |
destroy cursor
[in] | cursor | - cursor to destroy |
const xroad_storage_info_t* xroad_cache_get_info | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type | ||
) |
returns cache storage meta
[in] | cache | - cache instance |
[in] | type | - storage type |
void* xroad_cache_get_object | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type, | ||
xroad_object_id_t | id | ||
) |
gets object by ID
[in] | cache | - cache instance |
[in] | type | - object type |
[in] | id | - object id |
xroad_storage_stat_t xroad_cache_get_stat | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type | ||
) |
returns cache storage statistic
[in] | cache | - cache instance |
[in] | type | - storage type |
storage_heap_ref_t xroad_cache_heap_alloc | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type, | ||
storage_heap_ref_t | ref, | ||
const void * | data, | ||
uint32_t | len | ||
) |
save data in storage heap
[in] | cache | - cache instance |
[in] | type | - object type |
[in] | ref | - reference to already allocated data. It will be reallocated |
[in] | data | - data to save |
[in] | len | - data length |
xroad_errno_t xroad_cache_heap_free | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type, | ||
storage_heap_ref_t | ref | ||
) |
free allocated data
[in] | cache | - cache instance |
[in] | type | - object type |
[in] | ref | - reference to freed data |
storage_heap_data_t xroad_cache_heap_get | ( | xroad_cache_t * | cache, |
xroad_object_type_t | type, | ||
storage_heap_ref_t | ref | ||
) |
get saved data with reference in heap
[in] | cache | - cache instance |
[in] | type | - object type |
[in] | ref | - reference to data in heap |
void* xroad_cache_lock_object | ( | xroad_cache_t * | cache, |
void * | obj | ||
) |
lock object
[in] | cache | - cache pointer |
[in] | obj | - object to lock |
lock | pointer, NULL - failed |
xroad_cache_t* xroad_cache_open | ( | xroad_str_t | root_dir | ) |
open cache
[in] | root_dir | - system root directory |
void xroad_cache_unlock_object | ( | xroad_cache_t * | cache, |
void * | obj | ||
) |
unlock object
[in] | cache | - cache pointer |
[in] | obj | - object to unlock |