wtsi-npg/perl-irods-wrap

Feature Request add_object_avu pass-through

jwhsanger opened this issue · 1 comments

Hi Guys,

Me again. Could you consider making a small change to the add_object/collection_avu method? Internally it performs a check on the object to determine if the avu already exists then throws an exception if the user is trying to add a duplicate. I have a use case where I would like to pass avus to the object but not throw an exception if one already exists (resuming an interrupted load for example). the work around is to check upfront whether the avus exist basically repeating the process that is performed inside add_object/collection_avu. Could it be possible to add a flag onto the end of the arguments list (pass-through or ignore duplicates.. true|false) that still has the same functionality but allows the application to carry on in the face of duplicates??

Cheers
Jon

Hi Jon,

The WTSI::NPG::iRODS methods are the thinnest of our wrapper APIs around iRODS and as such they try to pass through as much of iRODS' behaviour as possible. It may not be perfectly true for all behaviour, but that was the intention and is the reason why attempting to add an existing AVU is considered an error.

Have you looked at WTSI::NPG::iRODS::DataObject and WTSI::NPG::iRODS::Collection at all? These are designed to provide extra behaviour on top of WTSI::NPG::iRODS, including recovering from attempts to overwrite existing AVUs (see WTSI::NPG::iRODS::DataObject::add_avu).