add name to logs in HashedDictionary

This commit is contained in:
vdimir 2024-02-23 16:28:58 +00:00
parent 4a7ad15a9a
commit 0b2267cfe5
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862

View File

@ -365,9 +365,10 @@ HashedDictionary<dictionary_key_type, sparse, sharded>::~HashedDictionary()
} }
} }
LOG_TRACE(log, "Destroying {} non empty hash tables (using {} threads)", hash_tables_count, pool.getMaxThreads()); String dictionary_name = getFullName();
LOG_TRACE(log, "Destroying {} non empty hash tables for dictionary {} (using {} threads) ", hash_tables_count, dictionary_name, pool.getMaxThreads());
pool.wait(); pool.wait();
LOG_TRACE(log, "Hash tables destroyed"); LOG_TRACE(log, "Hash tables for dictionary {} destroyed", dictionary_name);
} }
template <DictionaryKeyType dictionary_key_type, bool sparse, bool sharded> template <DictionaryKeyType dictionary_key_type, bool sparse, bool sharded>
@ -741,6 +742,7 @@ void HashedDictionary<dictionary_key_type, sparse, sharded>::createAttributes()
attributes.reserve(size); attributes.reserve(size);
HashTableGrowerWithPrecalculationAndMaxLoadFactor grower(configuration.max_load_factor); HashTableGrowerWithPrecalculationAndMaxLoadFactor grower(configuration.max_load_factor);
String dictionary_name = getFullName();
for (const auto & dictionary_attribute : dict_struct.attributes) for (const auto & dictionary_attribute : dict_struct.attributes)
{ {
@ -770,9 +772,9 @@ void HashedDictionary<dictionary_key_type, sparse, sharded>::createAttributes()
} }
if constexpr (IsBuiltinHashTable<typename CollectionsHolder<ValueType>::value_type>) if constexpr (IsBuiltinHashTable<typename CollectionsHolder<ValueType>::value_type>)
LOG_TRACE(log, "Using builtin hash table for {} attribute", dictionary_attribute.name); LOG_TRACE(log, "Using builtin hash table for {} attribute of {}", dictionary_attribute.name, dictionary_name);
else else
LOG_TRACE(log, "Using sparsehash for {} attribute", dictionary_attribute.name); LOG_TRACE(log, "Using sparsehash for {} attribute of {}", dictionary_attribute.name, dictionary_name);
}; };
callOnDictionaryAttributeType(dictionary_attribute.underlying_type, type_call); callOnDictionaryAttributeType(dictionary_attribute.underlying_type, type_call);