Cache: Remove obsolete method
This commit is contained in:
71
server/modules/filter/cache/cache.cc
vendored
71
server/modules/filter/cache/cache.cc
vendored
@ -81,77 +81,6 @@ Cache::~Cache()
|
|||||||
ss_dassert(false);
|
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
|
//static
|
||||||
bool Cache::Create(const CACHE_CONFIG& config,
|
bool Cache::Create(const CACHE_CONFIG& config,
|
||||||
CACHE_RULES** ppRules,
|
CACHE_RULES** ppRules,
|
||||||
|
2
server/modules/filter/cache/cache.h
vendored
2
server/modules/filter/cache/cache.h
vendored
@ -26,8 +26,6 @@ class Cache
|
|||||||
public:
|
public:
|
||||||
~Cache();
|
~Cache();
|
||||||
|
|
||||||
static Cache* Create(const char* zName, CACHE_CONFIG& config);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the results of a particular query should be stored.
|
* Returns whether the results of a particular query should be stored.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user