You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-13 23:02:14 +03:00
First cut of synchronizer is done, won't build yet.
This commit is contained in:
@@ -192,6 +192,12 @@ void Cache::exists(const vector<string> &keys, vector<bool> *out)
|
||||
(*out)[i] = (m_lru.find(keys[i]) != m_lru.end());
|
||||
}
|
||||
|
||||
bool Cache::exists(const string &key)
|
||||
{
|
||||
boost::unique_lock<boost::mutex> s(lru_mutex);
|
||||
return m_lru.find(keys[i]) != m_lru.end();
|
||||
}
|
||||
|
||||
void Cache::newObject(const string &key, size_t size)
|
||||
{
|
||||
boost::unique_lock<boost::mutex> s(lru_mutex);
|
||||
@@ -278,6 +284,19 @@ void Cache::makeSpace(size_t size)
|
||||
}
|
||||
}
|
||||
|
||||
void Cache::rename(const string &oldKey, const string &newKey, ssize_t sizediff)
|
||||
{
|
||||
boost::unique_lock<boost::mutex> s(lru_mutex);
|
||||
auto it = m_lru(oldKey);
|
||||
assert(it != m_lru.end());
|
||||
|
||||
auto lit = it->lit;
|
||||
m_lru.erase(it);
|
||||
*lit = newKey;
|
||||
m_lru.insert(lit);
|
||||
currentCacheSize += sizediff;
|
||||
}
|
||||
|
||||
size_t Cache::getCurrentCacheSize() const
|
||||
{
|
||||
return currentCacheSize;
|
||||
|
||||
Reference in New Issue
Block a user