MultiArchive Class
The MultiArchive class implements a ArchiveI interface for accessing more than one archive.The MultiArchive is configured via a "master" archive file, an ASCII file with the following format:
- Comments (starting with a number-sign) and empty lines are ignored
- The very first line must be
master_version=1There must be no comments preceding this line!- All remaining lines list one archive name per line
Example
master_version=1 # First check the "fast" archive /archives/fast/dir # Then check the "main" archive /archives/main/2001_05/dir /archives/main/2001_04/dir /archives/main/2001_03/dir /archives/main/2001_02/dir /archives/main/2001/dirThe most recent sub-archive has to be listed first, followed by the next one back in time and so on to the oldest sub-archive.
This type of archive is read-only!
For now, each individual archive is in the binary data format (BinArchive). Later, it might be necessary to specify the type together with the name for each archive. The master_version will then be incremented.
If the "master" file is invalid, it is considered an ordinary BinArchive directory file, i.e. Tools based on the MultiArchive should work just like BinArchive-based Tools when operating on a single archive.
Details
No sophisticated merging technique is used. Given a channel and point in time, the MultiArchive will try to read this from the first archive in the multi archive list, then the next archive and so on until it succeeds.
When combining archives with disjunct channel sets, a read request for a channel will yield data from the single archive that holds that channel.
When channels are present in multiple archives, a read request for a given point in time will return values from the first archive listed in the master file that has values for that channel and point in time.
Consequently, one should avoid archives with overlapping time ranges. If this cannot be avoided, the "most important" archive should be listed first.Interface
- Open a MultiArchive for the given master file
MultiArchive(const stdString &master_file);- All virtuals from ArchiveI are implemented, except that the "write" routines fail for this read-only archive type.
IndexCreated from sources with MakeDoc Perl script.