These functions are used almost exclusively by nmdb utilities, although they may be used by external applications. More...
Functions | |
ssize_t | nmdb_firstkey (nmdb_t *db, unsigned char *key, size_t ksize) |
Get the first key. | |
ssize_t | nmdb_nextkey (nmdb_t *db, const unsigned char *key, size_t ksize, unsigned char *newkey, size_t nksize) |
Get the key that follows the one given. | |
int | nmdb_stats (nmdb_t *db, unsigned char *buf, size_t bsize, unsigned int *nservers, unsigned int *nstats) |
Request servers' statistics. |
These functions are used almost exclusively by nmdb utilities, although they may be used by external applications.
They often require some knowledge about nmdb's inner workings so they should be used with care.
ssize_t nmdb_firstkey | ( | nmdb_t * | db, | |
unsigned char * | key, | |||
size_t | ksize | |||
) |
Get the first key.
Returns the first key in the database, which can then be used to get the following one with nmdb_nextkey(). Together, they can be used to iterate over all the keys of a *single server*. It has some caveats:
This is almost exclusively used for replication utilities.
db | connection instance. | |
[out] | key | the first key. |
ksize | the key size. |
ssize_t nmdb_nextkey | ( | nmdb_t * | db, | |
const unsigned char * | key, | |||
size_t | ksize, | |||
unsigned char * | newkey, | |||
size_t | nksize | |||
) |
Get the key that follows the one given.
Together with nmdb_firstkey(), they can be used to iterate This function, along with nmdb_firstkey(), are used to iterate over all the keys of a *single server*. It has some caveats:
This is almost exclusively used for replication utilities.
db | connection instance. | |
key | the current key. | |
ksize | the current key size. | |
[out] | newkey | the key that follows the current one. |
nksize | the newkey size. |
int nmdb_stats | ( | nmdb_t * | db, | |
unsigned char * | buf, | |||
size_t | bsize, | |||
unsigned int * | nservers, | |||
unsigned int * | nstats | |||
) |
Request servers' statistics.
This API is used by nmdb-stats, and likely to change in the future. Do not rely on it.
db | connection instance. | |
[out] | buf | buffer used to store the results. |
bsize | size of the buffer. | |
[out] | nservers | number of servers queried. |
[out] | nstats | number of stats per server. |