mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-10-05 04:03:28 +03:00
Implements the blob storage mechanism from RFC-HDFG-2026-001: filters can attach a binary blob (configuration too large for cd_values or a parameter string, e.g. JIT-compiled filter source or a dataset reference) to a pipeline entry via the new H5Pappend_filter_blob() API. H5Z_class3_t gains three NULL-able callbacks: write_blob, read_blob, and close_blob. When NULL, the library stores the blob as a global-heap object at H5Dcreate time, recovers it at H5Dopen, and frees the buffer at dataset close; custom callbacks own their storage and receive an opaque H5Z_blob_loc_t locator passed unchanged through the pipeline message. H5Z_class_info_t reports implementation via has_blob_callbacks. On-disk, a version-3 pipeline message appends a has_aux flag byte per filter and, when set, the blob locator; the pipeline message's delete handler reclaims the heap object. H5Pencode serializes blob bytes inline so encoded DCPLs stay self-contained, and H5Pcopy deep-copies them, which carries blobs through h5repack with no tool-specific code. In parallel HDF5, rank 0 writes the blob and broadcasts the locator so all ranks encode identical pipeline messages. Writing the v3 pipeline message is gated behind a new library version bound, H5F_LIBVER_V220 (now aliased by H5F_LIBVER_LATEST): the enum, every *_ver_bounds[] array, H5trace, h5test's env parsing, and the Fortran/Java constants gain the new bound. All other message versions are unchanged from H5F_LIBVER_V200. Tests cover the default-storage round-trip (create/write/reopen/read, H5Pcopy and H5Pencode/H5Pdecode propagation, dataset delete), custom callbacks (invocation points, locator round-trip, allocator symmetry), and argument validation.
49 lines
2.3 KiB
Java
49 lines
2.3 KiB
Java
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
* Copyright by The HDF Group. *
|
|
* All rights reserved. *
|
|
* *
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
* the LICENSE file, which can be found at the root of the source code *
|
|
* distribution tree, or in https://www.hdfgroup.org/licenses. *
|
|
* If you do not have access to either file, you may request a copy from *
|
|
* help@hdfgroup.org. *
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
package hdf.hdf5lib.structs;
|
|
|
|
import java.io.Serializable;
|
|
|
|
/**
|
|
* Registry-level information about a filter (returned by H5Zget_filter_class_info).
|
|
*/
|
|
public class H5Z_class_info_t implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
/** Numeric filter identifier */
|
|
public int id;
|
|
/** Bitwise OR of H5Z_FILTER_CONFIG_ENCODE_ENABLED / H5Z_FILTER_CONFIG_DECODE_ENABLED */
|
|
public int config_flags;
|
|
/** Canonical name; null for class-2 (legacy) plugins */
|
|
public String name;
|
|
/** Human-readable description; null if not provided */
|
|
public String description;
|
|
/** True if the plugin implements the set_config callback */
|
|
public boolean has_set_config;
|
|
/** True if the plugin implements the get_config callback */
|
|
public boolean has_get_config;
|
|
/** True if the plugin implements its own write_blob/read_blob callbacks */
|
|
public boolean has_blob_callbacks;
|
|
|
|
public H5Z_class_info_t(int id, int config_flags, String name, String description, boolean has_set_config,
|
|
boolean has_get_config, boolean has_blob_callbacks)
|
|
{
|
|
this.id = id;
|
|
this.config_flags = config_flags;
|
|
this.name = name;
|
|
this.description = description;
|
|
this.has_set_config = has_set_config;
|
|
this.has_get_config = has_get_config;
|
|
this.has_blob_callbacks = has_blob_callbacks;
|
|
}
|
|
}
|