Skip to content

refactor(storage): unify canonical in-memory storage and fix query timeout handling - #629

Merged
abdessamad-abdoun merged 4 commits into
feature/corese-nextfrom
feature/indexed-memory-storage
Oct 15, 2026
Merged

abdessamad-abdoun merged 4 commits into
feature/corese-nextfrom
feature/indexed-memory-storage

Conversation

@remiceres

Copy link
Copy Markdown
Contributor

Important: Please review and merge this PR before the corese-w3c PR (feature/w3c-memory-storage).

Summary

This PR unifies in-memory RDF storage on the canonical indexed MemoryStorageManager implementation, removes obsolete duplicate storage classes, fixes caller-thread timeout management in the SPARQL query pipeline, and applies minor AST parser cleanups.

Key Changes

  • Canonical Storage: Consolidates memory storage on corese.core.next.storage.impl.memory.MemoryStorageManager and deletes legacy impl.indexedmemory classes.
  • Query Timeout Watchdog: Runs timeout-bounded queries on the caller thread with an atomic watchdog CAS check to preserve thread-bound transactions (connection.begin()).
  • AST Cleanup: Simplifies property path expansion conditions in SparqlAstBuilder and clarifies options handling in SparqlTermBuilder.
  • Validation: 3,155 unit tests pass, 0 SonarLint issues on touched Java files, memory profile unchanged (90,827,088 bytes).

Related Issues

… legacy backends

- Consolidate on single high-performance MemoryStorageManager (SPO/POS/OSP, DenseTermTable, CompactTermMap)
- Delete legacy GraphStorageManager (impl/graph) and naive InMemoryStatementStore (-4500 lines)
- Adapt query engine producer and solution mapping structures for lazy streaming
- Update build configuration, storage plugin guide and test suite
…ith atomic watchdog

- Execute evaluateCore on caller thread to preserve transaction thread affinity
- Implement single AtomicInteger transition in request-scoped virtual watchdog
- Avoid interruption leakage by joining watchdog and restoring initial interrupt status
- Add unit tests for timeout queries within active transactions in PreparedQueryReuseTest
…rify term builder options

- Simplify addTriplesFromPropertyListPath by evaluating useVerbPath once
- Clarify SparqlTermBuilder javadoc for options parameter
- Refine SparqlQueryAnalyzer and ensure triple order preservation
…tion report

- Update find() description to reflect lazy stream semantics without intermediate allocation
- Add memory-storage-final-validation.md recording validation protocol and results
@remiceres remiceres added feature New feature or capability refactoring Internal code restructuring and architecture cleanup labels Oct 14, 2026
@remiceres remiceres self-assigned this Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Overall Project 56.5% -0.12% 🍏
Files changed 94.55% 🍏

File Coverage
SimpleIRI.java 100% 🍏
StagingTerms.java 100% 🍏
DenseTermTable.java 98.04% -1.96% 🍏
TripleIndex.java 97.58% -2.42% 🍏
NextSparqlPipelineExecutor.java 96.77% -0.54% 🍏
IndexedStatementStore.java 95.07% -4.93% 🍏
TermKey.java 95.02% -4.98% 🍏
SparqlQueryAnalyzer.java 94.97% 🍏
MemoryStorageManager.java 94.32% -5.68% 🍏
CompactTermMap.java 93.1% -6.9% 🍏
RDFXMLSerializer.java 90.59% 🍏
MemoryStoragePlugin.java 88.57% -11.43% 🍏
StorageManagerProducer.java 87.54% -4.67% 🍏
SparqlAstBuilder.java 87.23% 🍏
RDFC10Canonicalizer.java 83.76% 🍏
SparqlTermBuilder.java 83.55% -0.18% 🍏
CoreseRepositoryConnection.java 82.69% 🍏
MappingSet.java 71.95% 🍏
AbstractGraphSerializer.java 62.98% 🍏
CoreseTupleQuery.java 62% -38% ❌
CoreseGraphQuery.java 62% -38% ❌
CoreseBooleanQuery.java 61.54% -38.46% ❌
Eval.java 55.02% -1.29% 🍏
Producer.java 16.67% -50% ❌
Visit.java 0% -2.66% ❌

@github-actions

Copy link
Copy Markdown

Test Results

  412 files    412 suites   24s ⏱️
3 128 tests 3 128 ✅ 0 💤 0 ❌
3 155 runs  3 155 ✅ 0 💤 0 ❌

Results for commit 51b00fe.

@abdessamad-abdoun
abdessamad-abdoun merged commit e8b76ea into feature/corese-next Oct 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or capability refactoring Internal code restructuring and architecture cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants