apache / apache/incubator-graphar
[FEATURE][Java] Add chunk and edge-range value primitives
- Dominant language
- C++
- Stars
- 373
- Forks
- 93
- Avg merge
- 7d 21h
- Merged PRs (30d)
- 7
Description
### Describe the enhancement requested
Add the small, storage-free value primitives needed to translate GraphAr ordered-adjacency offsets into exact half-open edge-chunk ranges. This is the first core slice of the pure-Java ordered adjacency reader; metadata URI resolution and physical reading follow separately.
Component(s): Java
## Scope
- Add `graphar-core` with long-safe chunk-index, in-chunk offset, and chunk-count arithmetic.
- Add validated half-open `ChunkRange` and `EdgeRange` values, including correct end-exclusive edge-chunk selection.
- Add unit tests for empty ranges, chunk boundaries, and invalid IDs/sizes/offsets.
## Non-goals
No storage, Parquet, S3, Arrow, metadata URI resolution, GraphAr reader facade, offsets file decoder, or adjacency data read.
## Compatibility and acceptance
The API remains Java 11 compatible and depends on no physical IO module. It must reject negative IDs and non-positive chunk sizes. A range `[begin,end)` selects no chunks when empty; nonempty ranges include the chunk containing `end - 1`, not an extra chunk at `end`. Focused Maven verification and pre-commit must pass.
## Links
Relates to #947, #944, and architecture umbrella #756. The follow-up metadata resolver will use `EdgeInfo` URI methods rather than reconstruct GraphAr paths.
Contributor guide
Research direction
Start in the new graphar-core module and review the requested chunk-index, in-chunk offset, chunk-count, ChunkRange, and EdgeRange primitives. Add the unit tests described for empty ranges, chunk boundaries, and invalid IDs, sizes, and offsets, then run focused Maven verification and pre-commit; done means Java 11 compatibility and all stated range validations pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100