Add support to CTA for multiple tape label formats
Problem to solve
CTA needs to add support for reading OSM/dCache and Enstore tape formats, as agreed at the EOS Workshop 2022 BoF.
The dCache devs have a working proof-of-concept implementation, see details in https://gitlab.cern.ch/cta/CTA/-/merge_requests/187
To properly integrate this feature into CTA, we should refactor the code in
- dCache developers
- Fermilab/Enstore replacement developers
First, some refactoring:
CTA/tapeserver/castor/tape/tapeserver/file/File.cppto separate the classes in that file into separate
Add helper methods to
ReadFileclasses to abstract out the specific details of how to read the tape file. See https://gitlab.cern.ch/cta/CTA/-/merge_requests/187 and in particular https://gitlab.cern.ch/cta/CTA/-/merge_requests/187#note_5597846 for an overview of which helper functions are needed.
Change the helper methods in
ReadFileinto pure virtual functions. Create subclasses (example names:
CtaReadFile) and move the CTA helper method implementations into those classes.
Instantiate on the appropriate subclass of ReadFile when we call
openReadFile(currently returns a smart pointer to a
ReadFileobject, it can return
CtaReadFileinstead). Same for
After this refactoring is done, we should add this to a release and deploy, to ensure there are no regressions.
Then we can add in the dCache OSM label format implementation:
Add empty subclasses
openReadSessionto check the label format. If it is OSM format, return the OSM classes. Otherwise, by default return CTA label format classes.
dCache developers can add their implementation.
The last 3 points above can be repeated for the Enstore format.