API for the database backend plugins. More...
Data Structures | |
struct | GNUNET_DATASTORE_PluginEnvironment |
The datastore service will pass a pointer to a struct of this type as the first and only argument to the entry point of each datastore plugin. More... | |
struct | GNUNET_DATASTORE_PluginFunctions |
Each plugin is required to return a pointer to a struct of this type as the return value from its entry point. More... | |
Macros | |
#define | GNUNET_DATASTORE_ENTRY_OVERHEAD 256 |
How many bytes of overhead will we assume per entry in any DB (for reservations)? More... | |
Typedefs | |
typedef void(* | GNUNET_DATASTORE_DiskUtilizationChange) (void *cls, int delta) |
Function invoked to notify service of disk utilization changes. More... | |
typedef enum GNUNET_GenericReturnValue(* | PluginDatumProcessor) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, uint64_t uid) |
An processor over a set of items stored in the datastore. More... | |
typedef void(* | PluginEstimateSize) (void *cls, unsigned long long *estimate) |
Get an estimate of how much space the database is currently using. More... | |
typedef void(* | PluginPutCont) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, int status, const char *msg) |
Put continuation. More... | |
typedef void(* | PluginPut) (void *cls, const struct GNUNET_HashCode *key, bool absent, uint32_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, PluginPutCont cont, void *cont_cls) |
Store an item in the datastore. More... | |
typedef void(* | PluginKeyProcessor) (void *cls, const struct GNUNET_HashCode *key, unsigned int count) |
An processor over a set of keys stored in the datastore. More... | |
typedef void(* | PluginGetKeys) (void *cls, PluginKeyProcessor proc, void *proc_cls) |
Get all of the keys in the datastore. More... | |
typedef void(* | PluginGetKey) (void *cls, uint64_t next_uid, bool random, const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, PluginDatumProcessor proc, void *proc_cls) |
Get one of the results for a particular key in the datastore. More... | |
typedef void(* | PluginRemoveCont) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, int status, const char *msg) |
Remove continuation. More... | |
typedef void(* | PluginRemoveKey) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, const void *data, PluginRemoveCont cont, void *cont_cls) |
Remove a particular key in the datastore. More... | |
typedef void(* | PluginGetRandom) (void *cls, PluginDatumProcessor proc, void *proc_cls) |
Get a random item (additional constraints may apply depending on the specific implementation). More... | |
typedef void(* | PluginGetType) (void *cls, uint64_t next_uid, enum GNUNET_BLOCK_Type type, PluginDatumProcessor proc, void *proc_cls) |
Select a single item from the datastore (among those applicable). More... | |
typedef void(* | PluginDrop) (void *cls) |
Drop database. More... | |
API for the database backend plugins.
#define GNUNET_DATASTORE_ENTRY_OVERHEAD 256 |
How many bytes of overhead will we assume per entry in any DB (for reservations)?
Definition at line 49 of file gnunet_datastore_plugin.h.
typedef void(* GNUNET_DATASTORE_DiskUtilizationChange) (void *cls, int delta) |
Function invoked to notify service of disk utilization changes.
cls | closure |
delta | change in disk utilization, 0 for "reset to empty" |
Definition at line 60 of file gnunet_datastore_plugin.h.
typedef enum GNUNET_GenericReturnValue(* PluginDatumProcessor) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, uint64_t uid) |
An processor over a set of items stored in the datastore.
cls | closure |
key | key for the content |
size | number of bytes in data |
data | content stored |
type | type of the content |
priority | priority of the content |
anonymity | anonymity-level for the content |
replication | replication-level for the content |
expiration | expiration time for the content |
uid | unique identifier for the datum |
Definition at line 60 of file gnunet_datastore_plugin.h.
typedef void(* PluginEstimateSize) (void *cls, unsigned long long *estimate) |
Get an estimate of how much space the database is currently using.
NB: estimate is an output parameter because emscripten cannot handle returning 64-bit integers from dynamically loaded modules.
cls | closure |
estimate | location to store estimate |
Definition at line 129 of file gnunet_datastore_plugin.h.
typedef void(* PluginPutCont) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, int status, const char *msg) |
Put continuation.
cls | closure |
key | key for the item stored |
size | size of the item stored |
status | GNUNET_OK if inserted, GNUNET_NO if updated, or #GNUNET_SYSERROR if error |
msg | error message on error |
Definition at line 144 of file gnunet_datastore_plugin.h.
typedef void(* PluginPut) (void *cls, const struct GNUNET_HashCode *key, bool absent, uint32_t size, const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, uint32_t anonymity, uint32_t replication, struct GNUNET_TIME_Absolute expiration, PluginPutCont cont, void *cont_cls) |
Store an item in the datastore.
If the item is already present, the priorities and replication levels are summed up and the higher expiration time and lower anonymity level is used.
cls | closure |
key | key for the item |
absent | true if the key was not found in the bloom filter |
size | number of bytes in data |
data | content stored |
type | type of the content |
priority | priority of the content |
anonymity | anonymity-level for the content |
replication | replication-level for the content |
expiration | expiration time for the content |
cont | continuation called with success or failure status |
cont_cls | continuation closure for cont |
Definition at line 170 of file gnunet_datastore_plugin.h.
typedef void(* PluginKeyProcessor) (void *cls, const struct GNUNET_HashCode *key, unsigned int count) |
An processor over a set of keys stored in the datastore.
cls | closure |
key | key in the data store, if NULL iteration is finished |
count | how many values are stored under this key in the datastore |
Definition at line 192 of file gnunet_datastore_plugin.h.
typedef void(* PluginGetKeys) (void *cls, PluginKeyProcessor proc, void *proc_cls) |
Get all of the keys in the datastore.
cls | closure |
proc | function to call on each key |
proc_cls | closure for proc |
Definition at line 205 of file gnunet_datastore_plugin.h.
typedef void(* PluginGetKey) (void *cls, uint64_t next_uid, bool random, const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, PluginDatumProcessor proc, void *proc_cls) |
Get one of the results for a particular key in the datastore.
cls | closure |
next_uid | return the result with lowest uid >= next_uid |
random | if true, return a random result instead of using next_uid |
key | maybe NULL (to match all entries) |
type | entries of which type are relevant? Use 0 for any type. |
proc | function to call on the matching value; will be called with NULL if nothing matches |
proc_cls | closure for proc |
Definition at line 224 of file gnunet_datastore_plugin.h.
typedef void(* PluginRemoveCont) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, int status, const char *msg) |
Remove continuation.
cls | closure |
key | key for the content removed |
size | number of bytes removed |
status | GNUNET_OK if removed, GNUNET_NO if not found, or #GNUNET_SYSERROR if error |
msg | error message on error |
Definition at line 244 of file gnunet_datastore_plugin.h.
typedef void(* PluginRemoveKey) (void *cls, const struct GNUNET_HashCode *key, uint32_t size, const void *data, PluginRemoveCont cont, void *cont_cls) |
Remove a particular key in the datastore.
cls | closure |
key | key for the content |
size | number of bytes in data |
data | content stored |
cont | continuation called with success or failure status |
cont_cls | continuation closure for cont |
Definition at line 262 of file gnunet_datastore_plugin.h.
typedef void(* PluginGetRandom) (void *cls, PluginDatumProcessor proc, void *proc_cls) |
Get a random item (additional constraints may apply depending on the specific implementation).
Calls proc with all values ZERO or NULL if no item applies, otherwise proc is called once and only once with an item.
cls | closure |
proc | function to call the value (once only). |
proc_cls | closure for proc |
Definition at line 281 of file gnunet_datastore_plugin.h.
typedef void(* PluginGetType) (void *cls, uint64_t next_uid, enum GNUNET_BLOCK_Type type, PluginDatumProcessor proc, void *proc_cls) |
Select a single item from the datastore (among those applicable).
cls | closure |
next_uid | return the result with lowest uid >= next_uid |
type | entries of which type should be considered? Must not be zero (ANY). |
proc | function to call on the matching value; will be called with NULL if no value matches |
proc_cls | closure for proc |
Definition at line 298 of file gnunet_datastore_plugin.h.
typedef void(* PluginDrop) (void *cls) |