mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
Make NewMeta private (#9057)
Signed-off-by: godchen <qingxiang.chen@zilliz.com>
This commit is contained in:
parent
1315fa278d
commit
f18e0628ae
@ -38,7 +38,7 @@ type meta struct {
|
||||
}
|
||||
|
||||
// NewMeta create meta from provided `kv.TxnKV`
|
||||
func NewMeta(kv kv.TxnKV) (*meta, error) {
|
||||
func newMeta(kv kv.TxnKV) (*meta, error) {
|
||||
mt := &meta{
|
||||
client: kv,
|
||||
collections: make(map[UniqueID]*datapb.CollectionInfo),
|
||||
|
@ -124,14 +124,14 @@ func TestMeta_Basic(t *testing.T) {
|
||||
// inject error for `Save`
|
||||
memoryKV := memkv.NewMemoryKV()
|
||||
fkv := &saveFailKV{TxnKV: memoryKV}
|
||||
meta, err := NewMeta(fkv)
|
||||
meta, err := newMeta(fkv)
|
||||
assert.Nil(t, err)
|
||||
|
||||
err = meta.AddSegment(NewSegmentInfo(&datapb.SegmentInfo{}))
|
||||
assert.NotNil(t, err)
|
||||
|
||||
fkv2 := &removeFailKV{TxnKV: memoryKV}
|
||||
meta, err = NewMeta(fkv2)
|
||||
meta, err = newMeta(fkv2)
|
||||
assert.Nil(t, err)
|
||||
// nil, since no segment yet
|
||||
err = meta.DropSegment(0)
|
||||
|
@ -34,7 +34,7 @@ import (
|
||||
|
||||
func newMemoryMeta(allocator allocator) (*meta, error) {
|
||||
memoryKV := memkv.NewMemoryKV()
|
||||
return NewMeta(memoryKV)
|
||||
return newMeta(memoryKV)
|
||||
}
|
||||
|
||||
var _ allocator = (*MockAllocator)(nil)
|
||||
|
@ -397,7 +397,7 @@ func TestTryToSealSegment(t *testing.T) {
|
||||
mockAllocator := newMockAllocator()
|
||||
memoryKV := memkv.NewMemoryKV()
|
||||
fkv := &saveFailKV{TxnKV: memoryKV}
|
||||
meta, err := NewMeta(memoryKV)
|
||||
meta, err := newMeta(memoryKV)
|
||||
|
||||
assert.Nil(t, err)
|
||||
|
||||
@ -423,7 +423,7 @@ func TestTryToSealSegment(t *testing.T) {
|
||||
mockAllocator := newMockAllocator()
|
||||
memoryKV := memkv.NewMemoryKV()
|
||||
fkv := &saveFailKV{TxnKV: memoryKV}
|
||||
meta, err := NewMeta(memoryKV)
|
||||
meta, err := newMeta(memoryKV)
|
||||
|
||||
assert.Nil(t, err)
|
||||
|
||||
|
@ -287,7 +287,7 @@ func (s *Server) initMeta() error {
|
||||
}
|
||||
|
||||
s.kvClient = etcdKV
|
||||
s.meta, err = NewMeta(s.kvClient)
|
||||
s.meta, err = newMeta(s.kvClient)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user