bes
Updated for version 3.17.4
|
List of all registered decompression methods. More...
#include <BESUncompressManager3.h>
Public Member Functions | |
virtual bool | add_method (const string &name, p_bes_uncompress method) |
create_and_lock a uncompress method to the list More... | |
virtual void | dump (ostream &strm) const |
dumps information about this object More... | |
virtual p_bes_uncompress | find_method (const string &name) |
returns the uncompression method specified More... | |
virtual bool | uncompress (const string &src, 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'. More... | |
Static Public Member Functions | |
static BESUncompressManager3 * | TheManager () |
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 58 of file BESUncompressManager3.h.
|
virtual |
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 71 of file BESUncompressManager3.cc.
|
virtual |
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 214 of file BESUncompressManager3.cc.
|
virtual |
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 90 of file BESUncompressManager3.cc.
|
virtual |
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 |
target | target file to uncompress into |
cache | BESCache object to uncompress the src file in |
BESInternalError | if there is a problem uncompressing the file |
Definition at line 132 of file BESUncompressManager3.cc.
References BESFileLockingCache::cache_too_big(), BESFileLockingCache::create_and_lock(), BESFileLockingCache::exclusive_to_shared_lock(), find_method(), BESFileLockingCache::get_cache_file_name(), BESFileLockingCache::get_read_lock(), BESFileLockingCache::unlock_cache(), BESFileLockingCache::update_and_purge(), and BESFileLockingCache::update_cache_info().