mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 04:49:08 +08:00
d599407e2b
Signed-off-by: xige-16 <xi.ge@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)
|
|
}
|