25#ifndef _bes_store_result_cache_h
26#define _bes_store_result_cache_h
30#include <libdap/DapXmlNamespaces.h>
33#include "BESFileLockingCache.h"
35#define DAP_STORED_RESULTS_CACHE_SUBDIR_KEY "DAP.StoredResultsCache.subdir"
36#define DAP_STORED_RESULTS_CACHE_PREFIX_KEY "DAP.StoredResultsCache.prefix"
37#define DAP_STORED_RESULTS_CACHE_SIZE_KEY "DAP.StoredResultsCache.size"
39#undef DAP2_STORED_RESULTS
43class ConstraintEvaluator;
58 static bool d_enabled;
60 static void delete_instance()
66 string d_storedResultsSubdir;
68 string d_resultFilePrefix;
69 unsigned long d_maxCacheSize;
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();
96 unsigned long long size);
100 static const string SUBDIR_KEY;
101 static const string PREFIX_KEY;
102 static const string SIZE_KEY;
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);
Implementation of a caching mechanism for compressed data.
virtual string store_dap4_result(libdap::DMR &dmr, const string &constraint, BESDapResponseBuilder *rb)
libdap::DMR * get_cached_dap4_data(const string &cache_file_name, libdap::D4BaseTypeFactory *factory, const string &filename)
static BESStoredDapResultCache * get_instance()