|
Groonga
|

Go to the source code of this file.
Macros | |
| #define | GRN_CACHE_DEFAULT_MAX_N_ENTRIES 100 |
Typedefs | |
| typedef struct _grn_cache | grn_cache |
| Cache object. | |
Functions | |
| GRN_API void | grn_set_default_cache_base_path (const char *base_path) |
| GRN_API const char * | grn_get_default_cache_base_path (void) |
| GRN_API grn_cache * | grn_cache_open (grn_ctx *ctx) |
| Create a new cache object. | |
| GRN_API grn_cache * | grn_persistent_cache_open (grn_ctx *ctx, const char *base_path) |
| GRN_API grn_rc | grn_cache_close (grn_ctx *ctx, grn_cache *cache) |
Free resourses of the cache. | |
| GRN_API grn_rc | grn_cache_current_set (grn_ctx *ctx, grn_cache *cache) |
| Set the current grn_cache object. | |
| GRN_API grn_cache * | grn_cache_current_get (grn_ctx *ctx) |
| Retrieve the current grn_cache object. | |
| GRN_API grn_rc | grn_cache_default_reopen (void) |
| GRN_API grn_rc | grn_cache_set_max_n_entries (grn_ctx *ctx, grn_cache *cache, unsigned int n) |
| Set the maximum number of entries in the grn_cache object. | |
| GRN_API unsigned int | grn_cache_get_max_n_entries (grn_ctx *ctx, grn_cache *cache) |
| Retrieve the maximum number of entries in the grn_cache object. | |
| #define GRN_CACHE_DEFAULT_MAX_N_ENTRIES 100 |
| typedef struct _grn_cache grn_cache |
Cache object.
You can create a new cache object using grn_cache_open, and free it using grn_cache_close.
Free resourses of the cache.
| ctx | The context object. |
| cache | The cache object to be freed. |
Set the current grn_cache object.
| ctx | The context object. |
| cache | The new current cache object. |
Create a new cache object.
It initializes a cache based on the current configuration or environment settings. The cache operates in either memory mode or persistent mode.
Memory Cache:
Persistent Cache:
Cache mode can be configured in three ways:
When starting Groonga, use the --cache-base-path option to specify the cache base path. Setting this option to a valid path enables persistent cache mode.
If the --cache-base-path option is not set when you start Groonga, the function checks the GRN_CACHE_TYPE environment variable.
GRN_CACHE_TYPE is set to persistent, it enables persistent cache mode without a specified base path.GRN_CACHE_TYPE is set to any other value or is unset, it uses memory cache mode.Use grn_set_default_cache_base_path to override the configuration or environment settings at runtime.
| ctx | The context object used for memory allocation and error handling. |
NULL on error. The returned grn_cache object must be freed by grn_cache_close. See ctx->rc for error details. Set the maximum number of entries in the grn_cache object.
| ctx | The context object. |
| cache | The cache object whose maximum entry count is updated. |
| n | The new maximum number of entries. |
| GRN_API const char * grn_get_default_cache_base_path | ( | void | ) |
| GRN_API void grn_set_default_cache_base_path | ( | const char * | base_path | ) |