Cache: Remove obsolete method

This commit is contained in:
Johan Wikman 2016-11-25 13:44:41 +02:00
parent 68f70ee5b2
commit ff3173d588
2 changed files with 0 additions and 73 deletions

View File

@ -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,

View File

@ -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.
*