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

Support mutable locations #295

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Support mutable locations #295

merged 1 commit into from
Jan 29, 2025

Conversation

Saloed
Copy link
Collaborator

@Saloed Saloed commented Jan 29, 2025

[jacodb-core] Minor: reduce number of downloads

Two versions of the Keap lib are downloaded twice, not three times.

[jacodb-core] Make code model with ERS backend mutable incremental

As of this commit, ErsPersistenceImpl has got the following additional features:

  • For any location and class name, there can exist several entities.
  • Amongst those entities, only one is active (current), other are logically deleted, i.e. marked with "isDeleted" property.
  • Any location identified by its id can be forced to be re-indexed. Only changed classes are getting the new version during re-indexing.
  • For binding Persistence layer with the layer of JcDatabase, a new ClassSource implementation introduced. For getting class' byte code, this implementation checks if class id which it holds is up-to-date.
  • Code model re-indexes changed locations after JcDatabase.refresh() is invoked.

TODO. PersistentLocationsRegistry looks overcomplicated. JcLocation implementations look as hacks in order to get JcLocation.isChanged() working, and in order to reindex mutated locations in-place without adding/removing them. So this part looks as a good candidate for complete rewriting.

[jacodb-core] Ensure that jar file is closed

Two resource leaks fixed: a jar file wasn't closed after

  • its hash was computed;
  • its classes were indexed.

[jacodb-core] Minor: reduce number of downloads

Two versions of the Keap lib are downloaded twice, not three times.

[jacodb-core] Make code model with ERS backend mutable incremental

As of this commit, ErsPersistenceImpl has got the following additional features:
- For any location and class name, there can exist several entities.
- Amongst those entities, only one is active (current), other are logically
deleted, i.e. marked with "isDeleted" property.
- Any location identified by its id can be forced to be re-indexed. Only changed
classes are getting the new version during re-indexing.
- For binding Persistence layer with the layer of JcDatabase, a new ClassSource
implementation introduced. For getting class' byte code, this implementation
checks if class id which it holds is up-to-date.
- Code model re-indexes changed locations after JcDatabase.refresh() is invoked.

TODO. PersistentLocationsRegistry looks overcomplicated. JcLocation implementations
look as hacks in order to get JcLocation.isChanged() working, and in order to
reindex mutated locations in-place without adding/removing them. So this part
looks as a good candidate for complete rewriting.

[jacodb-core] Ensure that jar file is closed

Two resource leaks fixed: a jar file wasn't closed after
- its hash was computed;
- its classes were indexed.
Copy link
Contributor

Lifecycle test results

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

Results for commit 661d35e. ± Comparison against base commit ddbea5d.

Copy link
Contributor

Test results on JDK 19

 70 files  +1   70 suites  +1   4m 38s ⏱️ -4s
624 tests +1  614 ✅ +1  10 💤 ±0  0 ❌ ±0 
694 runs  +1  684 ✅ +1  10 💤 ±0  0 ❌ ±0 

Results for commit 661d35e. ± Comparison against base commit ddbea5d.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 85.46512% with 25 lines in your changes missing coverage. Please review.

Project coverage is 71.67%. Comparing base (ddbea5d) to head (661d35e).
Report is 1 commits behind head on neo.

Files with missing lines Patch % Lines
.../main/kotlin/org/jacodb/impl/storage/ers/ErsExt.kt 82.69% 3 Missing and 6 partials ⚠️
.../org/jacodb/impl/storage/ers/ErsPersistenceImpl.kt 87.75% 0 Missing and 6 partials ⚠️
.../jacodb/impl/storage/PersistentByteCodeLocation.kt 69.23% 2 Missing and 2 partials ⚠️
...jacodb/impl/storage/PersistentLocationsRegistry.kt 72.72% 1 Missing and 2 partials ⚠️
...c/main/kotlin/org/jacodb/impl/features/Builders.kt 84.61% 1 Missing and 1 partial ⚠️
...lin/org/jacodb/impl/features/HierarchyExtension.kt 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                neo     #295      +/-   ##
============================================
+ Coverage     71.31%   71.67%   +0.36%     
- Complexity     2430     2446      +16     
============================================
  Files           254      254              
  Lines         14385    14457      +72     
  Branches       2106     2121      +15     
============================================
+ Hits          10258    10362     +104     
+ Misses         3257     3212      -45     
- Partials        870      883      +13     

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

Copy link
Contributor

Test results on JDK 11

 70 files  +1   70 suites  +1   5m 13s ⏱️ -1s
624 tests +1  616 ✅ +1  8 💤 ±0  0 ❌ ±0 
694 runs  +1  686 ✅ +1  8 💤 ±0  0 ❌ ±0 

Results for commit 661d35e. ± Comparison against base commit ddbea5d.

Copy link
Contributor

Test results on JDK 8

 70 files  +1   70 suites  +1   4m 52s ⏱️ +12s
624 tests +1  611 ✅ +1  13 💤 ±0  0 ❌ ±0 
694 runs  +1  681 ✅ +1  13 💤 ±0  0 ❌ ±0 

Results for commit 661d35e. ± Comparison against base commit ddbea5d.

@Saloed Saloed merged commit ea3c7c0 into neo Jan 29, 2025
11 checks passed
@Saloed Saloed deleted the saloed/mutable-locations branch January 29, 2025 15:56
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