@@ -974,7 +974,8 @@ idType HNSWIndex<DataType, DistType>::mutuallyConnectNewElement(
974
974
// lock.
975
975
if (new_node_level_data.numLinks == max_M_cur) {
976
976
// The new node cannot add more neighbors
977
- this ->log (" Couldn't add all chosen neighbors upon inserting a new node" );
977
+ this ->log (VecSimCommonStrings::LOG_DEBUG_STRING,
978
+ " Couldn't add all chosen neighbors upon inserting a new node" );
978
979
unlockNodeLinks (new_node_level);
979
980
unlockNodeLinks (neighbor_graph_data);
980
981
break ;
@@ -1350,6 +1351,8 @@ template <typename DataType, typename DistType>
1350
1351
void HNSWIndex<DataType, DistType>::resizeIndexCommon(size_t new_max_elements) {
1351
1352
assert (new_max_elements % this ->blockSize == 0 &&
1352
1353
" new_max_elements must be a multiple of blockSize" );
1354
+ this ->log (VecSimCommonStrings::LOG_VERBOSE_STRING,
1355
+ " Updating HNSW index capacity from %zu to %zu" , this ->maxElements , new_max_elements);
1353
1356
resizeLabelLookup (new_max_elements);
1354
1357
visitedNodesHandlerPool.resize (new_max_elements);
1355
1358
idToMetaData.resize (new_max_elements);
@@ -1445,7 +1448,8 @@ void HNSWIndex<DataType, DistType>::mutuallyUpdateForRepairedNode(
1445
1448
for (auto chosen_id : chosen_neighbors) {
1446
1449
if (node_neighbors_idx == max_M_cur) {
1447
1450
// Cannot add more new neighbors, we reached the capacity.
1448
- this ->log (" Couldn't add all the chosen new nodes upon updating %u, as we reached the"
1451
+ this ->log (VecSimCommonStrings::LOG_DEBUG_STRING,
1452
+ " Couldn't add all the chosen new nodes upon updating %u, as we reached the"
1449
1453
" maximum number of neighbors per node" ,
1450
1454
node_id);
1451
1455
break ;
@@ -1803,7 +1807,8 @@ AddVectorCtx HNSWIndex<DataType, DistType>::storeNewElement(labelType label,
1803
1807
try {
1804
1808
new (cur_egd) ElementGraphData (state.elementMaxLevel , levelDataSize, this ->allocator );
1805
1809
} catch (std::runtime_error &e) {
1806
- this ->log (" Error - allocating memory for new element failed due to low memory" );
1810
+ this ->log (VecSimCommonStrings::LOG_WARNING_STRING,
1811
+ " Error - allocating memory for new element failed due to low memory" );
1807
1812
throw e;
1808
1813
}
1809
1814
0 commit comments