Skip to content

feat(java): add chunk and edge-range primitives - #968

Open
keksmd wants to merge 3 commits into
apache:mainfrom
keksmd:codex/java-core-ranges-upstream
Open

feat(java): add chunk and edge-range primitives#968
keksmd wants to merge 3 commits into
apache:mainfrom
keksmd:codex/java-core-ranges-upstream

Conversation

@keksmd

@keksmd keksmd commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Reason for this PR

Implements #967 (and relates to #947/#944): the complete dependency-light Java core contract for resolving an ordered GraphAr adjacency range.

What changes are included in this PR?

  • Adds graphar-core with long-safe chunk arithmetic and half-open edge/chunk range value types.
  • Validates ordered offset chunks, including monotonicity and terminal edge-count checks.
  • Resolves EdgeInfo ordered-by-source/destination metadata into the exact offset location, edge range, edge-count URI, and selected adjacency chunk URIs.
  • Verifies the canonical LDBC metadata layout and the cross-edge-chunk boundary [1008, 1061) at chunk size 1024.

This PR delegates URI construction to EdgeInfo; it deliberately does not read Parquet offsets or depend on storage/Parquet. That physical reader belongs after the open #961 IO API change.

Are these changes tested?

Yes.

GAR_TEST_DATA=/private/tmp/graphar-pr967/testing mvn --no-transfer-progress -f maven-projects/pom.xml -pl core -am clean verify -Dspotless.check.skip=true
mvn --no-transfer-progress -f maven-projects/pom.xml -pl core -am spotless:check

The reactor passes 8 core tests plus the graphar-info dependency suite. pre-commit run --files ... and git diff --check also pass.

Are there any user-facing changes?

Yes. Java consumers can now resolve ordered-adjacency metadata and validated offset ranges to exact GraphAr chunk URIs without introducing physical IO dependencies.

Checklist

  • I have self-reviewed this PR
  • I have run make cpplint (if this PR contains C++ changes)
  • I have run pre-commit
  • I have run the relevant tests

@keksmd

keksmd commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Hi @SemyonSinchenko — this is a deliberately small, independent Java core slice (419 lines, 6 focused tests) after #960/#962. It provides only the long-safe half-open chunk/range value layer; metadata URI resolution and IO stay out of this PR. I would appreciate your review when convenient.

@keksmd

keksmd commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Updated this PR into the complete ordered-adjacency core vertical (now 848 additions): validated offset chunks, metadata URI resolution, and the canonical LDBC cross-chunk fixture. It remains independent of #961 by keeping Parquet reads out of core.

@SemyonSinchenko
SemyonSinchenko self-requested a review August 24, 2026 14:38
@keksmd

keksmd commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

cc @SemyonSinchenko @SYaoJun — green CI, would appreciate a look when you have time.

@keksmd
keksmd force-pushed the codex/java-core-ranges-upstream branch from eb6f816 to a959411 Compare September 7, 2026 07:08
@keksmd

keksmd commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@SemyonSinchenko @SYaoJun could you take a look when you have a moment? This one is rebased on current main, conflicts are resolved and CI is green.

Note that the test job only builds -pl storage-api -am, so graphar-core is not exercised upstream yet. Locally the module is green: OrderedAdjacencyResolverFixtureTest 2/0/0 and ChunkRangeTest 6/0/0 from core/target/surefire-reports. The fixture test resolves the canonical data through GAR_TEST_DATA (then gar.test.data, then the usual relative fallbacks) and skips cleanly when the testing repository is absent, matching the convention in graphar-info.

I can follow up with a separate PR widening SDK_MODULES so the newer SDK modules are actually compiled and tested in CI, if that sounds right to you.

@keksmd

keksmd commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Update on the CI gap I mentioned above: the fix landed in #966 rather than as a separate PR, since @SYaoJun raised the same point there. The workflow now builds storage-api,storage-local,io-api,storage-s3.

core is deliberately not in that list yet — it only exists once this PR merges. I will add it here, or in a follow-up, whichever you prefer.

Provide the storage-free arithmetic layer needed by future ordered adjacency readers without coupling it to GraphAr metadata or physical IO.

Relates to apache#967.

Rejected: resolving metadata layouts or reading offsets in this value-only slice.
Complete the core-only ordered-adjacency contract: validate offset chunks, select exact half-open edge chunk ranges, and delegate URI resolution to immutable GraphAr metadata.

Relates to apache#967.

Rejected: reading Parquet offsets in graphar-core; io-parquet remains behind the open apache#961 API change.
The workflow's path filters already list maven-projects/core/**, so a change
under core triggers the job, but SDK_MODULES left the module out and the
reactor never compiled or tested it. A green run therefore proved nothing
about core.

Add core to the module list so the same job that guards storage and io-api
guards it too. The fixture-backed test skips itself when the canonical
testing dataset is absent, so the job stays green without the submodule.
@keksmd

keksmd commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on main after #966 merged — the only conflict was the module list in maven-projects/pom.xml, where storage-s3 and core were added at the same line; both are kept.

I also pushed the answer to the CI question I raised earlier, rather than leaving it open: the workflow already watches maven-projects/core/** in its path filters, so a change here triggers the job, but SDK_MODULES left core out and the reactor never compiled or tested it — a green run proved nothing about this module. SDK_MODULES is now storage-api,storage-local,io-api,storage-s3,core. The fixture-backed test skips itself when the canonical testing dataset is absent, so the job stays green without the submodule and gains real coverage when it is present.

Local verification against main with the fixtures available:

ChunkRangeTest                        Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
OrderedAdjacencyResolverFixtureTest   Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant