Skip to content

Commit 70254c3

Browse files
jiangke-srkejiang
andauthored
Unified catalog interface for segment (milvus-io#18289) (milvus-io#18290)
Signed-off-by: kejiang <[email protected]> Signed-off-by: kejiang <[email protected]> Co-authored-by: kejiang <[email protected]>
1 parent fc42ee5 commit 70254c3

30 files changed

+894
-261
lines changed

internal/datacoord/compaction_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"time"
2323

2424
memkv "github.com/milvus-io/milvus/internal/kv/mem"
25+
"github.com/milvus-io/milvus/internal/metastore/kv/datacoord"
2526
"github.com/milvus-io/milvus/internal/proto/datapb"
2627
"github.com/milvus-io/milvus/internal/util/tsoutil"
2728
"github.com/stretchr/testify/assert"
@@ -153,7 +154,7 @@ func Test_compactionPlanHandler_completeCompaction(t *testing.T) {
153154
},
154155
nil,
155156
&meta{
156-
client: memkv.NewMemoryKV(),
157+
catalog: &datacoord.Catalog{Txn: memkv.NewMemoryKV()},
157158
segments: &SegmentsInfo{
158159
map[int64]*SegmentInfo{
159160
1: {SegmentInfo: &datapb.SegmentInfo{ID: 1, Binlogs: []*datapb.FieldBinlog{getFieldBinlogPaths(1, "log1")}}},
@@ -202,7 +203,7 @@ func Test_compactionPlanHandler_completeCompaction(t *testing.T) {
202203
},
203204
nil,
204205
&meta{
205-
client: memkv.NewMemoryKV(),
206+
catalog: &datacoord.Catalog{Txn: memkv.NewMemoryKV()},
206207
segments: &SegmentsInfo{
207208
map[int64]*SegmentInfo{
208209

@@ -289,7 +290,7 @@ func Test_compactionPlanHandler_segment_is_referenced(t *testing.T) {
289290
},
290291
nil,
291292
&meta{
292-
client: memkv.NewMemoryKV(),
293+
catalog: &datacoord.Catalog{Txn: memkv.NewMemoryKV()},
293294
segments: &SegmentsInfo{
294295
map[int64]*SegmentInfo{
295296

internal/datacoord/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ func (h *ServerHandler) CheckShouldDropChannel(channel string) bool {
166166
}
167167
}
168168
return false*/
169-
return h.s.meta.ChannelHasRemoveFlag(channel)
169+
return h.s.meta.catalog.IsChannelDropped(h.s.ctx, channel)
170170
}
171171

172172
// FinishDropChannel cleans up the remove flag for channels
173173
// this function is a wrapper of server.meta.FinishDropChannel
174174
func (h *ServerHandler) FinishDropChannel(channel string) {
175-
h.s.meta.FinishRemoveChannel(channel)
175+
h.s.meta.catalog.DropChannel(h.s.ctx, channel)
176176
}

0 commit comments

Comments
 (0)