mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
ad7f3d4c3e
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
34 lines
953 B
Go
34 lines
953 B
Go
package segments
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/segcorepb"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/schemapb"
|
|
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
|
"github.com/milvus-io/milvus/internal/proto/querypb"
|
|
)
|
|
|
|
type internalReducer interface {
|
|
Reduce(context.Context, []*internalpb.RetrieveResults) (*internalpb.RetrieveResults, error)
|
|
}
|
|
|
|
func CreateInternalReducer(req *querypb.QueryRequest, schema *schemapb.CollectionSchema) internalReducer {
|
|
if req.GetReq().GetIsCount() {
|
|
return &cntReducer{}
|
|
}
|
|
return newDefaultLimitReducer(req, schema)
|
|
}
|
|
|
|
type segCoreReducer interface {
|
|
Reduce(context.Context, []*segcorepb.RetrieveResults) (*segcorepb.RetrieveResults, error)
|
|
}
|
|
|
|
func CreateSegCoreReducer(req *querypb.QueryRequest, schema *schemapb.CollectionSchema) segCoreReducer {
|
|
if req.GetReq().GetIsCount() {
|
|
return &cntReducerSegCore{}
|
|
}
|
|
return newDefaultLimitReducerSegcore(req, schema)
|
|
}
|