-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
VOL refactor and cleanup #4856
VOL refactor and cleanup #4856
Conversation
Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
So they don't sound like they are operating on connectors. Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
Also, small code tidying Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
Also simplify and enforce some modularity boundaries around them, so that other packages can't modify VOL data structures. Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
!! | ||
!! See C API: @ref H5VLcmp_connector_cls() | ||
!! | ||
SUBROUTINE H5VLcmp_connector_cls_f(are_same, conn_id1, conn_id2, hdferr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This routine is necessary because it's possible to have VOL connector IDs that are different, but point to the same underlying VOL connector class.
|
||
f_ptr = C_NULL_PTR | ||
CALL H5Pset_vol_f(fapl_id, vol_id, error, f_ptr) | ||
CALL check("H5Pset_vol_f",error,total_error) | ||
|
||
CALL H5Pget_vol_id_f(fapl_id, vol_id_out, error) | ||
CALL check("H5Pget_vol_id_f",error,total_error) | ||
CALL VERIFY("H5Pget_vol_id_f", vol_id_out, vol_id, total_error) | ||
are_same = .FALSE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use new routine instead of directly comparing IDs.
/** | ||
* @ingroup JH5VL | ||
* | ||
* H5VLcmp_connector_cls Determines whether two connector identifiers refer to the same connector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This routine is necessary because it's possible to have VOL connector IDs that are different, but point to the same underlying VOL connector class.
@@ -98,7 +98,8 @@ public void testH5VLget_connector_id() | |||
*/ | |||
String connector = System.getenv("HDF5_VOL_CONNECTOR"); | |||
if (connector == null) | |||
assertEquals(HDF5Constants.H5VL_NATIVE, native_id); | |||
assertTrue("H5.H5VLcmp_connector_cls(H5VL_NATIVE_NAME, native_id)", | |||
H5.H5VLcmp_connector_cls(HDF5Constants.H5VL_NATIVE, native_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use new routine instead of directly comparing IDs.
@@ -125,7 +125,7 @@ H5A__create_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const | |||
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute"); | |||
|
|||
/* Register the new attribute and get an ID for it */ | |||
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, true)) < 0) | |||
if ((ret_value = H5VL_register(H5I_ATTR, attr, H5VL_OBJ_CONNECTOR(vol_obj), true)) < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes, and similar ones in non-H5VL packages, are to remove the code coupling to the H5VL package, allowing it to change implementation of H5VL data structures without rippling through the library.
@@ -931,33 +931,27 @@ H5CX_retrieve_state(H5CX_state_t **api_state) | |||
} /* end if */ | |||
|
|||
/* Keep a copy of the VOL connector property, if there is one */ | |||
if ((*head)->ctx.vol_connector_prop_valid && (*head)->ctx.vol_connector_prop.connector_id > 0) { | |||
if ((*head)->ctx.vol_connector_prop_valid && (*head)->ctx.vol_connector_prop.connector) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VOL connector property stores a pointer to the connector struct now, instead of nesting an ID inside the property list.
@@ -88,12 +88,6 @@ static herr_t H5F__flush_api_common(hid_t object_id, H5F_scope_t scope, void **t | |||
/* Local Variables */ | |||
/*******************/ | |||
|
|||
/* Declare a free list to manage the H5VL_t struct */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused (and should not be used outside the H5VL package)
Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
General comment: |
Yes. I added info to the RELEASE.txt note suggesting the correct action for developers who are using them. Anything else needed? We can update the connectors after the merge. |
Signed-off-by: Quincey Koziol <[email protected]>
Aligns them with the way the H5T, H5P, H5E packages return an ID back to an application, and removes calling an internal routine from the public header. Extra work for the internal passthru connector, to keep the main passthru source file using only public API calls. Signed-off-by: Quincey Koziol <[email protected]>
Signed-off-by: Quincey Koziol <[email protected]>
@jhendersonHDF - Any other comments for this PR? I'd like to get it merged ASAP after the 1.16 branch is created, so I can queue the next large one up. |
I've already discussed it at last week's meeting, although I'm happy to run through it again. I believe it's ready for any final review and merge. |
Cleanup and prepare for thread-safety changes.
Big ideas:
Small things: