Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract jacodb-storage module #271

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Extract jacodb-storage module #271

merged 1 commit into from
Oct 18, 2024

Conversation

Saloed
Copy link
Collaborator

@Saloed Saloed commented Oct 18, 2024

[jacodb-storage] Extract jacodb-api-storage module

The jacodb-api-storage module depends on jacodb-api-common. The jacodb-api-jvm module depends on jacodb-api-common & jacodb-api-storage.

[jacodb-storage] Fix review points: remove EntityRelationshipStorage.asReadWrite

[jacodb-storage] Fix review points: setImmutable() waits for background jobs

[jacodb-storage] Minor: remove some comments

[jacodb-storage] Minor: rename

[jacodb-api, jacodb-core] Add ability to set persistence and database to immutable state

Got rid of the JcDatabase.classpathOf() method.

[jacodb-storage] Add navigation over AttributesImmutable

In implementation of AttributesImmutable, AttributesCursor added for navigation in attribute values. It is used in PropertiesImmutable for searching by property value and for searching in a range of values. AttributesCursorEntityIterable added as a lazy implementation of EntityIterable atop of AttributesCursor.

More test cases added.

[jacodb-storage] Generate and add SparseBitSetTest

[jacodb-core] Extract ERS API implementations to module jacodb-storage

All EntityRelationshipStorage implementations, except SqlEntityRelationshipStorageSPI, moved to the jacodb-storage module. Extra minor refactoring are done in order to de-couple dependencies.

[jacodb-core] Get rid of unnecessary extra check if instanceIds are sorted

[jacodb-core] Add first version of RAMDataContainerImmutable

RAMDataContainerImmutable is intended as a data container for RAMEntityRelationshipStorage saving data in a compact format with high data locality using large arrays.

Auxiliary refactorings:

  • EntityIdSet is obsolete;
  • EntityIdCollectionEntityIterable is obsolete, as it is replaced with InstanceIdCollectionEntityIterable everywhere;
  • SparseBitSet added for compact bitsets;
  • ByteArray.asComparable() added;
  • ERS API: Transaction.getEntityUnsafe(id) added.

TODO: provide PropertiesImmutable with property value indices and use then in find*() methods. Currently, find*() methods use brute force search.

[build] Add facilities to deal with read-only state of storages

For EntityRelationshipStorage, added ability to get read-only & read/write snapshots of the storage. By default, they do nothing.

In PluggableKeyValueStorage, added property allowing to switch to read-only mode and back to read/write mode. It has non-trivial implementation only in XodusKeyValueStorage.

[build] For tests, set JVM target to that the build is being run under

This change allows to run tests against examples compiled for different JVM targets whereas main artifacts are still being compiled for Java 1.8. Both Java and Kotlin configured. We have to compile test fixtures for 1.8 as well since Gradle considers them as dependencies of main artifacts.

[jacodb-core] Update Kotlin to version 2.0.20

As of this commit, Kotlin metadata version is equal to Kotlin version. Refactored Kotlin metadata classes' usages as they live in the new package.

Fixed nullability issues with Kotlin class types appeared due to lack of corresponding JB annotations since Kotlin 2.0.0. Extension functions declared in the Nullables.kt moved from the jacodb-api-jvm module to the jacodb-core one.

[jacodb-core] Fix running benchmarks with ERS persistence using pluggable K/V storages

[jacodb-core] Process Class-Path attribute of jar manifest

As of this commit, classpath is not only set of jar files and build directories, but also a set of references to jar files calculated using "Class-Path" attribute in manifest of any jar file.

[jacodb-storage] Extract jacodb-api-storage module

The jacodb-api-storage module depends on jacodb-api-common.
The jacodb-api-jvm module depends on jacodb-api-common & jacodb-api-storage.

[jacodb-storage] Fix review points: remove EntityRelationshipStorage.asReadWrite

[jacodb-storage] Fix review points: setImmutable() waits for background jobs

[jacodb-storage] Minor: remove some comments

[jacodb-storage] Minor: rename

[jacodb-api, jacodb-core] Add ability to set persistence and database to immutable state

Got rid of the JcDatabase.classpathOf() method.

[jacodb-storage] Add navigation over AttributesImmutable

In implementation of AttributesImmutable, AttributesCursor added for navigation
in attribute values. It is used in PropertiesImmutable for searching by property
value and for searching in a range of values. AttributesCursorEntityIterable added
as a lazy implementation of EntityIterable atop of AttributesCursor.

More test cases added.

[jacodb-storage] Generate and add SparseBitSetTest

[jacodb-core] Extract ERS API implementations to module jacodb-storage

All EntityRelationshipStorage implementations, except SqlEntityRelationshipStorageSPI,
moved to the jacodb-storage module. Extra minor refactoring are done in order to
de-couple dependencies.

[jacodb-core] Get rid of unnecessary extra check if instanceIds are sorted

[jacodb-core] Add first version of RAMDataContainerImmutable

RAMDataContainerImmutable is intended as a data container for RAMEntityRelationshipStorage
saving data in a compact format with high data locality using large arrays.

Auxiliary refactorings:
- EntityIdSet is obsolete;
- EntityIdCollectionEntityIterable is obsolete,
  as it is replaced with InstanceIdCollectionEntityIterable everywhere;
