Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 BTree Record implementations (1-11) #8

Open
ksharonin opened this issue Jan 22, 2024 · 4 comments
Open

V2 BTree Record implementations (1-11) #8

ksharonin opened this issue Jan 22, 2024 · 4 comments
Labels
btree btree implementation

Comments

@ksharonin
Copy link
Owner

This field indicates the type of B-tree:

Value Description
0 This B-tree is used for testing only. This value should not be used for storing records in actual HDF5 files.
1 This B-tree is used for indexing indirectly accessed, non-filtered ‘huge’ fractal heap objects.
2 This B-tree is used for indexing indirectly accessed, filtered ‘huge’ fractal heap objects.
3 This B-tree is used for indexing directly accessed, non-filtered ‘huge’ fractal heap objects.
4 This B-tree is used for indexing directly accessed, filtered ‘huge’ fractal heap objects.
5 This B-tree is used for indexing the ‘name’ field for links in indexed groups.
6 This B-tree is used for indexing the ‘creation order’ field for links in indexed groups.
7 This B-tree is used for indexing shared object header messages.
8 This B-tree is used for indexing the ‘name’ field for indexed attributes.
9 This B-tree is used for indexing the ‘creation order’ field for indexed attributes.
10 This B-tree is used for indexing chunks of datasets with no filters and with more than one dimension of unlimited extent.
11 This B-tree is used for indexing chunks of datasets with filters and more than one dimension of unlimited extent.
@ksharonin ksharonin added the btree btree implementation label Jan 23, 2024
@ksharonin
Copy link
Owner Author

(lldb) p *type
(const H5B2_class_t) $0 = {
  id = H5B2_GRP_DENSE_NAME_ID
  name = 0x000000010056644a "H5B2_GRP_DENSE_NAME_ID"
  nrec_size = 12
  crt_context = 0x0000000000000000
  dst_context = 0x0000000000000000
  store = 0x0000000100255c54 (libhdf5.310.dylib`H5G__dense_btree2_name_store at H5Gbtree2.c:181)
  compare = 0x0000000100255cd4 (libhdf5.310.dylib`H5G__dense_btree2_name_compare at H5Gbtree2.c:207)
  encode = 0x0000000100255e1c (libhdf5.310.dylib`H5G__dense_btree2_name_encode at H5Gbtree2.c:263)
  decode = 0x0000000100255eb8 (libhdf5.310.dylib`H5G__dense_btree2_name_decode at H5Gbtree2.c:287)
  debug = 0x0000000100255f5c (libhdf5.310.dylib`H5G__dense_btree2_name_debug at H5Gbtree2.c:312)
}

@ksharonin
Copy link
Owner Author

Confirmed: implement type 5 record aka H5G_BT2_NAME aka H5B2_GRP_DENSE_NAME_ID

const H5B2_class_t *const H5B2_client_class_g[] = {
    H5B2_TEST,                /* 0 - H5B2_TEST_ID 			*/
    H5HF_HUGE_BT2_INDIR,      /* 1 - H5B2_FHEAP_HUGE_INDIR_ID 	*/
    H5HF_HUGE_BT2_FILT_INDIR, /* 2 - H5B2_FHEAP_HUGE_FILT_INDIR_ID 	*/
    H5HF_HUGE_BT2_DIR,        /* 3 - H5B2_FHEAP_HUGE_DIR_ID 		*/
    H5HF_HUGE_BT2_FILT_DIR,   /* 4 - H5B2_FHEAP_HUGE_FILT_DIR_ID 	*/
    H5G_BT2_NAME,             /* 5 - H5B2_GRP_DENSE_NAME_ID 		*/
    H5G_BT2_CORDER,           /* 6 - H5B2_GRP_DENSE_CORDER_ID 	*/
    H5SM_INDEX,               /* 7 - H5B2_SOHM_INDEX_ID 		*/
    H5A_BT2_NAME,             /* 8 - H5B2_ATTR_DENSE_NAME_ID 		*/
    H5A_BT2_CORDER,           /* 9 - H5B2_ATTR_DENSE_CORDER_ID 	*/
    H5D_BT2,                  /* 10 - H5B2_CDSET_ID                   */
    H5D_BT2_FILT,             /* 11 - H5B2_CDSET_FILT_ID              */
    H5B2_TEST2                /* 12 - H5B2_TEST_ID 			*/
};

@ksharonin
Copy link
Owner Author

Associate support and callback functions

const H5B2_class_t H5G_BT2_NAME[1] = {{
    /* B-tree class information */
    H5B2_GRP_DENSE_NAME_ID,           /* Type of B-tree */
    "H5B2_GRP_DENSE_NAME_ID",         /* Name of B-tree class */
    sizeof(H5G_dense_bt2_name_rec_t), /* Size of native record */
    NULL,                             /* Create client callback context */
    NULL,                             /* Destroy client callback context */
    H5G__dense_btree2_name_store,     /* Record storage callback */
    H5G__dense_btree2_name_compare,   /* Record comparison callback */
    H5G__dense_btree2_name_encode,    /* Record encoding callback */
    H5G__dense_btree2_name_decode,    /* Record decoding callback */
    H5G__dense_btree2_name_debug      /* Record debugging callback */
}};

@ksharonin
Copy link
Owner Author

ksharonin commented Feb 3, 2024

  • Set within hdr->cls and passed to dense record locator
  • Set from hdr = bt2->hdr;
  • Called: H5B2_find(H5B2_t *bt2... <-- find setter of bt2 and use same terms
  • Set up from H5B2_open -> hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__READ_ONLY_FLAG) then bt2->hdr;
  • hdr = (H5B2_hdr_t *)H5AC_protect(f, H5AC_BT2_HDR, hdr_addr, &udata, flags)) populates up
  • thing = H5C_protect(f, type, addr, udata, flags) // general reading scheme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
btree btree implementation
Projects
Development

No branches or pull requests

1 participant