Skip to content

Specify non-random location for filesystem's temporary cache #266

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

Merged
merged 5 commits into from
Sep 19, 2023

Conversation

oandreeva-nv
Copy link
Contributor

Main ask for DLIS-5340

Previous PR: #254 needs some debugging.

This PR will only read env variable directory (if specified) and create temporary folder there.

@oandreeva-nv oandreeva-nv requested review from kthui, rmccorm4 and GuanLuo and removed request for kthui, rmccorm4 and GuanLuo September 18, 2023 19:36
@oandreeva-nv oandreeva-nv force-pushed the oandreeva_specify_location_filesystem branch from 23498bc to af3f71f Compare September 18, 2023 19:45
/// \param temp_dir Returns the path to the temporary directory.
/// \return Error status
Status MakeTemporaryDirectory(
const FileSystemType type, std::string dir_path, std::string* temp_dir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small thing, I think the dir_path can be declared as const std::string& dir_path here, and leave the LocalFileSystem::MakeTemporaryDirectory(std::string dir_path, ...) as it is. Then, we can save a copy of dir_path when passing the variable from the caller to MakeTemporaryDirectory() here, and only copy it once when passing dir_path from here to LocalFileSystem::MakeTemporaryDirectory().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make sure to check and introduce this in a follow-up pr with the bug fix. Thanks for suggestion!

/// \param temp_dir Returns the path to the temporary directory.
/// \return Error status
Status MakeTemporaryDirectory(
const FileSystemType type, std::string dir_path, std::string* temp_dir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const FileSystemType type, std::string dir_path, std::string* temp_dir);
const FileSystemType type, const std::string& dir_path, std::string* temp_dir);


Status
MakeTemporaryDirectory(
const FileSystemType type, std::string dir_path, std::string* temp_dir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const FileSystemType type, std::string dir_path, std::string* temp_dir)
const FileSystemType type, const std::string& dir_path, std::string* temp_dir)

@oandreeva-nv oandreeva-nv merged commit 43ca410 into main Sep 19, 2023
mc-nv pushed a commit that referenced this pull request Sep 19, 2023
* Add ability to specify directory for cloud storage
mc-nv pushed a commit that referenced this pull request Sep 19, 2023
* Add ability to specify directory for cloud storage
@oandreeva-nv oandreeva-nv deleted the oandreeva_specify_location_filesystem branch December 19, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants