diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2014-10-13 22:27:55 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2016-11-29 23:42:29 (GMT) |
commit | 7bbc1ff857089c6251c35ac148f4b4ac76039062 (patch) | |
tree | 48bfcdd5288d5cca946ee541dab511c184bb8869 /src | |
parent | 650eb10cb82a82d5ec368fe294d81806cdb42f2b (diff) | |
download | hdf5-7bbc1ff857089c6251c35ac148f4b4ac76039062.zip hdf5-7bbc1ff857089c6251c35ac148f4b4ac76039062.tar.gz hdf5-7bbc1ff857089c6251c35ac148f4b4ac76039062.tar.bz2 |
Add H5D_set_index/H5D_get_index/H5D_remove_index
Add H5O_idxinfo_free/H5O_idxinfo_delete callbacks
Replace dataset_id by file_id in H5X remove callback
Support H5Xremove
Cleanup plugins
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dint.c | 91 | ||||
-rw-r--r-- | src/H5Dprivate.h | 8 | ||||
-rw-r--r-- | src/H5Oidxinfo.c | 84 | ||||
-rw-r--r-- | src/H5X.c | 47 | ||||
-rw-r--r-- | src/H5Xalacrity.c | 125 | ||||
-rw-r--r-- | src/H5Xdummy.c | 66 | ||||
-rw-r--r-- | src/H5Xfastbit.c | 87 | ||||
-rw-r--r-- | src/H5Xpublic.h | 8 |
8 files changed, 361 insertions, 155 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index 2633415..a65bdfb 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -3108,23 +3108,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_set_index(H5D_t *dset, H5X_class_t *idx_class, void *idx_handle, - H5O_idxinfo_t idx_info) +H5D_set_index(H5D_t *dset, unsigned count, H5X_class_t **idx_class, + void **idx_handle, H5O_idxinfo_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(dset); + /* Do not support more than one index for now */ + HDassert(count <= 1); + HDassert(idx_class); + HDassert(idx_handle); + HDassert(idx_info); /* Write the index header message */ - if (H5O_msg_create(&dset->oloc, H5O_IDXINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, &idx_info, H5AC_dxpl_id)) + if (H5O_msg_create(&dset->oloc, H5O_IDXINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, idx_info, H5AC_dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update index header message"); /* Set user data for index */ - dset->shared->idx_class = idx_class; - dset->shared->idx_handle = idx_handle; - if (NULL == H5O_msg_copy(H5O_IDXINFO_ID, &idx_info, &dset->shared->idx_info)) + dset->shared->idx_class = *idx_class; + dset->shared->idx_handle = *idx_handle; + if (NULL == H5O_msg_copy(H5O_IDXINFO_ID, idx_info, &dset->shared->idx_info)) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to update copy message"); done: @@ -3132,6 +3137,80 @@ done: } /* end H5D_set_index() */ /*------------------------------------------------------------------------- + * Function: H5D_get_index + * + * Purpose: Get index information. + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_get_index(H5D_t *dset, unsigned max_count, H5X_class_t **idx_class, + void **idx_handle, H5O_idxinfo_t **idx_info, unsigned *actual_count) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(dset); + HDassert(max_count); + + /* Get user data for index */ + if (idx_class) *idx_class = dset->shared->idx_class; + if (idx_handle) *idx_handle = dset->shared->idx_handle; + if (idx_info) *idx_info = &dset->shared->idx_info; + /* Just one index for now */ + if (actual_count) *actual_count = (dset->shared->idx_class) ? 1 : 0; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_get_index() */ + +/*------------------------------------------------------------------------- + * Function: H5D_remove_index + * + * Purpose: Remove index. + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_remove_index(H5D_t *dset, unsigned UNUSED plugin_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(dset); + + /* First close index if opened */ + if (dset->shared->idx_handle) { + H5X_class_t *idx_class = dset->shared->idx_class; + + if (NULL == (idx_class->close)) + HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin close callback not defined"); + if (FAIL == idx_class->close(dset->shared->idx_handle)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTCLOSEOBJ, FAIL, "cannot close index"); + + dset->shared->idx_class = NULL; + dset->shared->idx_handle = NULL; + } + + /* Remove idx_handle from dataset */ + if (H5O_msg_remove(&dset->oloc, H5O_IDXINFO_ID, H5O_ALL, TRUE, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete index messages"); + + if (FAIL == H5O_msg_reset(H5O_IDXINFO_ID, &dset->shared->idx_info)) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to free index index"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_remove_index() */ + +/*------------------------------------------------------------------------- * Function: H5D__query_index * * Purpose: Returns a dataspace selection of dataset elements that match diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 7689f61..330d7a5 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -173,8 +173,12 @@ H5_DLL hid_t H5D_get_create_plist(H5D_t *dset); H5_DLL hid_t H5D_get_access_plist(H5D_t *dset); H5_DLL hid_t H5D_get_space(H5D_t *dset); H5_DLL hid_t H5D_get_type(H5D_t *dset); -H5_DLL herr_t H5D_set_index(H5D_t *dset, H5X_class_t *idx_class, void *idx_handle, - H5O_idxinfo_t idx_info); +H5_DLL herr_t H5D_set_index(H5D_t *dset, unsigned count, H5X_class_t **idx_class, + void **idx_handle, H5O_idxinfo_t *idx_info); +H5_DLL herr_t H5D_get_index(H5D_t *dset, unsigned max_count, + H5X_class_t **idx_class, void **idx_handle, H5O_idxinfo_t **idx_info, + unsigned *actual_count); +H5_DLL herr_t H5D_remove_index(H5D_t *dset, unsigned plugin_id); /* Functions that operate on vlen data */ H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, diff --git a/src/H5Oidxinfo.c b/src/H5Oidxinfo.c index 247a27e..ba58d05 100644 --- a/src/H5Oidxinfo.c +++ b/src/H5Oidxinfo.c @@ -31,6 +31,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Fprivate.h" +#include "H5Xprivate.h" /* PRIVATE PROTOTYPES */ @@ -42,6 +43,9 @@ static void *H5O_idxinfo_copy(const void *_mesg, void *_dest); static size_t H5O_idxinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_idxinfo_reset(void *_mesg); +static herr_t H5O_idxinfo_free(void *_mesg); +static herr_t H5O_idxinfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + void *_mesg); static herr_t H5O_idxinfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -56,8 +60,8 @@ const H5O_msg_class_t H5O_MSG_IDXINFO[1] = {{ H5O_idxinfo_copy, /* copy the native value */ H5O_idxinfo_size, /* raw message size */ H5O_idxinfo_reset, /* free internal memory */ - NULL, /* free method */ - NULL, /* file delete method */ + H5O_idxinfo_free, /* free method */ + H5O_idxinfo_delete, /* file delete method */ NULL, /* link method */ NULL, /* set share method */ NULL, /* can share method */ @@ -234,12 +238,6 @@ H5O_idxinfo_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const voi * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 12 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -261,6 +259,74 @@ H5O_idxinfo_reset(void *_mesg) } /* end H5O_idxinfo_reset() */ /*------------------------------------------------------------------------- + * Function: H5O_idxinfo_free + * + * Purpose: Frees the message + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_idxinfo_free(void *_mesg) +{ + H5O_idxinfo_t *mesg = (H5O_idxinfo_t *) _mesg; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* check args */ + HDassert(mesg); + + /* Free resources within the message */ + if(H5O_idxinfo_reset(mesg) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free message resources"); + + mesg = (H5O_idxinfo_t *)H5MM_xfree(mesg); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_idxinfo_free() */ + +/*------------------------------------------------------------------------- + * Function: H5O_idxinfo_delete + * + * Purpose: Free file space referenced by message + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_idxinfo_delete(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t *open_oh, void *_mesg) +{ + hid_t file_id; + H5O_idxinfo_t *mesg = (H5O_idxinfo_t *) _mesg; + H5X_class_t *idx_class = NULL; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* check args */ + HDassert(f); + HDassert(open_oh); + HDassert(mesg); + + file_id = H5F_get_file_id(f); + + /* call plugin index remove callback */ + if (NULL == (idx_class = H5X_registered(mesg->plugin_id))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "can't get index plugin class"); + if (NULL == idx_class->remove) + HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin remove callback is not defined"); + if (FAIL == idx_class->remove(file_id, mesg->metadata_size, mesg->metadata)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTCREATE, FAIL, "cannot remove index"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_idxinfo_delete() */ + +/*------------------------------------------------------------------------- * Function: H5O_idxinfo_debug * * Purpose: Prints debugging info for the message. @@ -286,7 +352,7 @@ H5O_idxinfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, "Plugin ID:", mesg->plugin_id); - fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, "Metadata Size:", + fprintf(stream, "%*s%-*s %llu\n", indent, "", fwidth, "Metadata Size:", mesg->metadata_size); FUNC_LEAVE_NOAPI(SUCCEED) @@ -35,6 +35,10 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5Xpkg.h" /* Index plugins */ #include "H5Dprivate.h" /* Datasets */ +#include "H5Oprivate.h" + +#define H5D_PACKAGE +#include "H5Dpkg.h" /****************/ /* Local Macros */ @@ -47,7 +51,6 @@ /********************/ /* Local Prototypes */ /********************/ -H5_DLL int H5X_term_interface(void); /*********************/ /* Package Variables */ @@ -253,7 +256,7 @@ H5X_register(const H5X_class_t *index_class) FUNC_ENTER_NOAPI_NOINIT HDassert(index_class); - HDassert(index_class->id >= 0 && index_class->id <= H5X_PLUGIN_MAX); + HDassert(index_class->id <= H5X_PLUGIN_MAX); /* Is the index class already registered? */ for (i = 0; i < H5X_table_used_g; i++) @@ -335,7 +338,7 @@ H5X_unregister(unsigned plugin_id) FUNC_ENTER_NOAPI_NOINIT - HDassert((plugin_id >= 0) && (plugin_id <= H5X_PLUGIN_MAX)); + HDassert(plugin_id <= H5X_PLUGIN_MAX); /* Is the plugin already registered? */ if (FALSE == H5X__registered(plugin_id, &plugin_index)) @@ -427,7 +430,7 @@ H5Xcreate(hid_t scope_id, unsigned plugin_id, hid_t xcpl_id) idx_info.plugin_id = plugin_id; idx_info.metadata_size = metadata_size; idx_info.metadata = metadata; - if (FAIL == H5D_set_index(dset, idx_class, idx_handle, idx_info)) + if (FAIL == H5D_set_index(dset, 1, &idx_class, &idx_handle, &idx_info)) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "cannot set index"); done: @@ -446,12 +449,8 @@ done: herr_t H5Xremove(hid_t scope_id, unsigned plugin_id) { - void *dset = NULL; + H5D_t *dset = NULL; size_t plugin_index; - hid_t dataset_id = scope_id; /* TODO for now */ - hid_t xapl_id = H5P_INDEX_ACCESS_DEFAULT; /* TODO for now */ - size_t metadata_size; /* size of metadata created by plugin */ - void *metadata; /* metadata created by plugin that needs to be stored */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -460,23 +459,12 @@ H5Xremove(hid_t scope_id, unsigned plugin_id) /* Check args */ if (plugin_id > H5X_PLUGIN_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid plugin identification number"); - if (NULL == H5I_object_verify(scope_id, H5I_DATASET)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "scope_id is restricted to dataset ID"); - - /* Is the plugin already registered */ - if (FALSE == H5X__registered(plugin_id, &plugin_index)) - HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin is not registered"); - - /* Get index info */ - - /* Call remove of the plugin */ - if (NULL == H5X_table_g[plugin_index].remove) - HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin remove callback is not defined"); - if (FAIL == H5X_table_g[plugin_index].remove(dataset_id, metadata_size, - metadata)) - HGOTO_ERROR(H5E_INDEX, H5E_CANTCREATE, FAIL, "cannot remove index"); + if (NULL == (dset = (H5D_t *) H5I_object_verify(scope_id, H5I_DATASET))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Remove idx_handle from dataset */ + if (FAIL == H5D_remove_index(dset, plugin_id)) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete index messages") done: FUNC_LEAVE_API(ret_value) @@ -494,18 +482,21 @@ done: herr_t H5Xget_count(hid_t scope_id, hsize_t *idx_count) { - void *dset; + H5D_t *dset = NULL; + unsigned actual_count; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", scope_id, idx_count); - if (NULL == H5I_object_verify(scope_id, H5I_DATASET)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "scope_id is restricted to dataset ID"); + if (NULL == (dset = (H5D_t *) H5I_object_verify(scope_id, H5I_DATASET))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if (!idx_count) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "idx_count is NULL"); + if (FAIL == H5D_get_index(dset, 1, NULL, NULL, NULL, &actual_count)) + HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin is not registered"); - *idx_count = 1; + *idx_count = actual_count; done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Xalacrity.c b/src/H5Xalacrity.c index 4be6ad2..b71b3e4 100644 --- a/src/H5Xalacrity.c +++ b/src/H5Xalacrity.c @@ -54,7 +54,8 @@ fflush(stdout); \ } while (0) #else -#define H5X_ALACRITY_LOG_DEBUG +#define H5X_ALACRITY_LOG_DEBUG(...) do { \ + } while (0) #endif /******************/ @@ -83,8 +84,8 @@ typedef struct H5X_alacrity_range_t { } H5X_alacrity_range_t; struct H5X_alacrity_scatter_info { - void *src_buf; /* Source data buffer */ - size_t src_buf_size; /* Remaining number of elements to return */ + const void *src_buf; /* Source data buffer */ + size_t src_buf_size; /* Remaining number of elements to return */ }; /********************/ @@ -160,7 +161,7 @@ H5X_alacrity_create(hid_t dataset_id, hid_t xcpl_id, hid_t xapl_id, size_t *metadata_size, void **metadata); static herr_t -H5X_alacrity_remove(hid_t dataset_id, size_t metadata_size, void *metadata); +H5X_alacrity_remove(hid_t file_id, size_t metadata_size, void *metadata); static void * H5X_alacrity_open(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, @@ -208,18 +209,20 @@ extern _Bool findBinRange1C(const ALMetadata *meta, ALUnivariateQuery *query, /* Alacrity index class */ const H5X_class_t H5X_ALACRITY[1] = {{ - H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */ - H5X_PLUGIN_ALACRITY, /* (Or whatever number is assigned) */ - "ALACRITY index plugin", /* Whatever name desired */ - H5X_TYPE_DATA_ELEM, /* This plugin operates on dataset elements */ - H5X_alacrity_create, /* create */ - H5X_alacrity_remove, /* remove */ - H5X_alacrity_open, /* open */ - H5X_alacrity_close, /* close */ - H5X_alacrity_pre_update, /* pre_update */ - H5X_alacrity_post_update, /* post_update */ - H5X_alacrity_query, /* query */ - H5X_alacrity_refresh /* refresh */ + H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */ + H5X_PLUGIN_ALACRITY, /* (Or whatever number is assigned) */ + "ALACRITY index plugin", /* Whatever name desired */ + H5X_TYPE_DATA_ELEM, /* This plugin operates on dataset elements */ + H5X_alacrity_create, /* create */ + H5X_alacrity_remove, /* remove */ + H5X_alacrity_open, /* open */ + H5X_alacrity_close, /* close */ + H5X_alacrity_pre_update, /* pre_update */ + H5X_alacrity_post_update, /* post_update */ + H5X_alacrity_query, /* query */ + H5X_alacrity_refresh, /* refresh */ + NULL, /* copy */ + NULL /* get_size */ }}; /*------------------------------------------------------------------------- @@ -321,6 +324,9 @@ H5X__alacrity_term(H5X_alacrity_t *alacrity) H5MM_free(alacrity->private_metadata); + if (FAIL == H5Fclose(alacrity->file_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTCLOSEOBJ, FAIL, "can't close file ID"); + /* Free dim arrays */ H5MM_free(alacrity->dataset_dims); H5MM_free(alacrity->dataset_down_dims); @@ -586,6 +592,7 @@ static herr_t H5X__alacrity_update_index(H5X_alacrity_t *alacrity, const void *buf, size_t buf_size) { + hid_t metadata_space_id, index_space_id; hsize_t metadata_size, index_size; memstream_t memstream; size_t nelmts; @@ -609,19 +616,6 @@ H5X__alacrity_update_index(H5X_alacrity_t *alacrity, const void *buf, /* Call ALACRITY encoder */ H5X_ALACRITY_LOG_DEBUG("Calling ALACRITY encoder on data (%zu elements)", nelmts); -//#ifdef H5X_ALACRITY_DEBUG -// { -// printf("----------------------------\n"); -// printf("----------------------------\n"); -// int i; -// const float *buf_float = (const float *) buf; -// for (i = 0; i < nelmts; i++) -// printf("%f\n", buf_float[i]); -// printf("----------------------------\n"); -// printf("----------------------------\n"); -// } -//#endif - if (ALErrorNone != ALEncode(&alacrity->config, buf, nelmts, alacrity->output)) HGOTO_ERROR(H5E_INDEX, H5E_CANTENCODE, FAIL, "ALACRITY encoder failed"); @@ -639,30 +633,8 @@ H5X__alacrity_update_index(H5X_alacrity_t *alacrity, const void *buf, &alacrity->output->metadata))) HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "ALACRITY index size is NULL"); - size_t prev_metadata_size; - { - hid_t type_id, space_id; - size_t nelmts_data, data_elmt_size; - - if (FAIL == (type_id = H5Dget_type(alacrity->metadata_id))) - HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "can't get type from dataset"); - if (FAIL == (space_id = H5Dget_space(alacrity->metadata_id))) - HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "can't get dataspace from dataset"); - if (0 == (nelmts_data = (size_t) H5Sget_select_npoints(space_id))) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid number of elements"); - if (0 == (data_elmt_size = H5Tget_size(type_id))) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid size of element"); - - prev_metadata_size = data_elmt_size * nelmts_data; - H5X_ALACRITY_LOG_DEBUG("Old metadata size: %zu", prev_metadata_size); - - H5Tclose(type_id); - H5Sclose(space_id); - } - H5X_ALACRITY_LOG_DEBUG("Metadata size: %zu", (size_t) metadata_size); H5X_ALACRITY_LOG_DEBUG("Index size: %zu", (size_t) index_size); - hid_t metadata_space_id, index_space_id; /* Create metadata array with opaque type */ H5Dclose(alacrity->metadata_id); @@ -686,16 +658,12 @@ H5X__alacrity_update_index(H5X_alacrity_t *alacrity, const void *buf, memstreamInit(&memstream, metadata_buf); if (ALErrorNone != ALSerializeMetadata(&alacrity->output->metadata, &memstream)) HGOTO_ERROR(H5E_INDEX, H5E_CANTSERIALIZE, FAIL, "can't serialize ALACRITY metadata"); -// if (FAIL == H5Dset_extent_ff(alacrity->metadata_id, &metadata_size, trans_id, H5_EVENT_STACK_NULL)) -// HGOTO_ERROR(H5E_INDEX, H5E_CANTSET, FAIL, "can't set extent for index metadata"); if (FAIL == H5Dwrite(alacrity->metadata_id, alacrity->opaque_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, memstream.buf)) HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "can't write index metadata"); memstreamDestroy(&memstream, 0); /* Write ALACRITY index */ -// if (FAIL == H5Dset_extent_ff(alacrity->index_id, &index_size, trans_id, H5_EVENT_STACK_NULL)) -// HGOTO_ERROR(H5E_INDEX, H5E_CANTSET, FAIL, "can't set extent for index metadata"); if (FAIL == H5Dwrite(alacrity->index_id, alacrity->opaque_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, alacrity->output->index)) HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "can't write index data"); @@ -982,7 +950,7 @@ done: */ static herr_t H5X__alacrity_get_query_ranges(hid_t query_id, - H5X_alacrity_range_t *query_ranges, size_t *nranges) + H5X_alacrity_range_t *query_ranges, size_t UNUSED *nranges) { H5Q_t *query; herr_t ret_value = SUCCEED; /* Return value */ @@ -1014,7 +982,6 @@ H5X__alacrity_find_bin_range(ALMetadata *metadata, value_types_t query_lb, hbool_t ret_value = FALSE; /* Return value */ ALUnivariateQuery univariate_query; ALBinLayout *bl = &metadata->binLayout; - uint64_t resultCount; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1029,12 +996,16 @@ H5X__alacrity_find_bin_range(ALMetadata *metadata, value_types_t query_lb, /* Call internal ALACRITY findBinRange1C routine */ ret_value = findBinRange1C(metadata, &univariate_query, start_bin, end_bin) ? TRUE : FALSE; +#ifdef H5X_ALACRITY_DEBUG if (ret_value) { + uint64_t resultCount; + H5X_ALACRITY_LOG_DEBUG("Start bin: %d", *start_bin); H5X_ALACRITY_LOG_DEBUG("End bin: %d", *end_bin); resultCount = bl->binStartOffsets[*end_bin] - bl->binStartOffsets[*start_bin]; H5X_ALACRITY_LOG_DEBUG("Result count: %lu", resultCount); } +#endif FUNC_LEAVE_NOAPI(ret_value); } @@ -1252,7 +1223,7 @@ done: *------------------------------------------------------------------------ */ static void * -H5X_alacrity_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t xapl_id, +H5X_alacrity_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t UNUSED xapl_id, size_t *metadata_size, void **metadata) { H5X_alacrity_t *alacrity = NULL; @@ -1260,7 +1231,6 @@ H5X_alacrity_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t xapl_id, size_t private_metadata_size; void *buf = NULL; size_t buf_size; - uint64_t version; FUNC_ENTER_NOAPI_NOINIT H5X_ALACRITY_LOG_DEBUG("Enter"); @@ -1314,14 +1284,39 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5X_alacrity_remove(hid_t UNUSED dataset_id, size_t UNUSED metadata_size, - void UNUSED *metadata) +H5X_alacrity_remove(hid_t file_id, size_t metadata_size, void *metadata) { + hid_t metadata_id, index_id; + char *buf_ptr = metadata; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT H5X_ALACRITY_LOG_DEBUG("Enter"); + if (metadata_size < (2 * sizeof(haddr_t))) + HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "metadata size is not valid"); + + /* Decode metadata info */ + if (FAIL == (metadata_id = H5Oopen_by_addr(file_id, *((haddr_t *) buf_ptr)))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "can't open anonymous dataset"); + buf_ptr += sizeof(haddr_t); + + /* Decode index info */ + if (FAIL == (index_id = H5Oopen_by_addr(file_id, *((haddr_t *) buf_ptr)))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "can't open anonymous dataset"); + + /* Decrement refcount so that anonymous dataset gets deleted */ + if (FAIL == H5Odecr_refcount(metadata_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTDEC, FAIL, "can't decrement dataset refcount"); + if (FAIL == H5Odecr_refcount(index_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTDEC, FAIL, "can't decrement dataset refcount"); + +done: + if (FAIL != metadata_id) + H5Dclose(metadata_id); + if (FAIL != index_id) + H5Dclose(index_id); + H5X_ALACRITY_LOG_DEBUG("Leave"); FUNC_LEAVE_NOAPI(ret_value) } /* end H5X_alacrity_remove() */ @@ -1337,7 +1332,7 @@ H5X_alacrity_remove(hid_t UNUSED dataset_id, size_t UNUSED metadata_size, *------------------------------------------------------------------------- */ static void * -H5X_alacrity_open(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, +H5X_alacrity_open(hid_t dataset_id, hid_t UNUSED xapl_id, size_t metadata_size, void *metadata) { H5X_alacrity_t *alacrity = NULL; @@ -1434,7 +1429,7 @@ done: */ static herr_t H5X_alacrity_post_update(void *idx_handle, const void *data, - hid_t dataspace_id, hid_t xxpl_id) + hid_t dataspace_id, hid_t UNUSED xxpl_id) { H5X_alacrity_t *alacrity = (H5X_alacrity_t *) idx_handle; herr_t ret_value = SUCCEED; /* Return value */ @@ -1477,7 +1472,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5X_alacrity_query(void *idx_handle, hid_t query_id, hid_t xxpl_id, +H5X_alacrity_query(void *idx_handle, hid_t query_id, hid_t UNUSED xxpl_id, hid_t *dataspace_id) { H5X_alacrity_t *alacrity = (H5X_alacrity_t *) idx_handle; diff --git a/src/H5Xdummy.c b/src/H5Xdummy.c index 7b66947..1e12848 100644 --- a/src/H5Xdummy.c +++ b/src/H5Xdummy.c @@ -36,6 +36,19 @@ /****************/ /* Local Macros */ /****************/ +//#define H5X_DUMMY_DEBUG + +#ifdef H5X_DUMMY_DEBUG +#define H5X_DUMMY_LOG_DEBUG(...) do { \ + fprintf(stdout, " # %s(): ", __func__); \ + fprintf(stdout, __VA_ARGS__); \ + fprintf(stdout, "\n"); \ + fflush(stdout); \ + } while (0) +#else +#define H5X_DUMMY_LOG_DEBUG(...) do { \ + } while (0) +#endif /******************/ /* Local Typedefs */ @@ -62,7 +75,7 @@ H5X_dummy_create(hid_t dataset_id, hid_t xcpl_id, hid_t xapl_id, size_t *metadata_size, void **metadata); static herr_t -H5X_dummy_remove(hid_t dataset_id, size_t metadata_size, void *metadata); +H5X_dummy_remove(hid_t file_id, size_t metadata_size, void *metadata); static void * H5X_dummy_open(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, @@ -111,7 +124,9 @@ const H5X_class_t H5X_DUMMY[1] = {{ H5X_dummy_pre_update, /* pre_update */ H5X_dummy_post_update, /* post_update */ H5X_dummy_query, /* query */ - NULL /* refresh */ + NULL, /* refresh */ + NULL, /* copy */ + NULL /* get_size */ }}; /*------------------------------------------------------------------------- @@ -177,11 +192,11 @@ done: *------------------------------------------------------------------------ */ static void * -H5X_dummy_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t xapl_id, +H5X_dummy_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t UNUSED xapl_id, size_t *metadata_size, void **metadata) { H5X_dummy_t *dummy = NULL; - hid_t file_id, type_id, space_id; + hid_t file_id = FAIL, type_id, space_id; void *buf = NULL; size_t buf_size; H5O_info_t dset_info; @@ -189,7 +204,7 @@ H5X_dummy_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t xapl_id, FUNC_ENTER_NOAPI_NOINIT - printf("Calling H5X_dummy_create\n"); + H5X_DUMMY_LOG_DEBUG("Calling H5X_dummy_create"); if (NULL == (dummy = (H5X_dummy_t *) H5MM_malloc(sizeof(H5X_dummy_t)))) HGOTO_ERROR(H5E_INDEX, H5E_NOSPACE, NULL, "can't allocate dummy struct"); @@ -240,6 +255,8 @@ H5X_dummy_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t xapl_id, ret_value = dummy; done: + if (FAIL != file_id) + H5Fclose(file_id); H5MM_free(buf); FUNC_LEAVE_NOAPI(ret_value) } /* end H5X_dummy_create() */ @@ -254,17 +271,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5X_dummy_remove(hid_t UNUSED dataset_id, size_t UNUSED metadata_size, - void UNUSED *metadata) +H5X_dummy_remove(hid_t file_id, size_t metadata_size, void *metadata) { + hid_t idx_anon_id = FAIL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT + + H5X_DUMMY_LOG_DEBUG("Calling H5X_dummy_remove"); + + if (metadata_size < sizeof(haddr_t)) + HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "metadata size is not valid"); - printf("Calling H5X_dummy_remove\n"); + if (FAIL == (idx_anon_id = H5Oopen_by_addr(file_id, *((haddr_t *) metadata)))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "can't open anonymous dataset"); - /* TODO Does not do anything */ + /* Decrement refcount so that anonymous dataset gets deleted */ + if (FAIL == H5Odecr_refcount(idx_anon_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTDEC, FAIL, "can't decrement dataset refcount"); +done: + if (FAIL != idx_anon_id) + H5Dclose(idx_anon_id); FUNC_LEAVE_NOAPI(ret_value) } /* end H5X_dummy_remove() */ @@ -279,7 +307,7 @@ H5X_dummy_remove(hid_t UNUSED dataset_id, size_t UNUSED metadata_size, *------------------------------------------------------------------------- */ static void * -H5X_dummy_open(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, +H5X_dummy_open(hid_t dataset_id, hid_t UNUSED xapl_id, size_t metadata_size, void *metadata) { hid_t file_id; @@ -288,7 +316,7 @@ H5X_dummy_open(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, FUNC_ENTER_NOAPI_NOINIT - printf("Calling H5X_dummy_open\n"); + H5X_DUMMY_LOG_DEBUG("Calling H5X_dummy_open"); if (!metadata_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "NULL metadata size"); @@ -333,7 +361,7 @@ H5X_dummy_close(void *idx_handle) FUNC_ENTER_NOAPI_NOINIT - printf("Calling H5X_dummy_close\n"); + H5X_DUMMY_LOG_DEBUG("Calling H5X_dummy_close"); if (NULL == dummy) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL index handle"); @@ -366,7 +394,7 @@ H5X_dummy_pre_update(void *idx_handle, hid_t UNUSED dataspace_id, hid_t UNUSED x FUNC_ENTER_NOAPI_NOINIT - printf("Calling H5X_dummy_pre_update\n"); + H5X_DUMMY_LOG_DEBUG("Calling H5X_dummy_pre_update"); if (NULL == dummy) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL index handle"); @@ -387,7 +415,7 @@ done: */ static herr_t H5X_dummy_post_update(void *idx_handle, const void *buf, hid_t dataspace_id, - hid_t xxpl_id) + hid_t UNUSED xxpl_id) { H5X_dummy_t *dummy = (H5X_dummy_t *) idx_handle; hid_t mem_type_id, file_space_id; @@ -395,7 +423,7 @@ H5X_dummy_post_update(void *idx_handle, const void *buf, hid_t dataspace_id, FUNC_ENTER_NOAPI_NOINIT - printf("Calling H5X_dummy_post_update\n"); + H5X_DUMMY_LOG_DEBUG("Calling H5X_dummy_post_update"); if (NULL == dummy) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL index handle"); @@ -468,7 +496,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5X_dummy_query(void *idx_handle, hid_t query_id, hid_t xxpl_id, +H5X_dummy_query(void *idx_handle, hid_t query_id, hid_t UNUSED xxpl_id, hid_t *dataspace_id) { H5X_dummy_t *dummy = (H5X_dummy_t *) idx_handle; @@ -481,7 +509,7 @@ H5X_dummy_query(void *idx_handle, hid_t query_id, hid_t xxpl_id, FUNC_ENTER_NOAPI_NOINIT - printf("Calling H5X_dummy_query\n"); + H5X_DUMMY_LOG_DEBUG("Calling H5X_dummy_query"); if (NULL == dummy) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL index handle"); @@ -518,7 +546,7 @@ H5X_dummy_query(void *idx_handle, hid_t query_id, hid_t xxpl_id, HGOTO_ERROR(H5E_INDEX, H5E_CANTCOMPUTE, FAIL, "failed to compute buffer size"); *dataspace_id = udata.space_query; - printf("Created dataspace from index with %d elements\n", + H5X_DUMMY_LOG_DEBUG("Created dataspace from index with %d elements", (int) H5Sget_select_npoints(*dataspace_id)); done: diff --git a/src/H5Xfastbit.c b/src/H5Xfastbit.c index 9c08f52..e922a03 100644 --- a/src/H5Xfastbit.c +++ b/src/H5Xfastbit.c @@ -57,7 +57,8 @@ } while (0) #else #define H5X_FASTBIT_DEBUG_LVL 0 -#define H5X_FASTBIT_LOG_DEBUG +#define H5X_FASTBIT_LOG_DEBUG(...) do { \ + } while (0) #endif /******************/ @@ -92,8 +93,8 @@ typedef struct H5X_fastbit_t { } H5X_fastbit_t; struct H5X_fastbit_scatter_info { - void *src_buf; /* Source data buffer */ - size_t src_buf_size; /* Remaining number of elements to return */ + const void *src_buf; /* Source data buffer */ + size_t src_buf_size; /* Remaining number of elements to return */ }; /********************/ @@ -145,7 +146,7 @@ H5X_fastbit_create(hid_t dataset_id, hid_t xcpl_id, hid_t xapl_id, size_t *metadata_size, void **metadata); static herr_t -H5X_fastbit_remove(hid_t dataset_id, size_t metadata_size, void *metadata); +H5X_fastbit_remove(hid_t file_id, size_t metadata_size, void *metadata); static void * H5X_fastbit_open(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, @@ -183,18 +184,20 @@ H5X_fastbit_refresh(void *idx_handle, size_t *metadata_size, void **metadata); /* FastBit index class */ const H5X_class_t H5X_FASTBIT[1] = {{ - H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */ - H5X_PLUGIN_FASTBIT, /* (Or whatever number is assigned) */ - "FASTBIT index plugin", /* Whatever name desired */ - H5X_TYPE_DATA_ELEM, /* This plugin operates on dataset elements */ - H5X_fastbit_create, /* create */ - H5X_fastbit_remove, /* remove */ - H5X_fastbit_open, /* open */ - H5X_fastbit_close, /* close */ - H5X_fastbit_pre_update, /* pre_update */ - H5X_fastbit_post_update, /* post_update */ - H5X_fastbit_query, /* query */ - H5X_fastbit_refresh /* refresh */ + H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */ + H5X_PLUGIN_FASTBIT, /* (Or whatever number is assigned) */ + "FASTBIT index plugin", /* Whatever name desired */ + H5X_TYPE_DATA_ELEM, /* This plugin operates on dataset elements */ + H5X_fastbit_create, /* create */ + H5X_fastbit_remove, /* remove */ + H5X_fastbit_open, /* open */ + H5X_fastbit_close, /* close */ + H5X_fastbit_pre_update, /* pre_update */ + H5X_fastbit_post_update, /* post_update */ + H5X_fastbit_query, /* query */ + H5X_fastbit_refresh, /* refresh */ + NULL, /* copy */ + NULL /* get_size */ }}; /*------------------------------------------------------------------------- @@ -298,6 +301,9 @@ H5X__fastbit_term(H5X_fastbit_t *fastbit) H5MM_free(fastbit->private_metadata); + if (FAIL == H5Fclose(fastbit->file_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTCLOSEOBJ, FAIL, "can't close file ID"); + /* Free dim arrays */ H5MM_free(fastbit->dataset_dims); H5MM_free(fastbit->dataset_down_dims); @@ -1085,7 +1091,7 @@ done: *------------------------------------------------------------------------ */ static void * -H5X_fastbit_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t xapl_id, +H5X_fastbit_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t UNUSED xapl_id, size_t *metadata_size, void **metadata) { H5X_fastbit_t *fastbit = NULL; @@ -1093,7 +1099,6 @@ H5X_fastbit_create(hid_t dataset_id, hid_t UNUSED xcpl_id, hid_t xapl_id, size_t private_metadata_size; void *buf = NULL; size_t buf_size; - uint64_t version; FUNC_ENTER_NOAPI_NOINIT H5X_FASTBIT_LOG_DEBUG("Enter"); @@ -1147,14 +1152,48 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5X_fastbit_remove(hid_t UNUSED dataset_id, size_t UNUSED metadata_size, - void UNUSED *metadata) +H5X_fastbit_remove(hid_t file_id, size_t metadata_size, void *metadata) { + hid_t keys_id, offsets_id, bitmaps_id; + char *buf_ptr = metadata; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT H5X_FASTBIT_LOG_DEBUG("Enter"); + if (metadata_size < (3 * sizeof(haddr_t))) + HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "metadata size is not valid"); + + /* Decode keys info */ + if (FAIL == (keys_id = H5Oopen_by_addr(file_id, *((haddr_t *) buf_ptr)))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "can't open anonymous dataset"); + buf_ptr += sizeof(haddr_t); + + /* Decode offsets info */ + if (FAIL == (offsets_id = H5Oopen_by_addr(file_id, *((haddr_t *) buf_ptr)))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "can't open anonymous dataset"); + buf_ptr += sizeof(haddr_t); + + /* Decode bitmaps info */ + if (FAIL == (bitmaps_id = H5Oopen_by_addr(file_id, *((haddr_t *) buf_ptr)))) + HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "can't open anonymous dataset"); + + /* Decrement refcount so that anonymous dataset gets deleted */ + if (FAIL == H5Odecr_refcount(keys_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTDEC, FAIL, "can't decrement dataset refcount"); + if (FAIL == H5Odecr_refcount(offsets_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTDEC, FAIL, "can't decrement dataset refcount"); + if (FAIL == H5Odecr_refcount(bitmaps_id)) + HGOTO_ERROR(H5E_INDEX, H5E_CANTDEC, FAIL, "can't decrement dataset refcount"); + +done: + if (FAIL != keys_id) + H5Dclose(keys_id); + if (FAIL != offsets_id) + H5Dclose(offsets_id); + if (FAIL != bitmaps_id) + H5Dclose(bitmaps_id); + H5X_FASTBIT_LOG_DEBUG("Leave"); FUNC_LEAVE_NOAPI(ret_value) } /* end H5X_fastbit_remove() */ @@ -1170,7 +1209,7 @@ H5X_fastbit_remove(hid_t UNUSED dataset_id, size_t UNUSED metadata_size, *------------------------------------------------------------------------- */ static void * -H5X_fastbit_open(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, +H5X_fastbit_open(hid_t dataset_id, hid_t UNUSED xapl_id, size_t metadata_size, void *metadata) { H5X_fastbit_t *fastbit = NULL; @@ -1267,7 +1306,7 @@ done: */ static herr_t H5X_fastbit_post_update(void *idx_handle, const void *data, hid_t dataspace_id, - hid_t xxpl_id) + hid_t UNUSED xxpl_id) { H5X_fastbit_t *fastbit = (H5X_fastbit_t *) idx_handle; herr_t ret_value = SUCCEED; /* Return value */ @@ -1310,7 +1349,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5X_fastbit_query(void *idx_handle, hid_t query_id, hid_t xxpl_id, +H5X_fastbit_query(void *idx_handle, hid_t query_id, hid_t UNUSED xxpl_id, hid_t *dataspace_id) { H5X_fastbit_t *fastbit = (H5X_fastbit_t *) idx_handle; diff --git a/src/H5Xpublic.h b/src/H5Xpublic.h index ab53e05..b7238ab 100644 --- a/src/H5Xpublic.h +++ b/src/H5Xpublic.h @@ -64,7 +64,7 @@ typedef struct { /* Callbacks, described above */ void * (*create)(hid_t dataset_id, hid_t xcpl_id, hid_t xapl_id, size_t *metadata_size, void **metadata); - herr_t (*remove)(hid_t dataset_id, size_t metadata_size, void *metadata); + herr_t (*remove)(hid_t file_id, size_t metadata_size, void *metadata); void *(*open)(hid_t dataset_id, hid_t xapl_id, size_t metadata_size, void *metadata); herr_t (*close)(void *idx_handle); @@ -72,8 +72,12 @@ typedef struct { herr_t (*post_update)(void *idx_handle, const void *buf, hid_t dataspace_id, hid_t xxpl_id); herr_t (*query)(void *idx_handle, hid_t query_id, hid_t xxpl_id, - hid_t *dataspace_id); + hid_t *dataspace_id); herr_t (*refresh)(void *idx_handle, size_t *metadata_size, void **metadata); + herr_t (*copy)(hid_t src_dataset_id, hid_t dest_dataset_id, hid_t xcpl_id, + hid_t xapl_id, size_t src_metadata_size, void *src_metadata, + size_t *dest_metadata_size, void **dest_metadata); + herr_t (*get_size)(void *idx_handle, hsize_t *idx_size); } H5X_class_t; /********************/ |