26 #ifndef _bes_dap_function_response_cache_h 27 #define _bes_dap_function_response_cache_h 31 #include "BESFileLockingCache.h" 37 class ConstraintEvaluator;
38 class BaseTypeFactory;
79 static void delete_instance() {
92 bool is_valid(
const std::string &cache_file_name,
const std::string &dataset);
94 std::string get_resource_id(libdap::DDS *dds,
const std::string &constraint);
95 std::string get_hash_basename(
const std::string &resource_id);
97 libdap::DDS *read_cached_data(istream &cached_data);
99 libdap::DDS *write_dataset_to_cache(libdap::DDS *dds,
const string &resourceId,
const string &constraint,
100 const string &cache_file_name);
102 libdap::DDS *load_from_cache(
const string &resource_id,
string &cache_file_name);
104 friend class FunctionResponseCacheTest;
105 friend class StoredResultTest;
128 static const string PATH_KEY;
129 static const string PREFIX_KEY;
130 static const string SIZE_KEY;
143 virtual bool can_be_cached(libdap::DDS *dds,
const std::string &constraint);
145 static string get_cache_dir_from_config();
146 static string get_cache_prefix_from_config();
147 static unsigned long get_cache_size_from_config();
150 #endif // _bes_dap_response_cache_h BESDapFunctionResponseCache(const string &cache_dir, const string &prefix, unsigned long long size)
Protected constructor that takes as arguments keys to the cache directory, file prefix, and size of the cache to be looked up a configuration file.
Implementation of a caching mechanism for compressed data. This cache uses simple advisory locking fo...
virtual libdap::DDS * get_or_cache_dataset(libdap::DDS *dds, const std::string &constraint)
Return a DDS loaded with data that can be serialized back to a client.
Cache the results from server functions.