|
|
@ -333,6 +333,15 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel |
|
|
|
#define MDB_MULTIPLE 0x80000 |
|
|
|
#define MDB_MULTIPLE 0x80000 |
|
|
|
/* @} */ |
|
|
|
/* @} */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @defgroup mdb_copy Copy Flags
|
|
|
|
|
|
|
|
* @{ |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
/** Compacting copy: Omit free space from copy, and renumber all
|
|
|
|
|
|
|
|
* pages sequentially. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
#define MDB_CP_COMPACT 0x01 |
|
|
|
|
|
|
|
/* @} */ |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Cursor Get operations.
|
|
|
|
/** @brief Cursor Get operations.
|
|
|
|
* |
|
|
|
* |
|
|
|
* This is the set of all operations for retrieving data |
|
|
|
* This is the set of all operations for retrieving data |
|
|
@ -622,14 +631,10 @@ int mdb_env_copy(MDB_env *env, const char *path); |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
int mdb_env_copyfd(MDB_env *env, mdb_filehandle_t fd); |
|
|
|
int mdb_env_copyfd(MDB_env *env, mdb_filehandle_t fd); |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Copy an LMDB environment to the specified path, with compaction.
|
|
|
|
/** @brief Copy an LMDB environment to the specified path, with options.
|
|
|
|
* |
|
|
|
* |
|
|
|
* This function may be used to make a backup of an existing environment. |
|
|
|
* This function may be used to make a backup of an existing environment. |
|
|
|
* No lockfile is created, since it gets recreated at need. Unlike |
|
|
|
* No lockfile is created, since it gets recreated at need. |
|
|
|
* #mdb_env_copy(), which copies all pages from the environment, this |
|
|
|
|
|
|
|
* function trims freed/unused pages from the copy and reorders leaf |
|
|
|
|
|
|
|
* pages in sequential order. This function may execute more slowly |
|
|
|
|
|
|
|
* than #mdb_env_copy() and will use more CPU time. |
|
|
|
|
|
|
|
* @note This call can trigger significant file size growth if run in |
|
|
|
* @note This call can trigger significant file size growth if run in |
|
|
|
* parallel with write transactions, because it employs a read-only |
|
|
|
* parallel with write transactions, because it employs a read-only |
|
|
|
* transaction. See long-lived transactions under @ref caveats_sec. |
|
|
|
* transaction. See long-lived transactions under @ref caveats_sec. |
|
|
@ -638,12 +643,20 @@ int mdb_env_copyfd(MDB_env *env, mdb_filehandle_t fd); |
|
|
|
* @param[in] path The directory in which the copy will reside. This |
|
|
|
* @param[in] path The directory in which the copy will reside. This |
|
|
|
* directory must already exist and be writable but must otherwise be |
|
|
|
* directory must already exist and be writable but must otherwise be |
|
|
|
* empty. |
|
|
|
* empty. |
|
|
|
|
|
|
|
* @param[in] flags Special options for this operation. This parameter |
|
|
|
|
|
|
|
* must be set to 0 or by bitwise OR'ing together one or more of the |
|
|
|
|
|
|
|
* values described here. |
|
|
|
|
|
|
|
* <ul> |
|
|
|
|
|
|
|
* <li>#MDB_CP_COMPACT - Perform compaction while copying: omit free |
|
|
|
|
|
|
|
* pages and sequentially renumber all pages in output. This option |
|
|
|
|
|
|
|
* consumes more CPU and runs more slowly than the default. |
|
|
|
|
|
|
|
* </ul> |
|
|
|
* @return A non-zero error value on failure and 0 on success. |
|
|
|
* @return A non-zero error value on failure and 0 on success. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
int mdb_env_copy2(MDB_env *env, const char *path); |
|
|
|
int mdb_env_copy2(MDB_env *env, const char *path, unsigned int flags); |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Copy an LMDB environment to the specified file descriptor,
|
|
|
|
/** @brief Copy an LMDB environment to the specified file descriptor,
|
|
|
|
* with compaction. |
|
|
|
* with options. |
|
|
|
* |
|
|
|
* |
|
|
|
* This function may be used to make a backup of an existing environment. |
|
|
|
* This function may be used to make a backup of an existing environment. |
|
|
|
* No lockfile is created, since it gets recreated at need. See |
|
|
|
* No lockfile is created, since it gets recreated at need. See |
|
|
@ -655,9 +668,11 @@ int mdb_env_copy2(MDB_env *env, const char *path); |
|
|
|
* must have already been opened successfully. |
|
|
|
* must have already been opened successfully. |
|
|
|
* @param[in] fd The filedescriptor to write the copy to. It must |
|
|
|
* @param[in] fd The filedescriptor to write the copy to. It must |
|
|
|
* have already been opened for Write access. |
|
|
|
* have already been opened for Write access. |
|
|
|
|
|
|
|
* @param[in] flags Special options for this operation. |
|
|
|
|
|
|
|
* See #mdb_env_copy2() for options. |
|
|
|
* @return A non-zero error value on failure and 0 on success. |
|
|
|
* @return A non-zero error value on failure and 0 on success. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
int mdb_env_copyfd2(MDB_env *env, mdb_filehandle_t fd); |
|
|
|
int mdb_env_copyfd2(MDB_env *env, mdb_filehandle_t fd, unsigned int flags); |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Return statistics about the LMDB environment.
|
|
|
|
/** @brief Return statistics about the LMDB environment.
|
|
|
|
* |
|
|
|
* |
|
|
|