diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-02-17 15:38:54 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-02-17 15:38:54 (GMT) |
commit | fd79bc3c1ae13f1fad8d3e1f7c26b610a3f5baa3 (patch) | |
tree | 03bbf1041f3cab0772720b2563f84407ef370833 /src/H5B2pkg.h | |
parent | b28b5fade93c4e72e045469481cde81c01f956cf (diff) | |
download | hdf5-fd79bc3c1ae13f1fad8d3e1f7c26b610a3f5baa3.zip hdf5-fd79bc3c1ae13f1fad8d3e1f7c26b610a3f5baa3.tar.gz hdf5-fd79bc3c1ae13f1fad8d3e1f7c26b610a3f5baa3.tar.bz2 |
[svn-r26191] Description:
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:
Mac OSX/64 10.10.2 (amazon) w/parallel & serial
Linux/32 2.6.x (jam) w/serial
Diffstat (limited to 'src/H5B2pkg.h')
-rw-r--r-- | src/H5B2pkg.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index b820853..7a538bd 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, @@ -326,19 +336,21 @@ H5_DLL herr_t H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Routines for removing records */ 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, - hbool_t * parent_cache_info_dirtied_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata, + hbool_t *depth_decreased, void *swap_loc, unsigned depth, + H5AC_info_t *parent_cache_info, hbool_t * parent_cache_info_dirtied_ptr, + 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, - hbool_t * parent_cache_info_dirtied_ptr, H5B2_node_ptr_t *curr_node_ptr, hsize_t idx, + hbool_t *depth_decreased, void *swap_loc, unsigned depth, + H5AC_info_t *parent_cache_info, hbool_t * parent_cache_info_dirtied_ptr, + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t idx, 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, |