- SparseBitSet added for compact bitsets;
- ByteArray.asComparable() added;
- ERS API: Transaction.getEntityUnsafe(id) added.

TODO: provide PropertiesImmutable with property value indices and use then in
find*() methods. Currently, find*() methods use brute force search.

[build] Add facilities to deal with read-only state of storages

For EntityRelationshipStorage, added ability to get read-only & read/write
snapshots of the storage. By default, they do nothing.

In PluggableKeyValueStorage, added property allowing to switch to read-only
mode and back to read/write mode. It has non-trivial implementation only in
XodusKeyValueStorage.

[build] For tests, set JVM target to that the build is being run under

This change allows to run tests against examples compiled for different JVM
targets whereas main artifacts are still being compiled for Java 1.8.
Both Java and Kotlin configured. We have to compile test fixtures for 1.8
as well since Gradle considers them as dependencies of main artifacts.

[jacodb-core] Update Kotlin to version 2.0.20

As of this commit, Kotlin metadata version is equal to Kotlin version.
Refactored Kotlin metadata classes' usages as they live in the new package.

Fixed nullability issues with Kotlin class types appeared due to lack
of corresponding JB annotations since Kotlin 2.0.0. Extension functions
declared in the Nullables.kt moved from the jacodb-api-jvm module to
the jacodb-core one.

[jacodb-core] Fix running benchmarks with ERS persistence using pluggable K/V storages

[jacodb-core] Process Class-Path attribute of jar manifest

As of this commit, classpath is not only set of jar files and build directories,
but also a set of references to jar files calculated using "Class-Path" attribute
in manifest of any jar file.
Copy link
Contributor

Lifecycle test results

78 tests  ±0   78 ✅ ±0   1m 51s ⏱️ -6s
 7 suites ±0    0 💤 ±0 
 7 files   ±0    0 ❌ ±0 

Results for commit ddd8bc8. ± Comparison against base commit 82a70aa.

Copy link
Contributor

Test results on JDK 19

   88 files  + 3     88 suites  +3   14m 48s ⏱️ +13s
2 529 tests +12  2 488 ✅ +12  41 💤 ±0  0 ❌ ±0 
2 557 runs  +12  2 516 ✅ +12  41 💤 ±0  0 ❌ ±0 

Results for commit ddd8bc8. ± Comparison against base commit 82a70aa.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 69.73684% with 161 lines in your changes missing coverage. Please review.

Project coverage is 59.32%. Comparing base (82a70aa) to head (ddd8bc8).
Report is 1 commits behind head on neo.

Files with missing lines Patch % Lines
...pl/storage/ers/ram/XodusPersistentCollectionsEx.kt 3.92% 49 Missing ⚠️
.../impl/storage/ers/ram/RAMDataContainerImmutable.kt 51.85% 15 Missing and 11 partials ⚠️
...jacodb/impl/storage/ers/ram/AttributesImmutable.kt 80.95% 11 Missing and 9 partials ⚠️
...in/kotlin/org/jacodb/impl/storage/ers/ram/Links.kt 84.14% 5 Missing and 8 partials ⚠️
...db/impl/storage/ers/ram/RAMDataContainerMutable.kt 79.03% 8 Missing and 5 partials ⚠️
...tlin/org/jacodb/impl/storage/ers/ram/Properties.kt 84.90% 2 Missing and 6 partials ⚠️
...ain/kotlin/org/jacodb/impl/fs/ByteCodeLocations.kt 50.00% 4 Missing and 3 partials ⚠️
...n/kotlin/org/jacodb/impl/types/JcTypedFieldImpl.kt 66.66% 2 Missing and 2 partials ⚠️
.../org/jacodb/impl/storage/ers/ErsPersistenceImpl.kt 25.00% 2 Missing and 1 partial ⚠️
.../storage/ers/ram/TransactionalPersistentLongMap.kt 50.00% 2 Missing and 1 partial ⚠️
... and 13 more
Additional details and impacted files
@@             Coverage Diff              @@
##                neo     #271      +/-   ##
============================================
+ Coverage     58.80%   59.32%   +0.51%     
- Complexity     2296     2602     +306     
============================================
  Files           315      319       +4     
  Lines         18656    19067     +411     
  Branches       3006     2823     -183     
============================================
+ Hits          10971    11311     +340     
- Misses         6582     6669      +87     
+ Partials       1103     1087      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Test results on JDK 11

   88 files  + 3     88 suites  +3   15m 45s ⏱️ -44s
2 529 tests +12  2 490 ✅ +12  39 💤 ±0  0 ❌ ±0 
2 557 runs  +12  2 518 ✅ +12  39 💤 ±0  0 ❌ ±0 

Results for commit ddd8bc8. ± Comparison against base commit 82a70aa.

Copy link
Contributor

Test results on JDK 8

   88 files  + 3     88 suites  +3   19m 22s ⏱️ - 1m 16s
2 529 tests +12  2 485 ✅ +12  44 💤 ±0  0 ❌ ±0 
2 557 runs  +12  2 513 ✅ +12  44 💤 ±0  0 ❌ ±0 

Results for commit ddd8bc8. ± Comparison against base commit 82a70aa.

@Saloed Saloed merged commit 1a88199 into neo Oct 18, 2024
11 checks passed
@Saloed Saloed deleted the saloed/jacodb-storage branch October 18, 2024 12:17
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