milvus/internal/reader/result.go
zhenshan.cao e962b57fbb Add timestamp allocator
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
2020-11-03 14:53:36 +08:00

42 lines
1.1 KiB
Go

package reader
import (
"context"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb"
msgpb "github.com/zilliztech/milvus-distributed/internal/proto/message"
)
type ResultEntityIds []int64
type SearchResult struct {
ResultIds []int64
ResultDistances []float32
}
func (node *QueryNode) PublishSearchResult(results *msgpb.QueryResult) commonpb.Status {
var ctx = context.Background()
node.messageClient.SendResult(ctx, *results, results.ProxyId)
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
}
func (node *QueryNode) PublishFailedSearchResult() commonpb.Status {
var results = msgpb.QueryResult{}
var ctx = context.Background()
node.messageClient.SendResult(ctx, results, results.ProxyId)
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
}
func (node *QueryNode) PublicStatistic(statisticData *[]internalpb.SegmentStatistics) commonpb.Status {
var ctx = context.Background()
node.messageClient.SendSegmentsStatistic(ctx, statisticData)
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
}