26 #ifndef _bes_store_result_cache_h 27 #define _bes_store_result_cache_h 31 #include <DapXmlNamespaces.h> 33 #include "BESFileLockingCache.h" 43 class ConstraintEvaluator;
44 class BaseTypeFactory;
57 static void delete_instance() {
delete d_instance; d_instance = 0; }
59 string d_storedResultsSubdir;
61 string d_resultFilePrefix;
62 unsigned long d_maxCacheSize;
68 bool is_valid(
const std::string &cache_file_name,
const std::string &dataset);
69 bool read_dap2_data_from_cache(
const string &cache_file_name, libdap::DDS *fdds);
70 bool read_dap4_data_from_cache(
const string &cache_file_name, libdap::DMR *dmr);
72 friend class StoredDap2ResultTest;
73 friend class StoredDap4ResultTest;
74 friend class ResponseBuilderTest;
76 string get_stored_result_local_id(
const string &dataset,
const string &ce, libdap::DAPVersion version);
78 string getBesDataRootDirFromConfig();
79 string getSubDirFromConfig();
80 string getResultPrefixFromConfig();
81 unsigned long getCacheSizeFromConfig();
85 BESStoredDapResultCache(
const string &data_root_dir,
const string &stored_results_subdir,
const string &prefix,
unsigned long long size);
88 static const string SUBDIR_KEY;
89 static const string PREFIX_KEY;
90 static const string SIZE_KEY;
92 static BESStoredDapResultCache *get_instance(
const string &bes_catalog_root_dir,
const string &stored_results_subdir,
const string &prefix,
unsigned long long size);
97 libdap::DDS *get_cached_dap2_data_ddx(
const std::string &cache_file_name, libdap::BaseTypeFactory *factory,
const std::string &dataset);
98 libdap::DMR *get_cached_dap4_data(
const string &cache_file_name, libdap::D4BaseTypeFactory *factory,
const string &filename);
105 virtual string store_dap2_result(libdap::DDS &dds,
const std::string &constraint,
BESDapResponseBuilder *rb,
106 libdap::ConstraintEvaluator *eval);
109 virtual string store_dap4_result(libdap::DMR &dmr,
const string &constraint,
BESDapResponseBuilder *rb);
118 #endif // _bes_store_result_cache_h Implementation of a caching mechanism for compressed data. This cache uses simple advisory locking fo...