mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
enhance: Refine param init for MmapDirPath (#35181)
Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
parent
95462668ca
commit
3b735b4b02
@ -173,13 +173,6 @@ func InitRemoteChunkManager(params *paramtable.ComponentParam) error {
|
|||||||
|
|
||||||
func InitMmapManager(params *paramtable.ComponentParam) error {
|
func InitMmapManager(params *paramtable.ComponentParam) error {
|
||||||
mmapDirPath := params.QueryNodeCfg.MmapDirPath.GetValue()
|
mmapDirPath := params.QueryNodeCfg.MmapDirPath.GetValue()
|
||||||
if len(mmapDirPath) == 0 {
|
|
||||||
paramtable.Get().Save(
|
|
||||||
paramtable.Get().QueryNodeCfg.MmapDirPath.Key,
|
|
||||||
path.Join(paramtable.Get().LocalStorageCfg.Path.GetValue(), "mmap"),
|
|
||||||
)
|
|
||||||
mmapDirPath = paramtable.Get().QueryNodeCfg.MmapDirPath.GetValue()
|
|
||||||
}
|
|
||||||
cMmapChunkManagerDir := C.CString(path.Join(mmapDirPath, "/mmap_chunk_manager/"))
|
cMmapChunkManagerDir := C.CString(path.Join(mmapDirPath, "/mmap_chunk_manager/"))
|
||||||
cCacheReadAheadPolicy := C.CString(params.QueryNodeCfg.ReadAheadPolicy.GetValue())
|
cCacheReadAheadPolicy := C.CString(params.QueryNodeCfg.ReadAheadPolicy.GetValue())
|
||||||
defer C.free(unsafe.Pointer(cMmapChunkManagerDir))
|
defer C.free(unsafe.Pointer(cMmapChunkManagerDir))
|
||||||
|
|||||||
@ -19,6 +19,7 @@ package paramtable
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@ -2496,6 +2497,12 @@ This defaults to true, indicating that Milvus creates temporary index for growin
|
|||||||
DefaultValue: "",
|
DefaultValue: "",
|
||||||
FallbackKeys: []string{"queryNode.mmapDirPath"},
|
FallbackKeys: []string{"queryNode.mmapDirPath"},
|
||||||
Doc: "The folder that storing data files for mmap, setting to a path will enable Milvus to load data with mmap",
|
Doc: "The folder that storing data files for mmap, setting to a path will enable Milvus to load data with mmap",
|
||||||
|
Formatter: func(v string) string {
|
||||||
|
if len(v) == 0 {
|
||||||
|
return path.Join(base.Get("localStorage.path"), "mmap")
|
||||||
|
}
|
||||||
|
return v
|
||||||
|
},
|
||||||
}
|
}
|
||||||
p.MmapDirPath.Init(base.mgr)
|
p.MmapDirPath.Init(base.mgr)
|
||||||
|
|
||||||
|
|||||||
@ -443,6 +443,7 @@ func TestComponentParam(t *testing.T) {
|
|||||||
assert.Equal(t, 3*time.Second, Params.LazyLoadRequestResourceRetryInterval.GetAsDuration(time.Millisecond))
|
assert.Equal(t, 3*time.Second, Params.LazyLoadRequestResourceRetryInterval.GetAsDuration(time.Millisecond))
|
||||||
|
|
||||||
assert.Equal(t, 4, Params.BloomFilterApplyParallelFactor.GetAsInt())
|
assert.Equal(t, 4, Params.BloomFilterApplyParallelFactor.GetAsInt())
|
||||||
|
assert.Equal(t, "/var/lib/milvus/data/mmap", Params.MmapDirPath.GetValue())
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("test dataCoordConfig", func(t *testing.T) {
|
t.Run("test dataCoordConfig", func(t *testing.T) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user