Skip to content

Commit

Permalink
enhance: Remove deprecated EnableIndex (milvus-io#32704)
Browse files Browse the repository at this point in the history
/kind improvement

Signed-off-by: bigsheeper <[email protected]>
  • Loading branch information
bigsheeper committed May 7, 2024
1 parent 49b760f commit 0bf6e95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/querycoordv2/meta/coordinator_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (broker *CoordinatorBroker) GetIndexInfo(ctx context.Context, collectionID
for _, info := range segmentInfo.GetIndexInfos() {
indexes = append(indexes, &querypb.FieldIndexInfo{
FieldID: info.GetFieldID(),
EnableIndex: true,
EnableIndex: true, // deprecated, but keep it for compatibility
IndexName: info.GetIndexName(),
IndexID: info.GetIndexID(),
BuildID: info.GetBuildID(),
Expand Down
2 changes: 0 additions & 2 deletions internal/querynodev2/segments/mock_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@ func GenAndSaveIndexV2(collectionID, partitionID, segmentID, buildID int64,

return &querypb.FieldIndexInfo{
FieldID: fieldSchema.GetFieldID(),
EnableIndex: true,
IndexName: indexInfo.GetIndexName(),
IndexParams: indexInfo.GetIndexParams(),
IndexFilePaths: indexPaths,
Expand Down Expand Up @@ -1136,7 +1135,6 @@ func GenAndSaveIndex(collectionID, partitionID, segmentID, fieldID int64, msgLen

return &querypb.FieldIndexInfo{
FieldID: fieldID,
EnableIndex: true,
IndexName: "querynode-test",
IndexParams: funcutil.Map2KeyValuePair(indexParams),
IndexFilePaths: indexPaths,
Expand Down
2 changes: 1 addition & 1 deletion internal/querynodev2/segments/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ func (s *LocalSegment) ExistIndex(fieldID int64) bool {
if !ok {
return false
}
return fieldInfo.IndexInfo != nil && fieldInfo.IndexInfo.EnableIndex
return fieldInfo.IndexInfo != nil
}

func (s *LocalSegment) HasRawData(fieldID int64) bool {
Expand Down
6 changes: 2 additions & 4 deletions internal/querynodev2/segments/segment_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1508,10 +1508,8 @@ func getResourceUsageEstimateOfSegment(schema *schemapb.CollectionSchema, loadIn

vecFieldID2IndexInfo := make(map[int64]*querypb.FieldIndexInfo)
for _, fieldIndexInfo := range loadInfo.IndexInfos {
if fieldIndexInfo.EnableIndex {
fieldID := fieldIndexInfo.FieldID
vecFieldID2IndexInfo[fieldID] = fieldIndexInfo
}
fieldID := fieldIndexInfo.FieldID
vecFieldID2IndexInfo[fieldID] = fieldIndexInfo
}

for _, fieldBinlog := range loadInfo.BinlogPaths {
Expand Down

0 comments on commit 0bf6e95

Please sign in to comment.