未验证 提交 bec9f2c1 编写于 作者: F FluorineDog 提交者: GitHub

Split segcore and plan proto for future feature (#5767)

* Split segcore and plan proto for future feature
Signed-off-by: Nfluorinedog <fluorinedog@gmail.com>

* lint
Signed-off-by: Nfluorinedog <fluorinedog@gmail.com>
上级 cdbc6d2c
......@@ -12,7 +12,7 @@
get_property(PROTOC_EXCUTABLE GLOBAL PROPERTY PROTOC_EXCUTABLE )
set(proto_file_names common.proto etcd_meta.proto schema.proto milvus.proto index_cgo_msg.proto plan.proto)
set(proto_file_names common.proto etcd_meta.proto schema.proto milvus.proto index_cgo_msg.proto plan.proto segcore.proto)
set( PROTO_PATH "${MILVUS_SOURCE_DIR}/../proto/" )
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -480,7 +480,7 @@ GetNumOfQueries(const PlaceholderGroup* group) {
}
[[maybe_unused]] std::unique_ptr<RetrievePlan>
CreateRetrievePlan(const Schema& schema, proto::plan::RetrieveRequest&& request) {
CreateRetrievePlan(const Schema& schema, proto::segcore::RetrieveRequest&& request) {
auto plan = std::make_unique<RetrievePlan>();
plan->ids_ = std::unique_ptr<proto::schema::IDs>(request.release_ids());
for (auto& field_name : request.output_fields()) {
......
......@@ -15,6 +15,7 @@
#include <string>
#include "common/Schema.h"
#include "pb/plan.pb.h"
#include "pb/segcore.pb.h"
namespace milvus::query {
// NOTE: APIs for C wrapper
......@@ -38,7 +39,7 @@ int64_t
GetNumOfQueries(const PlaceholderGroup*);
std::unique_ptr<RetrievePlan>
CreateRetrievePlan(const Schema& schema, proto::plan::RetrieveRequest&& request);
CreateRetrievePlan(const Schema& schema, proto::segcore::RetrieveRequest&& request);
// Query Overall TopK from Plan
// Used to alloc result memory at Go side
......
......@@ -190,11 +190,11 @@ SegmentInternalInterface::BulkSubScript(FieldOffset field_offset, const SegOffse
}
}
std::unique_ptr<proto::plan::RetrieveResults>
std::unique_ptr<proto::segcore::RetrieveResults>
SegmentInternalInterface::GetEntityById(const std::vector<FieldOffset>& field_offsets,
const IdArray& id_array,
Timestamp timestamp) const {
auto results = std::make_unique<proto::plan::RetrieveResults>();
auto results = std::make_unique<proto::segcore::RetrieveResults>();
auto [ids_, seg_offsets] = search_ids(id_array, timestamp);
......
......@@ -19,6 +19,7 @@
#include "common/SystemProperty.h"
#include "query/PlanNode.h"
#include "pb/schema.pb.h"
#include "pb/segcore.pb.h"
#include <memory>
#include <vector>
#include <utility>
......@@ -40,7 +41,7 @@ class SegmentInterface {
const Timestamp timestamps[],
int64_t num_groups) const = 0;
virtual std::unique_ptr<proto::plan::RetrieveResults>
virtual std::unique_ptr<proto::segcore::RetrieveResults>
GetEntityById(const std::vector<FieldOffset>& field_offsets,
const IdArray& id_array,
Timestamp timestamp) const = 0;
......@@ -89,7 +90,7 @@ class SegmentInternalInterface : public SegmentInterface {
void
FillTargetEntry(const query::Plan* plan, QueryResult& results) const override;
std::unique_ptr<proto::plan::RetrieveResults>
std::unique_ptr<proto::segcore::RetrieveResults>
GetEntityById(const std::vector<FieldOffset>& field_offsets,
const IdArray& id_array,
Timestamp timestamp) const override;
......
......@@ -12,6 +12,7 @@
#include "segcore/plan_c.h"
#include "query/Plan.h"
#include "segcore/Collection.h"
#include "pb/segcore.pb.h"
CStatus
CreatePlan(CCollection c_col, const char* dsl, CPlan* res_plan) {
......@@ -135,7 +136,7 @@ CStatus
CreateRetrievePlan(CCollection c_col, CProto retrieve_request, CRetrievePlan* output) {
auto col = (milvus::segcore::Collection*)c_col;
try {
milvus::proto::plan::RetrieveRequest request;
milvus::proto::segcore::RetrieveRequest request;
request.ParseFromArray(retrieve_request.proto_blob, retrieve_request.proto_size);
auto plan = milvus::query::CreateRetrievePlan(*col->get_schema(), std::move(request));
*output = plan.release();
......
......@@ -88,13 +88,3 @@ message PlanNode {
VectorANNS vector_anns = 1;
}
}
message RetrieveRequest {
schema.IDs ids = 1;
repeated string output_fields = 2;
}
message RetrieveResults {
schema.IDs ids = 1;
repeated schema.FieldData fields_data = 2;
}
......@@ -777,100 +777,6 @@ func (*PlanNode) XXX_OneofWrappers() []interface{} {
}
}
type RetrieveRequest struct {
Ids *schemapb.IDs `protobuf:"bytes,1,opt,name=ids,proto3" json:"ids,omitempty"`
OutputFields []string `protobuf:"bytes,2,rep,name=output_fields,json=outputFields,proto3" json:"output_fields,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RetrieveRequest) Reset() { *m = RetrieveRequest{} }
func (m *RetrieveRequest) String() string { return proto.CompactTextString(m) }
func (*RetrieveRequest) ProtoMessage() {}
func (*RetrieveRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_2d655ab2f7683c23, []int{10}
}
func (m *RetrieveRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RetrieveRequest.Unmarshal(m, b)
}
func (m *RetrieveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RetrieveRequest.Marshal(b, m, deterministic)
}
func (m *RetrieveRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_RetrieveRequest.Merge(m, src)
}
func (m *RetrieveRequest) XXX_Size() int {
return xxx_messageInfo_RetrieveRequest.Size(m)
}
func (m *RetrieveRequest) XXX_DiscardUnknown() {
xxx_messageInfo_RetrieveRequest.DiscardUnknown(m)
}
var xxx_messageInfo_RetrieveRequest proto.InternalMessageInfo
func (m *RetrieveRequest) GetIds() *schemapb.IDs {
if m != nil {
return m.Ids
}
return nil
}
func (m *RetrieveRequest) GetOutputFields() []string {
if m != nil {
return m.OutputFields
}
return nil
}
type RetrieveResults struct {
Ids *schemapb.IDs `protobuf:"bytes,1,opt,name=ids,proto3" json:"ids,omitempty"`
FieldsData []*schemapb.FieldData `protobuf:"bytes,2,rep,name=fields_data,json=fieldsData,proto3" json:"fields_data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RetrieveResults) Reset() { *m = RetrieveResults{} }
func (m *RetrieveResults) String() string { return proto.CompactTextString(m) }
func (*RetrieveResults) ProtoMessage() {}
func (*RetrieveResults) Descriptor() ([]byte, []int) {
return fileDescriptor_2d655ab2f7683c23, []int{11}
}
func (m *RetrieveResults) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RetrieveResults.Unmarshal(m, b)
}
func (m *RetrieveResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RetrieveResults.Marshal(b, m, deterministic)
}
func (m *RetrieveResults) XXX_Merge(src proto.Message) {
xxx_messageInfo_RetrieveResults.Merge(m, src)
}
func (m *RetrieveResults) XXX_Size() int {
return xxx_messageInfo_RetrieveResults.Size(m)
}
func (m *RetrieveResults) XXX_DiscardUnknown() {
xxx_messageInfo_RetrieveResults.DiscardUnknown(m)
}
var xxx_messageInfo_RetrieveResults proto.InternalMessageInfo
func (m *RetrieveResults) GetIds() *schemapb.IDs {
if m != nil {
return m.Ids
}
return nil
}
func (m *RetrieveResults) GetFieldsData() []*schemapb.FieldData {
if m != nil {
return m.FieldsData
}
return nil
}
func init() {
proto.RegisterEnum("milvus.proto.plan.RangeExpr_OpType", RangeExpr_OpType_name, RangeExpr_OpType_value)
proto.RegisterEnum("milvus.proto.plan.UnaryExpr_UnaryOp", UnaryExpr_UnaryOp_name, UnaryExpr_UnaryOp_value)
......@@ -885,72 +791,65 @@ func init() {
proto.RegisterType((*Expr)(nil), "milvus.proto.plan.Expr")
proto.RegisterType((*VectorANNS)(nil), "milvus.proto.plan.VectorANNS")
proto.RegisterType((*PlanNode)(nil), "milvus.proto.plan.PlanNode")
proto.RegisterType((*RetrieveRequest)(nil), "milvus.proto.plan.RetrieveRequest")
proto.RegisterType((*RetrieveResults)(nil), "milvus.proto.plan.RetrieveResults")
}
func init() { proto.RegisterFile("plan.proto", fileDescriptor_2d655ab2f7683c23) }
var fileDescriptor_2d655ab2f7683c23 = []byte{
// 951 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xcf, 0xee, 0x3a, 0xc9, 0xee, 0xb3, 0xeb, 0x98, 0xb9, 0x60, 0x08, 0x25, 0xd1, 0xb6, 0x82,
0x08, 0xd4, 0x44, 0xb8, 0x25, 0x95, 0x8a, 0x0a, 0x24, 0xa4, 0x34, 0x16, 0x95, 0x13, 0x06, 0x93,
0x03, 0x97, 0xd5, 0x78, 0x77, 0x6c, 0x8f, 0x3a, 0x9e, 0xd9, 0xcc, 0xce, 0x5a, 0xf5, 0x85, 0x0b,
0x37, 0x6e, 0x7c, 0x09, 0x2e, 0x7c, 0x21, 0xee, 0x7c, 0x11, 0x34, 0x33, 0x1b, 0xff, 0x41, 0x4e,
0x50, 0xa5, 0xde, 0xde, 0xbf, 0xdf, 0xfb, 0x3f, 0x6f, 0x00, 0x72, 0x4e, 0xc4, 0x61, 0xae, 0xa4,
0x96, 0xe8, 0xbd, 0x09, 0xe3, 0xd3, 0xb2, 0x70, 0xdc, 0xa1, 0x51, 0x7c, 0xd8, 0x28, 0xd2, 0x31,
0x9d, 0x10, 0x27, 0x8a, 0x73, 0x68, 0xbc, 0xa4, 0x82, 0x2a, 0x96, 0x5e, 0x11, 0x5e, 0x52, 0xb4,
0x0b, 0xe1, 0x40, 0x4a, 0x9e, 0x4c, 0x09, 0x6f, 0x7b, 0xfb, 0xde, 0x41, 0x78, 0xbe, 0x81, 0xb7,
0x8d, 0xe4, 0x8a, 0x70, 0x74, 0x1f, 0x22, 0x26, 0xf4, 0xf1, 0x13, 0xab, 0xf5, 0xf7, 0xbd, 0x83,
0xe0, 0x7c, 0x03, 0x87, 0x56, 0x54, 0xa9, 0x87, 0x5c, 0x12, 0x6d, 0xd5, 0xc1, 0xbe, 0x77, 0xe0,
0x19, 0xb5, 0x15, 0x5d, 0x11, 0x7e, 0xba, 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0x51, 0x47, 0x4c, 0x68, 0xaa, 0x04, 0xe1, 0x47, 0xd6, 0xd5,
0x91, 0xe9, 0x5b, 0x3e, 0x18, 0x6c, 0x59, 0xee, 0xf1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6d,
0xf2, 0x58, 0xac, 0x3c, 0x08, 0x00, 0x00,
// 872 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4d, 0x6f, 0x1b, 0x37,
0x13, 0xd6, 0xee, 0xea, 0x63, 0x77, 0xa4, 0x28, 0x7a, 0x79, 0x79, 0xd5, 0xba, 0x81, 0x85, 0x4d,
0xd0, 0x0a, 0x28, 0x22, 0xa3, 0x4a, 0xea, 0x00, 0x29, 0x52, 0xd4, 0x6e, 0x82, 0xd8, 0x68, 0x20,
0xbb, 0x5b, 0xd5, 0x87, 0x5e, 0x16, 0xd4, 0x2e, 0x25, 0x11, 0xa1, 0x48, 0x9a, 0x4b, 0x09, 0xd1,
0xb9, 0xb7, 0xde, 0xfa, 0x27, 0x7a, 0xe9, 0x1f, 0xea, 0xbd, 0x7f, 0xa4, 0x20, 0xb9, 0x96, 0xac,
0x42, 0x76, 0x51, 0xa0, 0x37, 0xce, 0xf7, 0xf3, 0xcc, 0x0c, 0x07, 0x40, 0x32, 0xcc, 0x07, 0x52,
0x09, 0x2d, 0xd0, 0xff, 0x16, 0x94, 0xad, 0x96, 0x85, 0x93, 0x06, 0xc6, 0xf0, 0x71, 0xab, 0xc8,
0xe6, 0x64, 0x81, 0x9d, 0x2a, 0x96, 0xd0, 0x7a, 0x4b, 0x38, 0x51, 0x34, 0xbb, 0xc2, 0x6c, 0x49,
0xd0, 0x01, 0x84, 0x13, 0x21, 0x58, 0xba, 0xc2, 0xac, 0xeb, 0xf5, 0xbc, 0x7e, 0x78, 0x56, 0x49,
0x1a, 0x46, 0x73, 0x85, 0x19, 0x7a, 0x04, 0x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
0xf1, 0x9f, 0x1e, 0xc0, 0x15, 0xc9, 0xb4, 0x50, 0x27, 0xa3, 0xd1, 0x0f, 0xe5, 0x6d, 0x71, 0x7e,
0xee, 0x62, 0x9b, 0xdb, 0xe2, 0xb2, 0xec, 0x5c, 0x3d, 0x7f, 0xf7, 0xea, 0xbd, 0x00, 0x90, 0x8a,
0xe4, 0x34, 0xc3, 0xda, 0xfe, 0xfa, 0x7b, 0xe7, 0x77, 0xcb, 0x15, 0x7d, 0x05, 0x70, 0x6d, 0xee,
0xb7, 0xfb, 0x73, 0xd5, 0x3b, 0x1b, 0xb1, 0x39, 0xf2, 0x49, 0x74, 0xbd, 0xb9, 0xf7, 0x9f, 0xc1,
0x43, 0xc9, 0x70, 0x46, 0xe6, 0x82, 0xe5, 0x44, 0xa5, 0x1a, 0xcf, 0xba, 0x35, 0x7b, 0xbc, 0xdb,
0xb7, 0xd4, 0x63, 0x3c, 0x8b, 0xc7, 0x10, 0x5e, 0x32, 0xcc, 0x47, 0x22, 0x27, 0xa6, 0x77, 0x2b,
0x4b, 0x38, 0xc5, 0x9c, 0x17, 0xf7, 0x7c, 0xf3, 0x6d, 0x5b, 0x4c, 0xef, 0x5c, 0xcc, 0x09, 0xe7,
0x85, 0xe9, 0x1d, 0x17, 0x39, 0x39, 0x7d, 0xf6, 0xd3, 0x17, 0x33, 0xaa, 0xe7, 0xcb, 0xc9, 0x20,
0x13, 0x8b, 0x23, 0x97, 0xe0, 0x29, 0x15, 0xe5, 0xeb, 0x88, 0x72, 0x4d, 0x14, 0xc7, 0xec, 0xc8,
0xe6, 0x3c, 0x32, 0x39, 0xe5, 0x64, 0x52, 0xb7, 0xd2, 0xb3, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff,
0x11, 0x2c, 0xa8, 0xdc, 0x58, 0x07, 0x00, 0x00,
}
syntax = "proto3";
package milvus.proto.plan;
package milvus.proto.segcore;
option go_package = "github.com/milvus-io/milvus/internal/proto/cgo";
option go_package = "github.com/milvus-io/milvus/internal/proto/segcorepb";
import "schema.proto";
message RetrieveRequest {
schema.IDs ids = 1;
repeated string output_fields = 2;
}
message RetrieveResults {
schema.IDs ids = 1;
repeated schema.FieldData fields_data = 2;
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: segcore.proto
package segcorepb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
schemapb "github.com/milvus-io/milvus/internal/proto/schemapb"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type RetrieveRequest struct {
Ids *schemapb.IDs `protobuf:"bytes,1,opt,name=ids,proto3" json:"ids,omitempty"`
OutputFields []string `protobuf:"bytes,2,rep,name=output_fields,json=outputFields,proto3" json:"output_fields,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RetrieveRequest) Reset() { *m = RetrieveRequest{} }
func (m *RetrieveRequest) String() string { return proto.CompactTextString(m) }
func (*RetrieveRequest) ProtoMessage() {}
func (*RetrieveRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_1d79fce784797357, []int{0}
}
func (m *RetrieveRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RetrieveRequest.Unmarshal(m, b)
}
func (m *RetrieveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RetrieveRequest.Marshal(b, m, deterministic)
}
func (m *RetrieveRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_RetrieveRequest.Merge(m, src)
}
func (m *RetrieveRequest) XXX_Size() int {
return xxx_messageInfo_RetrieveRequest.Size(m)
}
func (m *RetrieveRequest) XXX_DiscardUnknown() {
xxx_messageInfo_RetrieveRequest.DiscardUnknown(m)
}
var xxx_messageInfo_RetrieveRequest proto.InternalMessageInfo
func (m *RetrieveRequest) GetIds() *schemapb.IDs {
if m != nil {
return m.Ids
}
return nil
}
func (m *RetrieveRequest) GetOutputFields() []string {
if m != nil {
return m.OutputFields
}
return nil
}
type RetrieveResults struct {
Ids *schemapb.IDs `protobuf:"bytes,1,opt,name=ids,proto3" json:"ids,omitempty"`
FieldsData []*schemapb.FieldData `protobuf:"bytes,2,rep,name=fields_data,json=fieldsData,proto3" json:"fields_data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RetrieveResults) Reset() { *m = RetrieveResults{} }
func (m *RetrieveResults) String() string { return proto.CompactTextString(m) }
func (*RetrieveResults) ProtoMessage() {}
func (*RetrieveResults) Descriptor() ([]byte, []int) {
return fileDescriptor_1d79fce784797357, []int{1}
}
func (m *RetrieveResults) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RetrieveResults.Unmarshal(m, b)
}
func (m *RetrieveResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RetrieveResults.Marshal(b, m, deterministic)
}
func (m *RetrieveResults) XXX_Merge(src proto.Message) {
xxx_messageInfo_RetrieveResults.Merge(m, src)
}
func (m *RetrieveResults) XXX_Size() int {
return xxx_messageInfo_RetrieveResults.Size(m)
}
func (m *RetrieveResults) XXX_DiscardUnknown() {
xxx_messageInfo_RetrieveResults.DiscardUnknown(m)
}
var xxx_messageInfo_RetrieveResults proto.InternalMessageInfo
func (m *RetrieveResults) GetIds() *schemapb.IDs {
if m != nil {
return m.Ids
}
return nil
}
func (m *RetrieveResults) GetFieldsData() []*schemapb.FieldData {
if m != nil {
return m.FieldsData
}
return nil
}
func init() {
proto.RegisterType((*RetrieveRequest)(nil), "milvus.proto.segcore.RetrieveRequest")
proto.RegisterType((*RetrieveResults)(nil), "milvus.proto.segcore.RetrieveResults")
}
func init() { proto.RegisterFile("segcore.proto", fileDescriptor_1d79fce784797357) }
var fileDescriptor_1d79fce784797357 = []byte{
// 222 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xb1, 0x4b, 0xc4, 0x30,
0x14, 0xc6, 0x39, 0x0f, 0x04, 0xd3, 0x3b, 0x84, 0xe2, 0x50, 0x1c, 0xe4, 0x38, 0x97, 0x43, 0x30,
0x81, 0x2a, 0xae, 0x82, 0x14, 0xc1, 0x35, 0xa3, 0x4b, 0x49, 0xda, 0x67, 0x1b, 0x48, 0x9b, 0x9a,
0xf7, 0xd2, 0xd1, 0xbf, 0x5d, 0x9a, 0x74, 0x50, 0x70, 0x71, 0xfb, 0xf2, 0x25, 0xbf, 0xef, 0x07,
0x61, 0x7b, 0x84, 0xae, 0x71, 0x1e, 0xf8, 0xe4, 0x1d, 0xb9, 0xfc, 0x6a, 0x30, 0x76, 0x0e, 0x98,
0x4e, 0x7c, 0xbd, 0xbb, 0xde, 0x61, 0xd3, 0xc3, 0xa0, 0x52, 0x7b, 0xd4, 0xec, 0x52, 0x02, 0x79,
0x03, 0x33, 0x48, 0xf8, 0x0c, 0x80, 0x94, 0xdf, 0xb1, 0xad, 0x69, 0xb1, 0xd8, 0x1c, 0x36, 0xa7,
0xac, 0x2c, 0xf8, 0xef, 0x91, 0xc4, 0xbe, 0x55, 0x28, 0x97, 0x47, 0xf9, 0x2d, 0xdb, 0xbb, 0x40,
0x53, 0xa0, 0xfa, 0xc3, 0x80, 0x6d, 0xb1, 0x38, 0x3b, 0x6c, 0x4f, 0x17, 0x72, 0x97, 0xca, 0xd7,
0xd8, 0x1d, 0xbf, 0x7e, 0x3a, 0x30, 0x58, 0xc2, 0x7f, 0x39, 0x9e, 0x59, 0x96, 0xc6, 0xeb, 0x56,
0x91, 0x8a, 0x86, 0xac, 0xbc, 0xf9, 0x93, 0x89, 0xc2, 0x4a, 0x91, 0x92, 0x2c, 0x21, 0x4b, 0x7e,
0x79, 0x7a, 0x7f, 0xec, 0x0c, 0xf5, 0x41, 0xf3, 0xc6, 0x0d, 0x22, 0x71, 0xf7, 0xc6, 0xad, 0x49,
0x98, 0x91, 0xc0, 0x8f, 0xca, 0x8a, 0x38, 0x25, 0xd6, 0x7f, 0x9a, 0xb4, 0x3e, 0x8f, 0xc5, 0xc3,
0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0xbc, 0x2b, 0xca, 0x57, 0x01, 0x00, 0x00,
}
......@@ -24,7 +24,7 @@ import (
"errors"
"unsafe"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
)
type Plan struct {
......@@ -110,7 +110,7 @@ type RetrievePlan struct {
Timestamp uint64
}
func createRetrievePlan(col *Collection, msg *planpb.RetrieveRequest, timestamp uint64) (*RetrievePlan, error) {
func createRetrievePlan(col *Collection, msg *segcorepb.RetrieveRequest, timestamp uint64) (*RetrievePlan, error) {
protoCGo, err := MarshalForCGo(msg)
if err != nil {
return nil, err
......
......@@ -27,7 +27,7 @@ import (
"github.com/milvus-io/milvus/internal/msgstream"
"github.com/milvus-io/milvus/internal/proto/commonpb"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
"github.com/milvus-io/milvus/internal/util/trace"
"github.com/milvus-io/milvus/internal/util/tsoutil"
)
......@@ -317,15 +317,15 @@ func (rc *retrieveCollection) doUnsolvedMsgRetrieve() {
}
}
func mergeRetrieveResults(dataArr []*planpb.RetrieveResults) (*planpb.RetrieveResults, error) {
var final *planpb.RetrieveResults
func mergeRetrieveResults(dataArr []*segcorepb.RetrieveResults) (*segcorepb.RetrieveResults, error) {
var final *segcorepb.RetrieveResults
for _, data := range dataArr {
if data == nil {
continue
}
if final == nil {
final = proto.Clone(data).(*planpb.RetrieveResults)
final = proto.Clone(data).(*segcorepb.RetrieveResults)
continue
}
......@@ -360,7 +360,7 @@ func (rc *retrieveCollection) retrieve(retrieveMsg *msgstream.RetrieveMsg) error
return err
}
req := &planpb.RetrieveRequest{
req := &segcorepb.RetrieveRequest{
Ids: retrieveMsg.Ids,
OutputFields: retrieveMsg.OutputFields,
}
......@@ -401,7 +401,7 @@ func (rc *retrieveCollection) retrieve(retrieveMsg *msgstream.RetrieveMsg) error
}
}
var mergeList []*planpb.RetrieveResults
var mergeList []*segcorepb.RetrieveResults
for _, partitionID := range partitionIDsInHistorical {
segmentIDs, err := rc.historical.replica.getSegmentIDs(partitionID)
if err != nil {
......
......@@ -5,8 +5,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/internal/proto/schemapb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
)
func TestRetrieve_Merge(t *testing.T) {
......@@ -35,7 +35,7 @@ func TestRetrieve_Merge(t *testing.T) {
},
}
subRes := &planpb.RetrieveResults{
subRes := &segcorepb.RetrieveResults{
Ids: &schemapb.IDs{
IdField: &schemapb.IDs_IntId{
IntId: &schemapb.LongArray{
......@@ -48,7 +48,7 @@ func TestRetrieve_Merge(t *testing.T) {
col2,
},
}
finalRes, err := mergeRetrieveResults([]*planpb.RetrieveResults{subRes, subRes})
finalRes, err := mergeRetrieveResults([]*segcorepb.RetrieveResults{subRes, subRes})
assert.NoError(t, err)
println(finalRes.String())
}
......@@ -25,7 +25,6 @@ import "C"
import (
"errors"
"fmt"
"github.com/milvus-io/milvus/internal/proto/planpb"
"strconv"
"sync"
"unsafe"
......@@ -35,6 +34,7 @@ import (
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/proto/commonpb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
)
type segmentType int32
......@@ -249,9 +249,9 @@ func (s *Segment) segmentSearch(plan *Plan,
return &searchResult, nil
}
func (s *Segment) segmentGetEntityByIds(plan *RetrievePlan) (*planpb.RetrieveResults, error) {
func (s *Segment) segmentGetEntityByIds(plan *RetrievePlan) (*segcorepb.RetrieveResults, error) {
resProto := C.GetEntityByIds(s.segmentPtr, plan.RetrievePlanPtr, C.uint64_t(plan.Timestamp))
result := new(planpb.RetrieveResults)
result := new(segcorepb.RetrieveResults)
err := HandleCProtoResult(&resProto, result)
if err != nil {
return nil, err
......
......@@ -22,8 +22,8 @@ import (
"github.com/milvus-io/milvus/internal/proto/commonpb"
"github.com/milvus-io/milvus/internal/proto/milvuspb"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/internal/proto/schemapb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
)
//-------------------------------------------------------------------------------------- constructor and destructor
......@@ -145,7 +145,7 @@ func TestSegment_retrieve(t *testing.T) {
err = segment.segmentInsert(offset, &ids, &timestamps, &records)
assert.NoError(t, err)
reqIds := &planpb.RetrieveRequest{
reqIds := &segcorepb.RetrieveRequest{
Ids: &schemapb.IDs{
IdField: &schemapb.IDs_IntId{
IntId: &schemapb.LongArray{
......
......@@ -51,5 +51,6 @@ ${protoc} --go_out=plugins=grpc,paths=source_relative:./indexpb index_service.pr
${protoc} --go_out=plugins=grpc,paths=source_relative:./datapb data_service.proto
${protoc} --go_out=plugins=grpc,paths=source_relative:./querypb query_service.proto
${protoc} --go_out=plugins=grpc,paths=source_relative:./planpb plan.proto
${protoc} --go_out=plugins=grpc,paths=source_relative:./segcorepb segcore.proto
popd
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册