mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 10:08:42 +08:00
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:
parent
ec688f5bf6
commit
6d7061824b
@ -1111,18 +1111,16 @@ So adjust at your risk!`,
|
|||||||
Key: "proxy.maxVectorFieldNum",
|
Key: "proxy.maxVectorFieldNum",
|
||||||
Version: "2.4.0",
|
Version: "2.4.0",
|
||||||
DefaultValue: "4",
|
DefaultValue: "4",
|
||||||
Formatter: func(v string) string {
|
|
||||||
if getAsInt(v) > 10 {
|
|
||||||
return "10"
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
},
|
|
||||||
PanicIfEmpty: true,
|
PanicIfEmpty: true,
|
||||||
Doc: "Maximum number of vector fields in a collection.",
|
Doc: "Maximum number of vector fields in a collection.",
|
||||||
Export: true,
|
Export: true,
|
||||||
}
|
}
|
||||||
p.MaxVectorFieldNum.Init(base.mgr)
|
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{
|
p.MaxShardNum = ParamItem{
|
||||||
Key: "proxy.maxShardNum",
|
Key: "proxy.maxShardNum",
|
||||||
DefaultValue: "16",
|
DefaultValue: "16",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user