milvus/pkg/common/map.go
wayblink c62bf8a0b0
fix: [Cherry-pick]Pick major compaction fixs and optimizations (#34360)
This PR cherry-picks the following commits:

- fix: sync partitiion stats blocking balance task #33742
- fix: Fix meta prefix overlap bug #33830
- fix: Small fixs of major compaction #33929 
- fix: Fix memory buffer error & some renaming #33850
- fix: sync part stats task cannot be finished #34027 
- Add an option to enable/disable vector field clustering key #34097
- fix: fix error ignore in compactor #34169
- fix:load major compaction partial result #34052
- Use new stream segment reader in clustering compaction #34232

issue: #30633
pr: #33742 #33830 #33929 #33850 #34027 #34097 #34169 #34052 #34232

---------

Signed-off-by: MrPresent-Han <chun.han@zilliz.com>
Signed-off-by: wayblink <anyang.wang@zilliz.com>
Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: Chun Han <116052805+MrPresent-Han@users.noreply.github.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
2024-07-03 09:53:37 +08:00

38 lines
571 B
Go

package common
import "reflect"
type Str2Str map[string]string
func (m Str2Str) Clone() Str2Str {
if m == nil {
return nil
}
clone := make(Str2Str)
for key, value := range m {
clone[key] = value
}
return clone
}
func (m Str2Str) Equal(other Str2Str) bool {
return reflect.DeepEqual(m, other)
}
func CloneStr2Str(m Str2Str) Str2Str {
return m.Clone()
}
func MapEquals(m1, m2 map[int64]int64) bool {
if len(m1) != len(m2) {
return false
}
for k1, v1 := range m1 {
v2, exist := m2[k1]
if !exist || v1 != v2 {
return false
}
}
return true
}