diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-12-29 17:06:36 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-12-29 17:06:36 (GMT) |
commit | b5504be6cc6f61b5a8ce78f243b81b6afe9d13c9 (patch) | |
tree | 34c12b398509a0b7585009bd10f4e22982ad9cdb /src/H5B2pkg.h | |
parent | 6d8b831b3125ce66e23aba1f3ec16a03e00b5b82 (diff) | |
download | hdf5-b5504be6cc6f61b5a8ce78f243b81b6afe9d13c9.zip hdf5-b5504be6cc6f61b5a8ce78f243b81b6afe9d13c9.tar.gz hdf5-b5504be6cc6f61b5a8ce78f243b81b6afe9d13c9.tar.bz2 |
[svn-r28742] Description:
Add 'update' operation to v2 B-trees, which will insert a new record, or
modify an existing one, depending on if the record exists or not.
Tested on:
MacOSX/64 10.11.2 (amazon) w/serial & parallel
(h5committest forthcoming)
Diffstat (limited to 'src/H5B2pkg.h')
-rw-r--r-- | src/H5B2pkg.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index f58850e..d6b6c04 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -228,6 +228,14 @@ typedef enum H5B2_nodepos_t { H5B2_POS_MIDDLE /* Node is neither right or left-most in tree */ } H5B2_nodepos_t; +/* Update status */ +typedef enum H5B2_update_status_t { + H5B2_UPDATE_UNKNOWN, /* Unknown update status (initial state) */ + H5B2_UPDATE_MODIFY_DONE, /* Update successfully modified existing record */ + H5B2_UPDATE_INSERT_DONE, /* Update inserted record successfully */ + H5B2_UPDATE_INSERT_CHILD_FULL /* Update will insert record, but child is full */ +} H5B2_update_status_t; + /* Callback info for loading a free space header into the cache */ typedef struct H5B2_hdr_cache_ud_t { H5F_t *f; /* File that v2 b-tree header is within */ @@ -252,7 +260,7 @@ typedef struct H5B2_leaf_cache_ud_t { #ifdef H5B2_TESTING /* Node information for testing */ -typedef struct { +typedef struct H5B2_node_info_test_t { unsigned depth; /* Depth of node */ unsigned nrec; /* Number of records in node */ } H5B2_node_info_test_t; @@ -281,6 +289,13 @@ H5FL_EXTERN(H5B2_leaf_t); /* Internal v2 B-tree testing class */ #ifdef H5B2_TESTING H5_DLLVAR const H5B2_class_t H5B2_TEST[1]; +H5_DLLVAR const H5B2_class_t H5B2_TEST2[1]; + +/* B-tree record for testing H5B2_TEST2 class */ +typedef struct H5B2_test_rec_t { + hsize_t key; /* Key for record */ + hsize_t val; /* Value for record */ +} H5B2_test_rec_t; #endif /* H5B2_TESTING */ /* Array of v2 B-tree client ID -> client class mappings */ @@ -327,12 +342,22 @@ H5_DLL herr_t H5B2__leaf_free(H5B2_leaf_t *l); H5_DLL herr_t H5B2__internal_free(H5B2_internal_t *i); /* Routines for inserting records */ +H5_DLL herr_t H5B2__insert_hdr(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata); H5_DLL herr_t H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata); H5_DLL herr_t H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata); +/* Routines for update records */ +H5_DLL herr_t H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, + uint16_t depth, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, + H5B2_nodepos_t curr_pos, void *udata, H5B2_modify_t op, void *op_data); +H5_DLL herr_t H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, + H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, + H5B2_nodepos_t curr_pos, void *udata, H5B2_modify_t op, void *op_data); + /* Routines for iterating over nodes/records */ H5_DLL herr_t H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, const H5B2_node_ptr_t *curr_node, H5B2_operator_t op, void *op_data); |