mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
36 lines
643 B
Go
36 lines
643 B
Go
package reader
|
|
|
|
import (
|
|
"context"
|
|
"github.com/zilliztech/milvus-distributed/internal/msgclient"
|
|
"log"
|
|
"sync"
|
|
)
|
|
|
|
func StartQueryNode(ctx context.Context, pulsarURL string) {
|
|
mc := msgclient.ReaderMessageClient{}
|
|
mc.InitClient(ctx, pulsarURL)
|
|
|
|
mc.ReceiveMessage()
|
|
qn := CreateQueryNode(ctx, 0, 0, &mc)
|
|
|
|
// Segments Services
|
|
go qn.SegmentManagementService()
|
|
go qn.SegmentStatisticService()
|
|
|
|
wg := sync.WaitGroup{}
|
|
err := qn.InitFromMeta()
|
|
|
|
if err != nil {
|
|
log.Printf("Init query node from meta failed")
|
|
return
|
|
}
|
|
|
|
wg.Add(3)
|
|
go qn.RunMetaService(&wg)
|
|
go qn.RunInsertDelete(&wg)
|
|
go qn.RunSearch(&wg)
|
|
wg.Wait()
|
|
qn.Close()
|
|
}
|