62 d_instance =
new BESCache3(keys, cache_dir_key, prefix_key, size_key);
74 d_instance =
new BESCache3(cache_dir, prefix, size);
86 throw BESInternalError(
"Tried to get the BESCache3 instance, but it hasn't been created yet", __FILE__, __LINE__);
109 keys->
get_value(cache_dir_key, cache_dir, found);
111 throw BESSyntaxUserError(
"The cache directory key " + cache_dir_key +
" was not found in the BES configuration file", __FILE__, __LINE__);
115 keys->
get_value(prefix_key, prefix, found);
117 throw BESSyntaxUserError(
"The prefix key " + prefix_key +
" was not found in the BES configuration file", __FILE__, __LINE__);
120 string cache_size_str;
121 keys->
get_value(size_key, cache_size_str, found);
123 throw BESSyntaxUserError(
"The size key " + size_key +
" was not found in the BES configuration file", __FILE__, __LINE__);
125 std::istringstream is(cache_size_str);
126 unsigned long long max_cache_size_in_bytes;
127 is >> max_cache_size_in_bytes;
129 initialize(cache_dir, prefix, max_cache_size_in_bytes);
141 strm <<
BESIndent::LMarg <<
"BESCache3::dump - (" << (
void *)
this <<
")" << endl;
virtual void dump(ostream &strm) const
dumps information about this object
exception thrown if inernal error encountered
error thrown if there is a user syntax error in the request or any other user error ...
mapping of key/value pairs defining different behaviors of an application.
Implementation of a caching mechanism for compressed data.
static ostream & LMarg(ostream &strm)
void get_value(const string &s, string &val, bool &found)
Retrieve the value of a given key, if set.
static BESCache3 * get_instance()
Get an instance of the BESCache3 object.