Skip to content
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

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

chaen
Copy link
Contributor

@chaen chaen commented Jan 12, 2023

closes #3911

I'd have hoped for a simple flag in the listDirectory method, 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 getDirectoryDump method. 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-lfn commands. 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....

time dirac-dms-user-lfns -b /lhcb/user/c/cburr/
Will search for files in /lhcb/user/c/cburr
/lhcb/user/c/cburr: 251681 files, 98570 sub-directories
251681 matched files have been put in lhcb-user-c-cburr.lfns

real    0m9.893s
user    0m4.280s
sys     0m0.248s

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

@DIRACGridBot DIRACGridBot added the alsoTargeting:integration Cherry pick this PR to integration after merge label Jan 12, 2023
@chaen chaen force-pushed the rel-v8r0_FEAT_recursiveListDir branch 5 times, most recently from f14ab2c to 8cc2b53 Compare January 18, 2023 14:32
@chaen chaen marked this pull request as ready for review January 18, 2023 16:02
if not res["OK"]:
return res

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))
Copy link
Member

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?

Copy link
Contributor Author

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 👼

@chaen chaen force-pushed the rel-v8r0_FEAT_recursiveListDir branch from 8cc2b53 to 82043b7 Compare January 19, 2023 18:19
@chrisburr chrisburr merged commit 7574afe into DIRACGrid:rel-v8r0 Jan 19, 2023
@DIRACGridBot DIRACGridBot added the sweep:done All sweeping actions have been done for this PR label Jan 19, 2023
DIRACGridBot pushed a commit to DIRACGridBot/DIRAC that referenced this pull request Jan 19, 2023
@DIRACGridBot
Copy link

Sweep summary

Sweep ran in https://github.com/DIRACGrid/DIRAC/actions/runs/3961922796

Successful:

  • integration

simon-mazenoux pushed a commit to simon-mazenoux/DIRAC that referenced this pull request May 24, 2023
simon-mazenoux pushed a commit to simon-mazenoux/DIRAC that referenced this pull request May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alsoTargeting:integration Cherry pick this PR to integration after merge sweep:done All sweeping actions have been done for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants