Commit Graph

19 Commits

Author SHA1 Message Date
extio-de
8e7761d4b6 check-data-integrity v2 2025-06-20 18:48:29 +02:00
extio-de
2167863a03 Reset repo 2025-06-20 18:47:36 +02:00
(no author)
d3134c05a5 Fix: Ensure blocking queues are local & cancel futures on early exit
The original code used class-level `BlockingQueue` instances (`queue0`, `queue1`) which caused issues when processing multiple files concurrently. Each comparison needed its *own* dedicated queues to avoid data corruption and incorrect comparisons between different file pairs. This commit creates the `BlockingQueue` instances locally within the file comparison loop.

Additionally, the futures submitted to the executor service were not always being cancelled if an exception occurred or the comparison finished before reaching the end of the files.  This could lead to lingering threads. The `finally` block now ensures that both futures are cancelled regardless of how the try block exits, preventing resource leaks and potential deadlocks.


git-svn-id: svn://home0/checkDataIntegrity@3745 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2025-06-20 11:49:38 +00:00
(no author)
2a1ff2b30a Introduce virtual threads and blocking queues for concurrent file comparison
This commit introduces a significant refactoring of the `Task` class to improve performance and resource utilization when comparing files.  Instead of reading directly within the main thread, it now leverages Java's virtual threads and blocking queues to handle file loading concurrently.

Key changes:

- **Virtual Threads:** Uses `ExecutorService` with `newVirtualThreadPerTaskExecutor()` to create lightweight virtual threads for reading from each file. This allows for highly concurrent I/O operations without excessive overhead.
- **Blocking Queues:** Employs `LinkedBlockingQueue` to facilitate communication between the file loading threads and the comparison logic. Each queue holds buffers read from its corresponding file.
- **Buffer Pool:** Continues utilizing the `BufferPool` for managing byte arrays to minimize memory allocation.
- **Loader Method:** A new private method `loader` is introduced to encapsulate the file reading process within each virtual thread, placing read data into the respective queue.
- **Error Handling:** Improved exception handling to properly cancel tasks and propagate exceptions. Interruptions are handled correctly.

These changes should result in significantly improved throughput when comparing large files, especially on systems with multiple cores.


git-svn-id: svn://home0/checkDataIntegrity@3744 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2025-06-20 10:21:22 +00:00
(no author)
93a166ea8a checkDataIntegrity - borg mount optimizations;
git-svn-id: svn://home0/checkDataIntegrity@3518 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2024-03-11 19:41:13 +00:00
(no author)
3782568df6 checkDataIntegrity - major improved version;
git-svn-id: svn://home0/checkDataIntegrity@3514 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2024-03-10 17:38:04 +00:00
(no author)
0de4e61ccd git-svn-id: svn://home0/checkDataIntegrity@3512 71dcc7fd-b1f2-4e5d-bb8e-274146e81173 2024-03-03 12:10:25 +00:00
(no author)
99d9a8e412 checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@3075 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-31 19:22:38 +00:00
(no author)
2490594a27 checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@3074 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-31 19:17:28 +00:00
(no author)
0cee423a0d checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@3073 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-31 19:13:08 +00:00
(no author)
4783acc880 checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@3069 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-29 13:26:03 +00:00
(no author)
0c00ace2ac exonas;
git-svn-id: svn://home0/checkDataIntegrity@3063 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-24 18:44:06 +00:00
(no author)
5214171320 exonas scrubber checkpoint approach;
git-svn-id: svn://home0/checkDataIntegrity@3061 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-23 20:13:24 +00:00
(no author)
0b2bd8a437 scrubber;
git-svn-id: svn://home0/checkDataIntegrity@3060 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-23 19:47:52 +00:00
(no author)
4dbfbde6f5 checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@3054 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2023-05-21 13:48:58 +00:00
(no author)
c4fd4cf235 git-svn-id: svn://home0/checkDataIntegrity@3053 71dcc7fd-b1f2-4e5d-bb8e-274146e81173 2023-05-19 19:44:56 +00:00
(no author)
6eaeb0ae0c git-svn-id: svn://home0/checkDataIntegrity@2429 71dcc7fd-b1f2-4e5d-bb8e-274146e81173 2022-02-20 14:10:29 +00:00
(no author)
79037a714a checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@2418 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2022-01-30 19:13:47 +00:00
(no author)
7c60b17f37 checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@2416 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
2022-01-30 14:16:24 +00:00