Better function name and comment

This commit is contained in:
alesapin 2020-07-21 11:13:23 +03:00
parent 82c5ff6e9b
commit 1d8cab3379
2 changed files with 4 additions and 4 deletions

View File

@ -865,7 +865,7 @@ void CacheDictionary::update(BunchUpdateUnit & bunch_update_unit) const
{ {
try try
{ {
auto current_source_ptr = getDictionarySourceOrUpdate(); auto current_source_ptr = getSourceAndUpdateIfNeeded();
Stopwatch watch; Stopwatch watch;

View File

@ -92,7 +92,7 @@ public:
database, database,
name, name,
dict_struct, dict_struct,
getDictionarySourceOrUpdate()->clone(), getSourceAndUpdateIfNeeded()->clone(),
dict_lifetime, dict_lifetime,
strict_max_lifetime_seconds, strict_max_lifetime_seconds,
size, size,
@ -295,7 +295,7 @@ private:
/// MultiVersion is not used here because it works with constant pointers. /// MultiVersion is not used here because it works with constant pointers.
/// For some reason almost all methods in IDictionarySource interface are /// For some reason almost all methods in IDictionarySource interface are
/// not constant. /// not constant.
SharedDictionarySourcePtr getDictionarySourceOrUpdate() const SharedDictionarySourcePtr getSourceAndUpdateIfNeeded() const
{ {
std::lock_guard lock(source_mutex); std::lock_guard lock(source_mutex);
if (error_count) if (error_count)
@ -326,7 +326,7 @@ private:
const std::string full_name; const std::string full_name;
const DictionaryStructure dict_struct; const DictionaryStructure dict_struct;
/// Dictionary source should be used without mutex /// Dictionary source should be used with mutex
mutable std::mutex source_mutex; mutable std::mutex source_mutex;
mutable SharedDictionarySourcePtr source_ptr; mutable SharedDictionarySourcePtr source_ptr;