Commit 432707d
authored
ArcadeData#2915 fix: ensure Jvector HNSW graph file is closed and flushed to disk on database close (ArcadeData#2916)
* ArcadeData#2915 fix: ensure Jvector HNSW graph file is closed and flushed to disk on database close
* fix: address PR ArcadeData#2916 review comments for HNSW graph persistence
Improvements to code quality and maintainability:
* Enhanced exception logging: Include full stack trace when closing graph file
for better debugging. Changed from logging only the error message to passing
the exception object to LogManager for complete context.
* Refactored deleteDirectory() helper: Replaced manual recursive directory
traversal with modern java.nio.file.Files.walk() API. This approach is more
robust, efficient, and follows Java best practices for file tree operations.
- Uses try-with-resources for proper resource management
- Sorts in reverse order to delete files before directories
- Provides better exception handling with IOException
All existing tests continue to pass (22/22).
Addresses review comments from PR ArcadeData#2916:
- ArcadeData#2916 (comment)
- ArcadeData#2916 (comment)
* ArcadeData#2915 fix: ensure Jvector HNSW graph file is closed and flushed to disk on database close1 parent 4cd8881 commit 432707d
2 files changed
Lines changed: 406 additions & 1 deletion
File tree
- engine/src
- main/java/com/arcadedb/index/vector
- test/java/com/arcadedb/index/vector
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
494 | 497 | | |
495 | 498 | | |
496 | | - | |
| 499 | + | |
497 | 500 | | |
498 | 501 | | |
499 | 502 | | |
| |||
513 | 516 | | |
514 | 517 | | |
515 | 518 | | |
| 519 | + | |
| 520 | + | |
516 | 521 | | |
517 | 522 | | |
518 | 523 | | |
| |||
2129 | 2134 | | |
2130 | 2135 | | |
2131 | 2136 | | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
2132 | 2147 | | |
2133 | 2148 | | |
2134 | 2149 | | |
| |||
0 commit comments