diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-05-14 05:49:32 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-05-14 05:49:32 (GMT) |
commit | d852ac31f3ae3c2696a90ba531fca29ba02e8414 (patch) | |
tree | e67737977bad773537df2e7674f3e4409a2b4d4d /src/H5B2pkg.h | |
parent | 97e39dac81bb275b1a0fb8edd8abf04fa48afe06 (diff) | |
download | hdf5-d852ac31f3ae3c2696a90ba531fca29ba02e8414.zip hdf5-d852ac31f3ae3c2696a90ba531fca29ba02e8414.tar.gz hdf5-d852ac31f3ae3c2696a90ba531fca29ba02e8414.tar.bz2 |
[svn-r27061] Description:
Bring r26191 from trunk to 1.8 branch:
Track the min & max keys for a v2 B-tree, so it can more efficiently
determine if a key is present in the B-tree.
Tested on:
MacOSX/64 10.10.3 (amazon) w/serial & parallel
(h5committested on trunk)
Diffstat (limited to 'src/H5B2pkg.h')
-rw-r--r-- | src/H5B2pkg.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 3247215..3ea9534 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -172,6 +172,8 @@ typedef struct H5B2_hdr_t { uint8_t *page; /* Common disk page for I/O */ size_t *nat_off; /* Array of offsets of native records */ H5B2_node_info_t *node_info; /* Table of node info structs for current depth of B-tree */ + uint8_t *min_native_rec; /* Pointer to minimum native record */ + uint8_t *max_native_rec; /* Pointer to maximum native record */ /* Client information (not stored) */ const H5B2_class_t *cls; /* Class of B-tree client */ @@ -208,6 +210,14 @@ struct H5B2_t { H5F_t *f; /* Pointer to file for v2 B-tree */ }; +/* Node position, for min/max determination */ +typedef enum H5B2_nodepos_t { + H5B2_POS_ROOT, /* Node is root (i.e. both right & left-most in tree) */ + H5B2_POS_RIGHT, /* Node is right-most in tree, at a given depth */ + H5B2_POS_LEFT, /* Node is left-most in tree, at a given depth */ + H5B2_POS_MIDDLE /* Node is neither right or left-most in tree */ +} H5B2_nodepos_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 */ @@ -304,9 +314,9 @@ H5_DLL herr_t H5B2_internal_free(H5B2_internal_t *i); /* Routines for inserting records */ H5_DLL herr_t H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, void *udata); + 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, void *udata); + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *udata); /* Routines for iterating over nodes/records */ H5_DLL herr_t H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, @@ -328,19 +338,19 @@ H5_DLL herr_t H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5_DLL herr_t H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, - void *op_data); + H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, + H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, - void *op_data); + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, + void *udata, H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, hsize_t n, H5B2_remove_t op, - void *op_data); + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, + H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, unsigned idx, H5B2_remove_t op, - void *op_data); + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, + unsigned idx, H5B2_remove_t op, void *op_data); /* Routines for deleting nodes */ H5_DLL herr_t H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, |