-
Notifications
You must be signed in to change notification settings - Fork 4
Introduction of StorageManager class #197
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
base: master
Are you sure you want to change the base?
Conversation
98bb3b1 to
d07097c
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #197 +/- ##
==========================================
- Coverage 56.34% 56.06% -0.29%
==========================================
Files 71 70 -1
Lines 3429 3439 +10
Branches 2126 2132 +6
==========================================
- Hits 1932 1928 -4
- Misses 578 1232 +654
+ Partials 919 279 -640 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
64ac63c to
2bdbaa7
Compare
This commit refactores the CAPIO server logic that handles the storage of files. It introduces the StorageService class and moves all the logic within that class.
337b2d8 to
de1ccc4
Compare
53f7e00 to
e4257b1
Compare
| * @return `0` if the directory was added/updated, `1` if it already exists and no action was | ||
| * taken. | ||
| */ | ||
| off64_t addDirectory(pid_t tid, const std::filesystem::path &path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why there is a generic add function and a specialized addDirectory function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When adding directories, extra steps need to be done compared to simply adding a file. The generic add is used to add a new entry in the storage manager, and when calling the addDirectory, extra steps are performed, which are not usually performed when adding a file.
Moreover, changing to have a single add method, would require to refactor not only method calls naming within the capio_server, but also the logic of the various handlers around capio.
Co-authored-by: Iacopo Colonnelli <iacopo.c92@gmail.com>
This pull request refactors the CAPIO server logic responsible for handling the storage of files by introducing a dedicated
StorageManagerclass. This centralizes all file storage management into a single, modular unit.Key Changes:
StorageManager: All CAPIO server logic related to files and directories storage has been moved into the newStorageManagerclass.getandtryGetmethods for accessing stored items, including an overload that uses a thread ID (tid) and file descriptor (fd) pair. Class methods have also been renamed to better reflect the naming scheme used in CAPIO classes.ERR_EXITinstead of exceptions (throws), ensuring consistency with CAPIO's standard error reporting conventions.