enhance: Opt maxVectorFieldNum param check (#30440)

Signed-off-by: xige-16 <xi.ge@zilliz.com>

---------

Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
xige-16 2024-02-02 14:51:05 +08:00 committed by GitHub
parent ec688f5bf6
commit 6d7061824b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1111,18 +1111,16 @@ So adjust at your risk!`,
Key: "proxy.maxVectorFieldNum",
Version: "2.4.0",
DefaultValue: "4",
Formatter: func(v string) string {
if getAsInt(v) > 10 {
return "10"
}
return v
},
PanicIfEmpty: true,
Doc: "Maximum number of vector fields in a collection.",
Export: true,
}
p.MaxVectorFieldNum.Init(base.mgr)
if p.MaxVectorFieldNum.GetAsInt() > 10 || p.MaxVectorFieldNum.GetAsInt() <= 0 {
panic(fmt.Sprintf("Maximum number of vector fields in a collection should be in (0, 10], not %d", p.MaxVectorFieldNum.GetAsInt()))
}
p.MaxShardNum = ParamItem{
Key: "proxy.maxShardNum",
DefaultValue: "16",