diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2014-03-17 17:37:27 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2014-03-17 17:37:27 (GMT) |
commit | ad72021fd1b22c0e83053a30b3fcd66c40e29a84 (patch) | |
tree | 6a9cf3543c63b0a6a380737a845d296c9ab13adc /src | |
parent | bcf7c98ef92b4b318d0afcf21ad3b95b522e18f8 (diff) | |
download | hdf5-ad72021fd1b22c0e83053a30b3fcd66c40e29a84.zip hdf5-ad72021fd1b22c0e83053a30b3fcd66c40e29a84.tar.gz hdf5-ad72021fd1b22c0e83053a30b3fcd66c40e29a84.tar.bz2 |
[svn-r24813] Add H5Xpublic/H5Vpublic to hdf5.h
Add index test in testff
Add indexing query callback to H5Vcreate
Cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FF.c | 8 | ||||
-rw-r--r-- | src/H5V.c | 46 | ||||
-rw-r--r-- | src/H5VLiod.c | 4 | ||||
-rw-r--r-- | src/H5VLiod_client.h | 4 | ||||
-rw-r--r-- | src/H5VLiod_common.h | 1 | ||||
-rw-r--r-- | src/hdf5.h | 4 |
6 files changed, 58 insertions, 9 deletions
@@ -800,7 +800,7 @@ H5Dopen_ff(hid_t loc_id, const char *name, hid_t dapl_id, hid_t rcxt_id, hid_t e size_t metadata_size; size_t idx_count; void *metadata; - H5P_genplist_t *xxpl_plist; /* Property list pointer */ + H5P_genplist_t *xapl_plist; /* Property list pointer */ hid_t xapl_id = H5P_INDEX_ACCESS_DEFAULT; /* Get index info if present */ @@ -809,10 +809,10 @@ H5Dopen_ff(hid_t loc_id, const char *name, hid_t dapl_id, hid_t rcxt_id, hid_t e HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "can't get index info for dataset"); if (idx_count) { - /* store the read context ID in the xxpl */ - if(NULL == (xxpl_plist = (H5P_genplist_t *)H5I_object(xapl_id))) + /* store the read context ID in the xapl */ + if(NULL == (xapl_plist = (H5P_genplist_t *)H5I_object(xapl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - if(H5P_set(xxpl_plist, H5VL_CONTEXT_ID, &rcxt_id) < 0) + if(H5P_set(xapl_plist, H5VL_CONTEXT_ID, &rcxt_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for trans_id"); if (NULL == (idx_class = H5X_registered(plugin_id))) @@ -33,6 +33,9 @@ #include "H5Vprivate.h" /* Views */ #include "H5VLprivate.h" /* VOL plugins */ #include "H5VLiod_client.h" /* IOD VOL plugin */ +#ifdef H5_HAVE_INDEXING +#include "H5Xprivate.h" /* Indexing */ +#endif #ifdef H5_HAVE_EFF @@ -305,6 +308,10 @@ H5Vcreate_ff(hid_t loc_id, hid_t query_id, hid_t vcpl_id, hid_t rcxt_id, hid_t e void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ void *view = NULL; /* pointer to view object created */ void *obj = NULL; /* object token of loc_id */ +#ifdef H5_HAVE_INDEXING + void *idx_handle = NULL; /* index */ +#endif + hid_t dataspace_id; H5VL_t *vol_plugin; /* VOL plugin information */ hid_t ret_value; @@ -339,8 +346,41 @@ H5Vcreate_ff(hid_t loc_id, hid_t query_id, hid_t vcpl_id, hid_t rcxt_id, hid_t e vol_plugin->nrefs ++; } +#ifdef H5_HAVE_INDEXING + /* Try to get indexing info (only for one dataset now) */ + if (H5I_object_verify(loc_id, H5I_DATASET) && + (NULL != (idx_handle = H5VL_iod_dataset_get_index(obj)))) { + H5X_class_t *idx_class = NULL; + H5P_genplist_t *xxpl_plist; /* Property list pointer */ + hid_t xxpl_id = H5P_INDEX_XFER_DEFAULT; + unsigned plugin_id; + + if (!(plugin_id = H5VL_iod_dataset_get_index_plugin_id(obj))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "can't get index plugin ID from dataset"); + if (NULL == (idx_class = H5X_registered(plugin_id))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "can't get index plugin class"); + + /* store the read context ID in the xxpl */ + if (NULL == (xxpl_plist = (H5P_genplist_t *) H5I_object(xxpl_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + if (H5P_set(xxpl_plist, H5VL_CONTEXT_ID, &rcxt_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for trans_id"); + + if (FAIL == idx_class->query(idx_handle, query_id, xxpl_id, &dataspace_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTCLOSEOBJ, FAIL, "cannot close index"); + } +#endif + if (!H5I_object_verify(dataspace_id, H5I_DATASPACE)) { + /* The indexing pre_selection is NULL */ + H5S_t *dataspace = H5S_create(H5S_NULL); + if((ret_value = H5I_register (H5I_DATASPACE, dataspace, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom"); + } + /* TODO might want to pass dataspace_id with vcpl_id */ + /* call the IOD specific private routine to create a view object */ - if(NULL == (view = H5VL_iod_view_create(obj, query_id, vcpl_id, rcxt_id, req))) + if(NULL == (view = H5VL_iod_view_create(obj, query_id, dataspace_id, + vcpl_id, rcxt_id, req))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create view") if(request && *req) { @@ -353,9 +393,11 @@ H5Vcreate_ff(hid_t loc_id, hid_t query_id, hid_t vcpl_id, hid_t rcxt_id, hid_t e HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize view handle") done: - if (ret_value < 0 && view) + if (ret_value < 0 && view) { if(H5V_close (view) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release view") + } + H5I_dec_ref(dataspace_id); FUNC_LEAVE_API(ret_value) } /* end H5Vcreate_ff */ diff --git a/src/H5VLiod.c b/src/H5VLiod.c index 738e233..2075250 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -10041,7 +10041,8 @@ done: *------------------------------------------------------------------------- */ void * -H5VL_iod_view_create(void *_obj, hid_t query_id, hid_t vcpl_id, hid_t rcxt_id, void **req) +H5VL_iod_view_create(void *_obj, hid_t query_id, hid_t dataspace_id, + hid_t vcpl_id, hid_t rcxt_id, void **req) { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to create the view */ H5VL_iod_view_t *view = NULL; /* the view object that is created and passed to the user */ @@ -10098,6 +10099,7 @@ H5VL_iod_view_create(void *_obj, hid_t query_id, hid_t vcpl_id, hid_t rcxt_id, v input.loc_oh = iod_oh; input.loc_mdkv_id = mdkv_id; input.query_id = query_id; + input.dataspace_id = dataspace_id; input.vcpl_id = vcpl_id; input.obj_type = obj->obj_type; input.rcxt_num = rc->c_version; diff --git a/src/H5VLiod_client.h b/src/H5VLiod_client.h index aabf520..a5ae2f4 100644 --- a/src/H5VLiod_client.h +++ b/src/H5VLiod_client.h @@ -484,8 +484,8 @@ H5_DLL herr_t H5VL_iod_prefetch(void *obj, hid_t rcxt_id, hrpl_t *replica_id, hid_t apl_id, void **req); H5_DLL herr_t H5VL_iod_evict(void *obj, uint64_t c_version, hid_t apl_id, void **req); -H5_DLL void * H5VL_iod_view_create(void *_obj, hid_t query_id, hid_t vcpl_id, - hid_t rcxt_id, void **req); +H5_DLL void * H5VL_iod_view_create(void *_obj, hid_t query_id, hid_t dataspace_id, + hid_t vcpl_id, hid_t rcxt_id, void **req); H5_DLL herr_t H5VL_iod_view_close(H5VL_iod_view_t *view); H5_DLL herr_t H5VL_iod_analysis_execute(const char *file_name, const char *obj_name, diff --git a/src/H5VLiod_common.h b/src/H5VLiod_common.h index f0e42dd..2e7a691 100644 --- a/src/H5VLiod_common.h +++ b/src/H5VLiod_common.h @@ -756,6 +756,7 @@ MERCURY_GEN_PROC(view_create_in_t, ((iod_obj_id_t)(loc_mdkv_id)) ((uint64_t)(rcxt_num)) ((int32_t)(obj_type)) + ((hid_t)(dataspace_id)) ((hid_t)(vcpl_id)) ((hid_t)(query_id))) @@ -42,6 +42,10 @@ #include "H5Spublic.h" /* Dataspaces */ #include "H5Tpublic.h" /* Datatypes */ #include "H5TRpublic.h" /* Transcations */ +#include "H5Vpublic.h" /* Views */ +#ifdef H5_HAVE_INDEXING +#include "H5Xpublic.h" /* Index plugins */ +#endif #include "H5Zpublic.h" /* Data filters */ #include "H5VLpublic.h" /* VOL plugins */ |