Skip to content

Commit 450c9a4

Browse files
committed
Add isDisk flag to VecSimIndexBasicInfo
1 parent cd722bf commit 450c9a4

File tree

6 files changed

+9
-2
lines changed

6 files changed

+9
-2
lines changed

src/VecSim/algorithms/hnsw/hnsw_tiered.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,8 +1182,7 @@ VecSimDebugInfoIterator *TieredHNSWIndex<DataType, DistType>::debugInfoIterator(
11821182

11831183
template <typename DataType, typename DistType>
11841184
VecSimIndexBasicInfo TieredHNSWIndex<DataType, DistType>::basicInfo() const {
1185-
VecSimIndexBasicInfo info = this->backendIndex->getBasicInfo();
1186-
info.blockSize = info.blockSize;
1185+
VecSimIndexBasicInfo info = this->backendIndex->basicInfo();
11871186
info.isTiered = true;
11881187
info.algo = VecSimAlgo_HNSWLIB;
11891188
return info;

src/VecSim/utils/vec_utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const char *VecSimCommonStrings::DIMENSION_STRING = "DIMENSION";
4444
const char *VecSimCommonStrings::INDEX_SIZE_STRING = "INDEX_SIZE";
4545
const char *VecSimCommonStrings::INDEX_LABEL_COUNT_STRING = "INDEX_LABEL_COUNT";
4646
const char *VecSimCommonStrings::IS_MULTI_STRING = "IS_MULTI_VALUE";
47+
const char *VecSimCommonStrings::IS_DISK_STRING = "IS_DISK";
4748
const char *VecSimCommonStrings::MEMORY_STRING = "MEMORY";
4849

4950
const char *VecSimCommonStrings::HNSW_EF_RUNTIME_STRING = "EF_RUNTIME";

src/VecSim/utils/vec_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct VecSimCommonStrings {
4444
static const char *INDEX_SIZE_STRING;
4545
static const char *INDEX_LABEL_COUNT_STRING;
4646
static const char *IS_MULTI_STRING;
47+
static const char *IS_DISK_STRING;
4748
static const char *MEMORY_STRING;
4849

4950
static const char *HNSW_EF_RUNTIME_STRING;

src/VecSim/vec_sim_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ typedef struct {
327327
VecSimType type; // Datatype the index holds.
328328
bool isMulti; // Determines if the index should multi-index or not.
329329
bool isTiered; // Is the index is tiered or not.
330+
bool isDisk; // Is the index stored on disk.
330331
size_t blockSize; // Brute force algorithm vector block (mini matrix) size
331332
size_t dim; // Vector size (dimension).
332333
} VecSimIndexBasicInfo;

src/VecSim/vec_sim_index.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ struct VecSimIndexAbstract : public VecSimIndexInterface {
243243
VecSim_InfoField{.fieldName = VecSimCommonStrings::IS_MULTI_STRING,
244244
.fieldType = INFOFIELD_UINT64,
245245
.fieldValue = {FieldValue{.uintegerValue = info.basicInfo.isMulti}}});
246+
infoIterator->addInfoField(
247+
VecSim_InfoField{.fieldName = VecSimCommonStrings::IS_DISK_STRING,
248+
.fieldType = INFOFIELD_UINT64,
249+
.fieldValue = {FieldValue{.uintegerValue = info.basicInfo.isDisk}}});
246250
infoIterator->addInfoField(
247251
VecSim_InfoField{.fieldName = VecSimCommonStrings::INDEX_SIZE_STRING,
248252
.fieldType = INFOFIELD_UINT64,

src/VecSim/vec_sim_tiered_index.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ VecSimIndexDebugInfo VecSimTieredIndex<DataType, DistType>::debugInfo() const {
360360
.type = backendInfo.commonInfo.basicInfo.type,
361361
.isMulti = this->backendIndex->isMultiValue(),
362362
.isTiered = true,
363+
.isDisk = backendInfo.commonInfo.basicInfo.isDisk,
363364
.blockSize = backendInfo.commonInfo.basicInfo.blockSize,
364365
.dim = backendInfo.commonInfo.basicInfo.dim,
365366
};

0 commit comments

Comments
 (0)