Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b340f0b
Expose H5Dchunk_iter, H5Dget_num_chunks, H5Dget_chunk_info in JNI Jav…
mkitti Jul 21, 2026
87fde45
Expose H5Dchunk_iter, H5Dget_num_chunks, H5Dget_chunk_info in FFM Jav…
mkitti Jul 21, 2026
4062dd5
Expose direct chunk I/O and inspection functions in JNI Java bindings
mkitti Jul 21, 2026
ed41afa
Expose direct chunk I/O and inspection functions in FFM Java bindings
mkitti Jul 21, 2026
08e1300
Cut per-chunk callback overhead in JNI H5Dchunk_iter, add benchmark w…
mkitti Jul 21, 2026
d428354
Add benchmark warm-up and shared-arena diagnostic to FFM chunk perf test
mkitti Jul 21, 2026
24e9353
Add H5Dchunk_iter_all bulk chunk enumeration to JNI Java bindings
mkitti Jul 21, 2026
96d25ed
Add H5Dchunk_iter_all bulk chunk enumeration to FFM Java bindings
mkitti Jul 21, 2026
bd18245
Apply clang-format to JNI chunk-function changes
mkitti Jul 21, 2026
991e37c
Apply clang-format to FFM chunk-function changes
mkitti Jul 21, 2026
cf9500a
Add missing JUnit-TestH5DChunkIterPerf.txt reference file (JNI)
mkitti Jul 21, 2026
478414c
Add missing JUnit-TestH5DChunkIterPerf.txt reference file (FFM)
mkitti Jul 21, 2026
84d5cc6
Fix stale JUnit-TestH5D.txt reference file (JNI)
mkitti Jul 21, 2026
9f8a8cc
Merge branch 'develop' into h5dchunk_java
mkitti Jul 21, 2026
5ba51ff
Fix stale JUnit-TestH5D.txt reference file (FFM)
mkitti Jul 21, 2026
c8609f3
Merge branch 'develop' into h5dchunk_java
mkitti Jul 22, 2026
10e5bba
Address Copilot review comments on PR #6547
mkitti Jul 22, 2026
58d84d9
Merge remote-tracking branch 'origin/develop' into h5dchunk_java
mkitti Aug 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions java/hdf/hdf5lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ set (HDF5_JAVA_HDF_HDF5_CALLBACKS_SOURCES
callbacks/H5A_iterate_t.java
callbacks/H5D_append_cb.java
callbacks/H5D_append_t.java
callbacks/H5D_chunk_iter_cb.java
callbacks/H5D_chunk_iter_t.java
callbacks/H5D_iterate_cb.java
callbacks/H5D_iterate_t.java
callbacks/H5E_walk_cb.java
Expand Down Expand Up @@ -85,6 +87,7 @@ set (HDF5_JAVA_HDF_HDF5_STRUCTS_SOURCES
structs/H5_ih_info_t.java
structs/H5A_info_t.java
structs/H5AC_cache_config_t.java
structs/H5D_chunk_info_t.java
structs/H5E_error2_t.java
structs/H5F_info2_t.java
structs/H5G_info_t.java
Expand Down
454 changes: 452 additions & 2 deletions java/hdf/hdf5lib/H5.java

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions java/hdf/hdf5lib/HDF5Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ public class HDF5Constants {
/** */
public static final int H5D_CHUNK_IDX_BTREE = H5D_CHUNK_IDX_BTREE();
/** */
public static final int H5D_CHUNK_IDX_SINGLE = H5D_CHUNK_IDX_SINGLE();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider dropping these unless they're necessary. They're really only useful for the H5Dget_chunk_index_type() function and that is meant to be an internal API (if one can even call an API internal). It's not really a function meant to be called or used for anything.

/** */
public static final int H5D_CHUNK_IDX_NONE = H5D_CHUNK_IDX_NONE();
/** */
public static final int H5D_CHUNK_IDX_FARRAY = H5D_CHUNK_IDX_FARRAY();
/** */
public static final int H5D_CHUNK_IDX_EARRAY = H5D_CHUNK_IDX_EARRAY();
/** */
public static final int H5D_CHUNK_IDX_BT2 = H5D_CHUNK_IDX_BT2();
/** */
public static final int H5D_ALLOC_TIME_DEFAULT = H5D_ALLOC_TIME_DEFAULT();
/** */
public static final int H5D_ALLOC_TIME_EARLY = H5D_ALLOC_TIME_EARLY();
Expand Down
50 changes: 50 additions & 0 deletions java/hdf/hdf5lib/callbacks/H5D_chunk_iter_cb.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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.callbacks;

import static org.hdfgroup.javahdf5.hdf5_h.*;

import java.lang.foreign.MemorySegment;

import org.hdfgroup.javahdf5.*;

/**
* Information class for the chunk iterator callback for H5Dchunk_iter.
*
*/
public interface H5D_chunk_iter_cb extends org.hdfgroup.javahdf5.H5D_chunk_iter_op_t.Function {
/**
* @ingroup JCALLBK
*
* application callback for each chunk of a chunked dataset
*
* @param offset the logical position of the chunk's first element in units of dataset
* elements, as a view over native memory owned by the underlying H5Dchunk_iter
* call. It is only valid for the duration of this callback invocation -- read
* the values out (e.g. via offset.toArray(ValueLayout.JAVA_LONG)) if they need
* to be retained after the callback returns.
* @param filter_mask bitmask indicating the filters used when the chunk was written
* @param addr the chunk address in the file, taking the user block (if any) into account
* @param size the chunk size in bytes, 0 if the chunk does not exist
* @param op_data the operator data passed in to H5Dchunk_iter
*
* @return operation status
* A. Zero causes the iterator to continue, returning zero when all
* chunks have been processed.
* B. Positive causes the iterator to immediately return that positive
* value, indicating short-circuit success.
* C. Negative causes the iterator to immediately return that value,
* indicating failure.
*/
int apply(MemorySegment offset, int filter_mask, long addr, long size, MemorySegment op_data);
}
24 changes: 24 additions & 0 deletions java/hdf/hdf5lib/callbacks/H5D_chunk_iter_t.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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.callbacks;

/**
* Data class for chunk iterator callback for H5Dchunk_iter.
*
*/
public interface H5D_chunk_iter_t {
/**
* public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
*/
}
61 changes: 61 additions & 0 deletions java/hdf/hdf5lib/structs/H5D_chunk_info_t.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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;

/**
* Bulk result of H5Dchunk_iter_all(), holding information about every chunk of a chunked dataset.
*
* To avoid one Java object allocation per chunk, the per-chunk fields are stored as parallel
* primitive arrays rather than an array of per-chunk objects; use {@link #getOffset(int, int)} to
* read a single chunk's offset coordinate.
*
*/
public class H5D_chunk_info_t implements Serializable {
private static final long serialVersionUID = -8091628506238589401L;

/** Number of dimensions (rank) of the dataset; used to interpret offset. */
public final int rank;
/** Flattened chunk offsets: chunk i's coordinate in dimension d is offset[i * rank + d]. */
public final long[] offset;
/** Bitmask indicating the filters used when each chunk was written; filterMask[i] for chunk i. */
public final int[] filterMask;
/** Chunk address in the file for each chunk; addr[i] for chunk i. */
public final long[] addr;
/** Chunk size in bytes for each chunk, 0 if the chunk does not exist; size[i] for chunk i. */
public final long[] size;

public H5D_chunk_info_t(int rank, long[] offset, int[] filterMask, long[] addr, long[] size)
{
this.rank = rank;
this.offset = offset;
this.filterMask = filterMask;
this.addr = addr;
this.size = size;
}

/**
* @return the number of chunks described by this object.
*/
public int getNumChunks() { return filterMask.length; }

/**
* @param chunkIndex
* index of the chunk, between 0 and getNumChunks() - 1.
* @param dim
* dimension, between 0 and rank - 1.
* @return the logical position of the given chunk's first element in dimension dim.
*/
public long getOffset(int chunkIndex, int dim) { return offset[chunkIndex * rank + dim]; }
}
3 changes: 3 additions & 0 deletions java/src-jni/hdf/hdf5lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ set (HDF5_JAVA_HDF_HDF5_CALLBACKS_SOURCES
callbacks/H5A_iterate_t.java
callbacks/H5D_append_cb.java
callbacks/H5D_append_t.java
callbacks/H5D_chunk_iter_cb.java
callbacks/H5D_chunk_iter_t.java
callbacks/H5D_iterate_cb.java
callbacks/H5D_iterate_t.java
callbacks/H5E_walk_cb.java
Expand Down Expand Up @@ -86,6 +88,7 @@ set (HDF5_JAVA_HDF_HDF5_STRUCTS_SOURCES
structs/H5_ih_info_t.java
structs/H5A_info_t.java
structs/H5AC_cache_config_t.java
structs/H5D_chunk_info_t.java
structs/H5E_error2_t.java
structs/H5F_info2_t.java
structs/H5FD_ros3_fapl_t.java
Expand Down
Loading
Loading