2022-10-19 16:55:27 +08:00
|
|
|
package metautil
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path"
|
|
|
|
|
2023-04-06 19:14:32 +08:00
|
|
|
"github.com/milvus-io/milvus/pkg/common"
|
2022-10-19 16:55:27 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func BuildSegmentIndexFilePath(rootPath string, buildID, indexVersion, partID, segID int64, fileKey string) string {
|
|
|
|
k := JoinIDPath(buildID, indexVersion, partID, segID)
|
|
|
|
return path.Join(rootPath, common.SegmentIndexPath, k, fileKey)
|
|
|
|
}
|
|
|
|
|
|
|
|
func BuildSegmentIndexFilePaths(rootPath string, buildID, indexVersion, partID, segID int64, fileKeys []string) []string {
|
|
|
|
paths := make([]string, 0, len(fileKeys))
|
|
|
|
for _, fileKey := range fileKeys {
|
|
|
|
path := BuildSegmentIndexFilePath(rootPath, buildID, indexVersion, partID, segID, fileKey)
|
|
|
|
paths = append(paths, path)
|
|
|
|
}
|
|
|
|
return paths
|
|
|
|
}
|