bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
List of all registered decompression methods. More...
#include <BESUncompressManager3.h>
Public Member Functions | |
virtual bool | add_method (const std::string &name, p_bes_uncompress method) |
create_and_lock a uncompress method to the list | |
BESUncompressManager3 () | |
constructs an uncompression manager adding gz, z, and bz2 uncompression methods by default. | |
virtual void | dump (std::ostream &strm) const |
dumps information about this object | |
virtual p_bes_uncompress | find_method (const std::string &name) |
returns the uncompression method specified | |
virtual bool | uncompress (const std::string &src, std::string &target, BESFileLockingCache *cache) |
If the file 'src' should be uncompressed, do so and return a new file name on the value-result param 'target'. | |
Static Public Member Functions | |
static BESUncompressManager3 * | TheManager () |
List of all registered decompression methods.
The BESUncompressManager3 allows the developer to add or remove named decompression methods from the list for this server. By default a gz and bz2 and Z function is provided.
What is actually added to the list are static decompression functions. Each of these functions is responsible for decompressing a specific type of compressed file. The manager knows which type to decompress by the file extension.
Definition at line 56 of file BESUncompressManager3.h.
BESUncompressManager3::BESUncompressManager3 | ( | ) |
constructs an uncompression manager adding gz, z, and bz2 uncompression methods by default.
Adds methods to uncompress gz, bz2, and Z files.
Looks for a configuration parameter for the number of times to try to lock the cache (BES.Uncompress.NumTries) and the time in microseconds between tries (BES.Uncompress.Retry).
Definition at line 63 of file BESUncompressManager3.cc.
|
virtual |
Definition at line 70 of file BESUncompressManager3.cc.
|
virtual |
create_and_lock a uncompress method to the list
This method actually adds to the list a static method that knows how to uncompress a particular type of file. For example, a .gz or .bz2 file.
name | name of the method to add to the list |
method | the static function that uncompress the particular type of file |
Definition at line 81 of file BESUncompressManager3.cc.
|
virtual |
dumps information about this object
Displays the pointer value of this instance along with the names of the registered decompression methods.
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Definition at line 251 of file BESUncompressManager3.cc.
|
virtual |
returns the uncompression method specified
This method looks up the uncompression method with the given name and returns that method.
name | name of the uncompression method to find |
Definition at line 102 of file BESUncompressManager3.cc.
|
static |
Definition at line 274 of file BESUncompressManager3.cc.
|
virtual |
If the file 'src' should be uncompressed, do so and return a new file name on the value-result param 'target'.
This code tests that the file named by 'src' really should be uncompressed, returning false if it clearly should not (i.e., it does not end in an extension like '.gz') or cannot. If the file is uncompressed, this code takes care of doing all the stuff that needs to happen as far as caching the uncompressed data, ensuring that the file holding those data is locked for read-only access.
When new data are added to the cache, this code checks the size and, if the cache is too large, uses a LRU algorithm to remove files to make room for the new file.
src | file to be uncompressed |
cache_file | Name of file to uncompress into |
cache | BESCache object to uncompress the src file in |
BESInternalError | if there is a problem uncompressing the file |
If the cache object is a null pointer then we can't go further, and we know that the item isn't in the cache. FIXME IS THIS AN ERROR?? I think maybe it's fine returning false and not throwing because this means the down stream software will try to read the file and, since this test is after checks that determine if the file appears to be compressed, will fail. This may however be difficult to diagnose for the users.
Definition at line 146 of file BESUncompressManager3.cc.