diff options
author | John Mainzer <mainzer@hdfgroup.org> | 2008-08-08 10:55:21 (GMT) |
---|---|---|
committer | John Mainzer <mainzer@hdfgroup.org> | 2008-08-08 10:55:21 (GMT) |
commit | e36116f962b815ff485f2c964f99483a1af069b6 (patch) | |
tree | 8689421d05f99568d2743f580dce835cb9c53ec1 /src/H5AC2public.h | |
parent | 2228cc83933f742122a399811017ecb581eeb84f (diff) | |
download | hdf5-e36116f962b815ff485f2c964f99483a1af069b6.zip hdf5-e36116f962b815ff485f2c964f99483a1af069b6.tar.gz hdf5-e36116f962b815ff485f2c964f99483a1af069b6.tar.bz2 |
[svn-r15452] Reworked journaling control code to remove journaling configuration
from the H5AC2_cache_config_t structure and the associated
H5P/H5Fget/set_mdc_config() API calls, and into the newly created
H5AC2_jnl_config_t structure and H5P/H5Fget/set_jnl_config() calls.
Updated test code accordingly.
Updated the trace file test code for journaling.
Also folded in a fix to an assertion bug in H5C2pkh.h
Tested serial on Phoenix and Linew, and parallel (with and without the
trace file enabled) on kagiso.
Diffstat (limited to 'src/H5AC2public.h')
-rw-r--r-- | src/H5AC2public.h | 146 |
1 files changed, 80 insertions, 66 deletions
diff --git a/src/H5AC2public.h b/src/H5AC2public.h index 57c65b9..e13d76e 100644 --- a/src/H5AC2public.h +++ b/src/H5AC2public.h @@ -36,9 +36,6 @@ extern "C" { #endif -#define H5AC2__MAX_TRACE_FILE_NAME_LEN 1024 -#define H5AC2__MAX_JOURNAL_FILE_NAME_LEN 1024 - /**************************************************************************** * * structure H5AC2_cache_config_t @@ -381,61 +378,10 @@ extern "C" { * file. This field is ignored unless HDF5 has been compiled for * parallel. * - * - * Journal Configuration Fields: - * - * The journaling fields allow enabling of metadata journaling, specification - * of the journal file, and marking a file as recovered. - * - * Note that the fields with the "jbrb_" prefix are used to configure the - * journal buffer ring buffer -- a ring buffer of buffers used to buffer - * output of journal messages. - * - * At least to begin with, these fields may only be used at file open/create - * time -- i.e. in the FAPL. - * - * enable_journaling: Boolean flag that is set to TRUE if journaling is - * to be enabled, and to FALSE otherwise. - * - * When the cache configuration is reported, this field is TRUE iff - * journaling is enabled. - * - * journal_file_path: Full path of the file to be used to store the - * metadata journal. This field is only defined if enable_journaling - * is TRUE. - * - * At present, the length of the journal file path is restricted to - * no more than H5AC2__MAX_JOURNAL_FILE_NAME_LEN. - * - * journal_recovered: Boolean flag use to indicate that we are opening - * a journaled file that was not closed correctly, and on which the - * journal recovery tool has been run. - * - * Unless you are the writer of a new journal recovery tool, you - * should always set this field to FALSE. - * - * jbrb_buf_size: size_t containing the size of each individual buffer - * in the journal buffer ring buffer. This size should be chosen - * to be some multiple of the block size used by the file system - * on which the journal file will be written. - * - * jbrb_num_bufs: Integer containing the number of buffers in the journal - * buffer ring buffer. If synchronous I/O is used, one or two buffers - * is sufficient. If asynchronous I/O is used, the number of buffers - * should be sufficiently large that a write on buffer is likely to - * complete before that buffer is needed again. - * - * jbrb_use_aio: Boolean flag indicating whether we should use - * asynchronous I/O for journal entry writes. - * - * jbrb_human_readable: Boolean flag which determines whether the journal - * file will be written in human readable form. In general, this - * field should be set to false, as the human readable journal - * file is at least twice a large as the machine readable version. - * ****************************************************************************/ -#define H5AC2__CURR_CACHE_CONFIG_VERSION 1 +#define H5AC2__CURR_CACHE_CONFIG_VERSION 1 +#define H5AC2__MAX_TRACE_FILE_NAME_LEN 1024 typedef struct H5AC2_cache_config_t { @@ -495,18 +441,86 @@ typedef struct H5AC2_cache_config_t /* parallel configuration fields: */ int dirty_bytes_threshold; +} H5AC2_cache_config_t; - /* metadata journaling configuration fields: */ - hbool_t enable_journaling; - char journal_file_path[ - H5AC2__MAX_JOURNAL_FILE_NAME_LEN]; - hbool_t journal_recovered; - size_t jbrb_buf_size; - int jbrb_num_bufs; - hbool_t jbrb_use_aio; - hbool_t jbrb_human_readable; -} H5AC2_cache_config_t; +/**************************************************************************** + * + * structure H5AC2_jnl_config_t + * + * H5AC2_jnl_config_t is a public structure intended for use in public APIs. + * At least in its initial incarnation, it is intended to package all the + * data needed to configure metadata journaling. In the future, we may + * use it to package configuration data for other types of journaling as well. + * + * The fields of the structure are discussed individually below. Note + * that the fields with the "jbrb_" prefix are used to configure the + * journal buffer ring buffer -- a ring buffer of buffers used to buffer + * output of journal messages. + * + * version: Integer field containing the version number of this version + * of the H5AC2_jnl_config_t structure. Any instance of + * H5AC2_cache_config_t passed to the cache must have a known + * version number, or an error will be flagged. + * + * enable_journaling: Boolean flag that is set to TRUE if journaling is + * to be enabled, and to FALSE otherwise. + * + * When the cache configuration is reported, this field is TRUE iff + * journaling is enabled. + * + * journal_file_path: Full path of the file to be used to store the + * metadata journal. This field is only defined if enable_journaling + * is TRUE. + * + * At present, the length of the journal file path is restricted to + * no more than H5AC2__MAX_JOURNAL_FILE_NAME_LEN. + * + * journal_recovered: Boolean flag use to indicate that we are opening + * a journaled file that was not closed correctly, and on which the + * journal recovery tool has been run. + * + * Unless you are the writer of a new journal recovery tool, you + * should always set this field to FALSE. + * + * jbrb_buf_size: size_t containing the size of each individual buffer + * in the journal buffer ring buffer. This size should be chosen + * to be some multiple of the block size used by the file system + * on which the journal file will be written. + * + * jbrb_num_bufs: Integer containing the number of buffers in the journal + * buffer ring buffer. If synchronous I/O is used, one or two buffers + * is sufficient. If asynchronous I/O is used, the number of buffers + * should be sufficiently large that a write on buffer is likely to + * complete before that buffer is needed again. + * + * jbrb_use_aio: Boolean flag indicating whether we should use + * asynchronous I/O for journal entry writes. + * + * jbrb_human_readable: Boolean flag which determines whether the journal + * file will be written in human readable form. In general, this + * field should be set to false, as the human readable journal + * file is at least twice a large as the machine readable version. + * + ****************************************************************************/ + +#define H5AC2__CURR_JNL_CONFIG_VER 1 +#define H5AC2__MAX_JOURNAL_FILE_NAME_LEN 1024 + +typedef struct H5AC2_jnl_config_t +{ + int version; + + /* metadata journaling configuration fields: */ + hbool_t enable_journaling; + char journal_file_path[ H5AC2__MAX_JOURNAL_FILE_NAME_LEN]; + hbool_t journal_recovered; + size_t jbrb_buf_size; + int jbrb_num_bufs; + hbool_t jbrb_use_aio; + hbool_t jbrb_human_readable; + +} H5AC2_jnl_config_t; #ifdef __cplusplus |