From ff3173d58807b96debe358fa06e36aa2eb566dcd Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 25 Nov 2016 13:44:41 +0200 Subject: [PATCH] Cache: Remove obsolete method --- server/modules/filter/cache/cache.cc | 71 ---------------------------- server/modules/filter/cache/cache.h | 2 - 2 files changed, 73 deletions(-) diff --git a/server/modules/filter/cache/cache.cc b/server/modules/filter/cache/cache.cc index 138be8d27..cefdde9a7 100644 --- a/server/modules/filter/cache/cache.cc +++ b/server/modules/filter/cache/cache.cc @@ -81,77 +81,6 @@ Cache::~Cache() ss_dassert(false); } -//static -Cache* Cache::Create(const char* zName, CACHE_CONFIG& config) -{ - Cache* pCache = NULL; - - CACHE_RULES* pRules = NULL; - - if (config.rules) - { - pRules = cache_rules_load(config.rules, config.debug); - } - else - { - pRules = cache_rules_create(config.debug); - } - - if (pRules) - { - HASHTABLE* pPending = hashtable_alloc(CACHE_PENDING_ITEMS, hashfn, hashcmp); - - if (pPending) - { - StorageFactory *pFactory = StorageFactory::Open(config.storage); - - if (pFactory) - { - uint32_t ttl = config.ttl; - int argc = config.storage_argc; - char** argv = config.storage_argv; - - Storage* pStorage = pFactory->createStorage(zName, ttl, argc, argv); - - if (pStorage) - { - pCache = new (std::nothrow) Cache(zName, - config, - pRules, - pFactory, - pStorage, - pPending); - } - else - { - MXS_ERROR("Could not create storage instance for '%s'.", zName); - } - } - else - { - MXS_ERROR("Could not open storage factory '%s'.", config.storage); - } - - if (!pCache) - { - delete pFactory; - } - } - - if (!pCache) - { - hashtable_free(pPending); - } - } - - if (!pCache) - { - cache_rules_free(pRules); - } - - return pCache; -} - //static bool Cache::Create(const CACHE_CONFIG& config, CACHE_RULES** ppRules, diff --git a/server/modules/filter/cache/cache.h b/server/modules/filter/cache/cache.h index eb002f4de..8de701fa9 100644 --- a/server/modules/filter/cache/cache.h +++ b/server/modules/filter/cache/cache.h @@ -26,8 +26,6 @@ class Cache public: ~Cache(); - static Cache* Create(const char* zName, CACHE_CONFIG& config); - /** * Returns whether the results of a particular query should be stored. *