-
Notifications
You must be signed in to change notification settings - Fork 184
[v8r0] Implement a recursive listDirectory for the DFC #6682
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
[v8r0] Implement a recursive listDirectory for the DFC #6682
Conversation
f14ab2c to
8cc2b53
Compare
| if not res["Value"]: | ||
| if not (res["Value"]["Files"] or res["Value"]["SubDirs"]): | ||
| # folder is empty, just remove it and return | ||
| res = returnSingleResult(self.fileCatalog.removeDirectory(folder, recursive=True)) |
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.
I'm surprised that this has recursive=True?
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.
It's maybe not needed indeed, but I'd rather not change it here in the risk of breaking something, and I'd like this to be merged before Monday's release 👼
src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryClosure.py
Outdated
Show resolved
Hide resolved
src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py
Outdated
Show resolved
Hide resolved
src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py
Outdated
Show resolved
Hide resolved
src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py
Outdated
Show resolved
Hide resolved
… use getDirectoryDump; remove __getCatalogDirectoryContents
8cc2b53 to
82043b7
Compare
|
Sweep summary Sweep ran in https://github.com/DIRACGrid/DIRAC/actions/runs/3961922796 Successful:
|
closes #3911
I'd have hoped for a simple flag in the
listDirectorymethod, but it unfortunately can't be done (too much modification of too many methods that are used by too many components).So I created a new
getDirectoryDumpmethod. For a given directory, it returns all the files and sub folders contained at any depth.For now I've applied it only to the
dirac-dms-user-lfncommands. In the case of the LHCb managers, the speedup is substantial.For example, on the test instance, I can dump 250k files and 100k sub directories in less than 10 seconds. The original command never returned....
BEGINRELEASENOTES
*DMS
NEW: Introduce getDirectoryDump method in the DFC
CHANGE: dirac-dms-user-lfns uses getDirectoryDump method
CHANGE: DataManager getReplicasFromDirectory and __cleanDirectory use getDirectoryDump
ENDRELEASENOTES