@@ -255,9 +255,9 @@ class HNSWIndex : public VecSimIndexAbstract<DistType>,
255255 void unlockNodeLinks (ElementGraphData *node_data) const ;
256256 VisitedNodesHandler *getVisitedList () const ;
257257 void returnVisitedList (VisitedNodesHandler *visited_nodes_handler) const ;
258- VecSimIndexInfo info () const override ;
258+ VecSimIndexDebugInfo debugInfo () const override ;
259259 VecSimIndexBasicInfo basicInfo () const override ;
260- VecSimInfoIterator * infoIterator () const override ;
260+ VecSimDebugInfoIterator * debugInfoIterator () const override ;
261261 bool preferAdHocSearch (size_t subsetSize, size_t k, bool initial_check) const override ;
262262 const char *getDataByInternalId (idType internal_id) const ;
263263 ElementGraphData *getGraphDataByInternalId (idType internal_id) const ;
@@ -2086,18 +2086,19 @@ VecSimQueryReply *HNSWIndex<DataType, DistType>::rangeQuery(const void *query_da
20862086}
20872087
20882088template <typename DataType, typename DistType>
2089- VecSimIndexInfo HNSWIndex<DataType, DistType>::info () const {
2089+ VecSimIndexDebugInfo HNSWIndex<DataType, DistType>::debugInfo () const {
20902090
2091- VecSimIndexInfo info;
2091+ VecSimIndexDebugInfo info;
20922092 info.commonInfo = this ->getCommonInfo ();
2093+ auto [ep_id, max_level] = this ->safeGetEntryPointState ();
20932094
20942095 info.commonInfo .basicInfo .algo = VecSimAlgo_HNSWLIB;
20952096 info.hnswInfo .M = this ->getM ();
20962097 info.hnswInfo .efConstruction = this ->getEfConstruction ();
20972098 info.hnswInfo .efRuntime = this ->getEf ();
20982099 info.hnswInfo .epsilon = this ->epsilon ;
2099- info.hnswInfo .max_level = this -> getMaxLevel () ;
2100- info.hnswInfo .entrypoint = this -> getEntryPointLabel () ;
2100+ info.hnswInfo .max_level = max_level ;
2101+ info.hnswInfo .entrypoint = ep_id != INVALID_ID ? getExternalLabel (ep_id) : INVALID_LABEL ;
21012102 info.hnswInfo .visitedNodesPoolSize = this ->visitedNodesHandlerPool .getPoolSize ();
21022103 info.hnswInfo .numberOfMarkedDeletedNodes = this ->getNumMarkedDeleted ();
21032104 return info;
@@ -2112,11 +2113,11 @@ VecSimIndexBasicInfo HNSWIndex<DataType, DistType>::basicInfo() const {
21122113}
21132114
21142115template <typename DataType, typename DistType>
2115- VecSimInfoIterator *HNSWIndex<DataType, DistType>::infoIterator () const {
2116- VecSimIndexInfo info = this ->info ();
2116+ VecSimDebugInfoIterator *HNSWIndex<DataType, DistType>::debugInfoIterator () const {
2117+ VecSimIndexDebugInfo info = this ->debugInfo ();
21172118 // For readability. Update this number when needed.
21182119 size_t numberOfInfoFields = 17 ;
2119- VecSimInfoIterator *infoIterator = new VecSimInfoIterator (numberOfInfoFields, this ->allocator );
2120+ auto *infoIterator = new VecSimDebugInfoIterator (numberOfInfoFields, this ->allocator );
21202121
21212122 infoIterator->addInfoField (
21222123 VecSim_InfoField{.fieldName = VecSimCommonStrings::ALGORITHM_STRING,
0 commit comments