56class BESStoredDapResultCache:
public BESFileLockingCache {
58 static bool d_enabled;
59 static BESStoredDapResultCache *d_instance;
60 static void delete_instance()
66 string d_storedResultsSubdir;
68 string d_resultFilePrefix;
69 unsigned long d_maxCacheSize;
72 BESStoredDapResultCache();
74 BESStoredDapResultCache(
const BESStoredDapResultCache &src);
76 bool is_valid(
const std::string &cache_file_name,
const std::string &dataset);
77#ifdef DAP2_STORED_RESULTS
78 bool read_dap2_data_from_cache(
const string &cache_file_name, libdap::DDS *fdds);
80 bool read_dap4_data_from_cache(
const string &cache_file_name, libdap::DMR *dmr);
82 friend class StoredDap2ResultTest;
83 friend class StoredDap4ResultTest;
84 friend class ResponseBuilderTest;
86 string get_stored_result_local_id(
const string &dataset,
const string &ce, libdap::DAPVersion version);
88 string getBesDataRootDirFromConfig();
89 string getSubDirFromConfig();
90 string getResultPrefixFromConfig();
91 unsigned long getCacheSizeFromConfig();
95 BESStoredDapResultCache(
const string &data_root_dir,
const string &stored_results_subdir,
const string &prefix,
96 unsigned long long size);
100 static const string SUBDIR_KEY;
101 static const string PREFIX_KEY;
102 static const string SIZE_KEY;
105 virtual ~BESStoredDapResultCache() { }
107 static BESStoredDapResultCache *
get_instance(
const string &bes_catalog_root_dir,
108 const string &stored_results_subdir,
const string &prefix,
unsigned long long size);
111#ifdef DAP2_STORED_RESULTS
112 libdap::DDS *get_cached_dap2_data_ddx(
const std::string &cache_file_name, libdap::BaseTypeFactory *factory,
const std::string &dataset);
114 virtual string store_dap2_result(libdap::DDS &dds,
const std::string &constraint,
BESDapResponseBuilder *rb,
115 libdap::ConstraintEvaluator *eval);
118 libdap::DMR *
get_cached_dap4_data(
const string &cache_file_name, libdap::D4BaseTypeFactory *factory,
119 const string &filename);