This commit is contained in:
KinderRiven 2022-07-28 13:23:57 +08:00
parent f6a58bff4c
commit fbaa70b313
3 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ static bool isQueryInitialized()
{
return CurrentThread::isInitialized()
&& CurrentThread::get().getQueryContext()
&& CurrentThread::getQueryId().size != 0;
&& CurrentThread::getQueryId().size() != 0;
}
bool FileCache::isReadOnly()
@ -82,7 +82,7 @@ FileCache::QueryContextPtr FileCache::getCurrentQueryContext(std::lock_guard<std
if (!isQueryInitialized())
return nullptr;
return getQueryContext(CurrentThread::getQueryId().toString(), cache_lock);
return getQueryContext(std::string(CurrentThread::getQueryId()), cache_lock);
}
FileCache::QueryContextPtr FileCache::getQueryContext(const String & query_id, std::lock_guard<std::mutex> & /* cache_lock */)

View File

@ -1,7 +1,7 @@
#include <Disks/ObjectStorages/LocalObjectStorage.h>
#include <Disks/ObjectStorages/DiskObjectStorageCommon.h>
#include <Common/IFileCache.h>
#include <Common/FileCache.h>
#include <Common/FileCacheFactory.h>
#include <Common/filesystemHelpers.h>
#include <Common/logger_useful.h>

View File

@ -128,7 +128,7 @@ void S3ObjectStorage::removeCacheIfExists(const std::string & path_key)
if (!cache || path_key.empty())
return;
IFileCache::Key key = cache->hash(path_key);
FileCache::Key key = cache->hash(path_key);
cache->removeIfExists(key);
}
@ -500,7 +500,7 @@ ReadSettings S3ObjectStorage::patchSettings(const ReadSettings & read_settings)
ReadSettings settings{read_settings};
if (cache)
{
if (IFileCache::isReadOnly())
if (FileCache::isReadOnly())
settings.read_from_filesystem_cache_if_exists_otherwise_bypass_cache = true;
settings.remote_fs_cache = cache;