bes Updated for version 3.20.10
AggMemberDatasetDimensionCache.h
1/*
2 * AggMemberDatasetDimensionCache.h
3 *
4 * Created on: Sep 25, 2015
5 * Author: ndp
6 */
7
8#ifndef MODULES_NCML_MODULE_AGGMEMBERDATASETDIMENSIONCACHE_H_
9#define MODULES_NCML_MODULE_AGGMEMBERDATASETDIMENSIONCACHE_H_
10
11#include "BESFileLockingCache.h"
12
13namespace agg_util
14{
15// Forward declaration
16class AggMemberDataset;
17
33{
34private:
35 static bool d_enabled;
36 static AggMemberDatasetDimensionCache * d_instance;
37 static void delete_instance();
38
39 std::string d_dimCacheDir;
40 std::string d_dataRootDir;
41 std::string d_dimCacheFilePrefix;
42 unsigned long d_maxCacheSize;
43
46
47 bool is_valid(const std::string &cache_file_name, const std::string &dataset_file_name);
48
49
50 static std::string getBesDataRootDirFromConfig();
51 static std::string getCacheDirFromConfig();
52 static std::string getDimCachePrefixFromConfig();
53 static unsigned long getCacheSizeFromConfig();
54
55
56protected:
57
58 AggMemberDatasetDimensionCache(const std::string &data_root_dir, const std::string &stored_results_subdir, const std::string &prefix, unsigned long long size);
59
60public:
61 static const std::string CACHE_DIR_KEY;
62 static const std::string PREFIX_KEY;
63 static const std::string SIZE_KEY;
64 // static const string CACHE_CONTROL_FILE;
65
66 static AggMemberDatasetDimensionCache *get_instance(const std::string &bes_catalog_root_dir, const std::string &stored_results_subdir, const std::string &prefix, unsigned long long size);
68
70
72};
73
74} /* namespace agg_util */
75
76#endif /* MODULES_NCML_MODULE_AGGMEMBERDATASETDIMENSIONCACHE_H_ */
Implementation of a caching mechanism for compressed data.
static AggMemberDatasetDimensionCache * get_instance()
Helper class for temporarily hijacking an existing dhi to load a DDX response for one particular file...