Merged
Conversation
…in quadtree spliterator
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds spliterator support and predicate/approximate querying to the spatial (quadtree) index, introduces multi-node edge iteration, and updates the SpatialIndex API. Also refactors internal quad tree storage from Set to array plus versioning and adjusts configuration defaults (larger capacities).
- Added Node & Edge spliterators (including filtered and approximate variants) and exposed readLock/readUnlock plus approximate query methods in SpatialIndex.
- Reworked quad tree node storage to fixed-size expandable arrays, added versioning and multi-node edge iterators; edge area queries now may return duplicates (tests updated).
- Increased several default storage and spatial index capacity constants.
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| SpatialIndexImplTest.java | Adjusts expectations for edge queries (now allowing duplicate edges) and adds clear test. |
| NodesQuadTreeTest.java | Extensive new tests for counts, iterator/spliterator behavior, predicates, approximate queries, edges, and performance scenarios. |
| GraphGenerator.java | Adds node generation within an optional Rect2D region. |
| EdgeStoreTest.java | Updates iterator calls with new locking flag; adds multi-node edge iterator tests. |
| UndirectedDecorator.java | Adapts to new edge iterator signature with locking flag. |
| SpatialNodeDataImpl.java | Adds array index tracking and clear() helper for quad tree storage. |
| SpatialIndexImpl.java | Refactors to delegate edge/node area queries directly to NodesQuadTree, adds approximate & predicate-aware methods, locking passthrough, object count accessor. |
| NodesQuadTree.java | Major refactor: array-based storage, versioning, predicates, approximate search, edge iteration & spliterators, global edge spliterator, counting APIs. |
| NodeStore.java | Updates edge iterator usage with new signature (locking flag). |
| GraphViewImpl.java | Uses spatial index predicate-based filtering; exposes approximate queries; delegates boundaries computation to spatial index. |
| GraphViewDecorator.java | Adapts view-level area queries to new spatial index methods and iterator signature; simplifies boundary retrieval. |
| GraphStoreConfiguration.java | Increases edge store and spatial index sizing constants; adds config flags for approximate search and iterator threshold. |
| GraphStore.java | Updates iterator calls with new edgeIterator signature. |
| EdgeStore.java | Introduces abstract & multi-node edge iterators; propagates spatial index version bumps; adds iterator/spliterator factory changes. |
| SpatialIndex.java | Expands API (approximate queries, locking methods) and updates documentation (edges may be duplicated). |
| Rect2D.java | Changes toString format and adds containsOrIntersects utility methods. |
Comments suppressed due to low confidence (1)
src/main/java/org/gephi/graph/api/SpatialIndex.java:1
- [nitpick] Exposing explicit readLock()/readUnlock() in the public SpatialIndex API leaks internal locking strategy and invites misuse (e.g., forgotten unlocks). Consider providing higher-level safe streaming helpers or auto-closeable scopes (e.g., try-with-resources) instead, or confine locking to iterator/spliterator implementations.
/*
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Remove distinct from spliterator as edges can be returned twice Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… into 242-spliterator-spatial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the ability to query the quadtree using (parallel) streams.