Repository navigation
Conversation
42aa343 to
a7275fe
Compare
|
|
||
| types_getFileUserMetadataBulk = [[list, dict, str]] | ||
|
|
||
| def export_getFileUserMetadataBulk(self, lfns): |
There was a problem hiding this comment.
What is the difference between this function and getFileDetails (which is bulk already, I think?) Is getFileDetails missing the directory metadata?
There was a problem hiding this comment.
@andresailer I had never realized the existance of this method which returns user defined metadata as its name was not very informative.
If such a bulk method already exists then it's redundant with the proposed method and also with the existing non bulk one getFileUserMetadata.
For your information it does not seem to work though, as its decorator expects a return value with the {"Successful": successful, "Failed": failed} structure.
Then, I see that it returns not only user defined metadata but also the low-level metadata, such guid and so on.
So, in order to have a common FileCatalog interface for DIRAC and Rucio I think it would be good to have these 2 methods that just return user defined metadata :
getFileUserMetadata
getFileUserMetadataBulk
In order to not write redundant code, the getFileUserMetadataBulk method could call fileCatalogDB.getFileDetailsPublic, as in the method you pointed, but returning only user defined metadata with the expected return dict format.
@fstagni @andresailer what do you think?
There was a problem hiding this comment.
Yes, one function calling the other would be sensible to unify interfaces.
There was a problem hiding this comment.
Looking at it in more detail there is actually a difference between the 2 methods.
getFileDetails returns only metadata associated to files and not those of their parent directories.
However we could still reuse the bulk method used to get file metadata that is used in getFileDetails and also add parent-directory metadata and return the correct dict.
I'm going to commit the proposed change.
BEGINRELEASENOTES
*Resources/Catalog/FileCatalogClient
NEW: Add the getFileUserMetadataBulk method to the FileCatalogClient to make it compatible with the usage of RucioFileCatalogClient
ENDRELEASENOTES