wtsi-npg / baton

iRODS client programs and API
http://wtsi-npg.github.io/baton
GNU General Public License v2.0
19 stars 19 forks source link

baton-metasuper is gone since 1.0.0 #203

Closed mcast closed 5 years ago

mcast commented 6 years ago

Hi Keith,

The changelog says metasuper is deprecated (b295a86c), but actually it is removed (https://github.com/wtsi-npg/baton/pull/185#discussion_r115940242).

I'm intending to remove baton-metasuper because everything it does can be done with the other tools.

Would "baton-metasuper replaced by baton-put" make a more accurate changelog entry?

Unless I've misunderstood what baton-put can do, or failed to find some other change, then I now don't have a way to replace all AVUs on an existing file.

This isn't a problem for me because I only use it on new files, so I can switch to baton-put or baton-metamod; but I think some functionality (baton-metamod --operation supersede?) has been lost. Related is #160 (baton-metamod --operation set) for superseding a subset of the keys.

With apologies for the slightly vague & multi-bug report,

Matthew

keithj commented 6 years ago

It was deprecated in 1.0.0, to be removed in the next release, which was 1.1.0 (although by removed, I mean removed from the Makefile, so that it doesn't build). I'm sorry, the release notes of 1.1.0 should have announced the removal.

As baton-metamod can add and remove AVUs, anything done with baton-metasuper can be done with the former and without much loss of performance because all operations can happen on one connection. e.g. to supersede a=99, a=100 with a=1000 would be remove a=99, remove a=100, add a=1000. The main reason for the change is that it moves the logic to manipulate AVUs in complex ways out of the C code (where it's harder to implement, debug and maintain) and into the scripting layers which create the JSON input. It also provides opportunities for better (finer-grained) error handling, whereas baton-metasuper could bail part way through its operations if it trapped an error, potentially leaving your metadata in an undefined state.

baton-put is for inserting data into iRODS, rather than for manipulating metadata, so it's not a replacement for baton-metasuper, it's a a baton version of iput.

mcast commented 6 years ago

On Fri, May 11, 2018 at 06:49:12AM -0700, Keith James wrote:

It was deprecated in 1.0.0, to be removed in the next release, [...] The main reason for the change is that it moves the logic to manipulate AVUs in complex ways out of the C code [...] also provides opportunities for better (finer-grained) error handling,

Thanks @keithj for the explanation and IRL discussion this morning.

For me, this issue becomes a small request for enough documentation that other people don't need to come ask the same question.

baton-put is for inserting data into iRODS, rather than for manipulating metadata, [...]

This came from my mis-interpretation of "can be done with other tools".

-- Matthew

-- The Wellcome Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

keithj commented 5 years ago

Closed as historical.