mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
f02bd8c8f5
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
37 lines
942 B
Go
37 lines
942 B
Go
package querynode
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
|
|
)
|
|
|
|
func TestLoadIndexInfo(t *testing.T) {
|
|
indexParams := make([]*commonpb.KeyValuePair, 0)
|
|
indexParams = append(indexParams, &commonpb.KeyValuePair{
|
|
Key: "index_type",
|
|
Value: "IVF_PQ",
|
|
})
|
|
indexParams = append(indexParams, &commonpb.KeyValuePair{
|
|
Key: "index_mode",
|
|
Value: "cpu",
|
|
})
|
|
|
|
indexBytes := make([][]byte, 0)
|
|
indexValue := make([]byte, 10)
|
|
indexBytes = append(indexBytes, indexValue)
|
|
indexPaths := make([]string, 0)
|
|
indexPaths = append(indexPaths, "index-0")
|
|
|
|
loadIndexInfo, err := newLoadIndexInfo()
|
|
assert.Nil(t, err)
|
|
for _, indexParam := range indexParams {
|
|
loadIndexInfo.appendIndexParam(indexParam.Key, indexParam.Value)
|
|
}
|
|
loadIndexInfo.appendFieldInfo("field0", 0)
|
|
loadIndexInfo.appendIndex(indexBytes, indexPaths)
|
|
|
|
deleteLoadIndexInfo(loadIndexInfo)
|
|
}
|