diff --git a/go-tipb/spfresh_search.pb.go b/go-tipb/spfresh_search.pb.go new file mode 100644 index 00000000..f0753595 --- /dev/null +++ b/go-tipb/spfresh_search.pb.go @@ -0,0 +1,1894 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: spfresh_search.proto + +package tipb + +import ( + encoding_binary "encoding/binary" + "fmt" + "io" + "math" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + + math_bits "math/bits" +) + +// 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 SPFreshSearchRequest struct { + KeyspaceId uint32 `protobuf:"varint,1,opt,name=keyspace_id,json=keyspaceId,proto3" json:"keyspace_id,omitempty"` + TableId int64 `protobuf:"varint,2,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"` + IndexId int64 `protobuf:"varint,3,opt,name=index_id,json=indexId,proto3" json:"index_id,omitempty"` + StartTs uint64 `protobuf:"varint,4,opt,name=start_ts,json=startTs,proto3" json:"start_ts,omitempty"` + TopK uint32 `protobuf:"varint,5,opt,name=top_k,json=topK,proto3" json:"top_k,omitempty"` + // query_vector_f32_le is f32 little-endian bytes, without the dims prefix. + QueryVectorF32Le []byte `protobuf:"bytes,6,opt,name=query_vector_f32_le,json=queryVectorF32Le,proto3" json:"query_vector_f32_le,omitempty"` + RequiredColumns []*ColumnInfo `protobuf:"bytes,7,rep,name=required_columns,json=requiredColumns,proto3" json:"required_columns,omitempty"` + // Optional tuning parameters. + OversampleFactor float64 `protobuf:"fixed64,8,opt,name=oversample_factor,json=oversampleFactor,proto3" json:"oversample_factor,omitempty"` + // If zero, the server uses its default base beam size. + BaseBeamSize uint32 `protobuf:"varint,9,opt,name=base_beam_size,json=baseBeamSize,proto3" json:"base_beam_size,omitempty"` + // read_only disables background fixups (split/merge) triggered by search + // observations. When enabled, the server must not enqueue fixups and should + // avoid starting any background fixup workers. + ReadOnly bool `protobuf:"varint,10,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` + // When true, the server populates SPFreshSearchRow.distance in each result row. + NeedDistance bool `protobuf:"varint,11,opt,name=need_distance,json=needDistance,proto3" json:"need_distance,omitempty"` +} + +func (m *SPFreshSearchRequest) Reset() { *m = SPFreshSearchRequest{} } +func (m *SPFreshSearchRequest) String() string { return proto.CompactTextString(m) } +func (*SPFreshSearchRequest) ProtoMessage() {} +func (*SPFreshSearchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f72e9c11973690fb, []int{0} +} +func (m *SPFreshSearchRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SPFreshSearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SPFreshSearchRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SPFreshSearchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SPFreshSearchRequest.Merge(m, src) +} +func (m *SPFreshSearchRequest) XXX_Size() int { + return m.Size() +} +func (m *SPFreshSearchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SPFreshSearchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SPFreshSearchRequest proto.InternalMessageInfo + +func (m *SPFreshSearchRequest) GetKeyspaceId() uint32 { + if m != nil { + return m.KeyspaceId + } + return 0 +} + +func (m *SPFreshSearchRequest) GetTableId() int64 { + if m != nil { + return m.TableId + } + return 0 +} + +func (m *SPFreshSearchRequest) GetIndexId() int64 { + if m != nil { + return m.IndexId + } + return 0 +} + +func (m *SPFreshSearchRequest) GetStartTs() uint64 { + if m != nil { + return m.StartTs + } + return 0 +} + +func (m *SPFreshSearchRequest) GetTopK() uint32 { + if m != nil { + return m.TopK + } + return 0 +} + +func (m *SPFreshSearchRequest) GetQueryVectorF32Le() []byte { + if m != nil { + return m.QueryVectorF32Le + } + return nil +} + +func (m *SPFreshSearchRequest) GetRequiredColumns() []*ColumnInfo { + if m != nil { + return m.RequiredColumns + } + return nil +} + +func (m *SPFreshSearchRequest) GetOversampleFactor() float64 { + if m != nil { + return m.OversampleFactor + } + return 0 +} + +func (m *SPFreshSearchRequest) GetBaseBeamSize() uint32 { + if m != nil { + return m.BaseBeamSize + } + return 0 +} + +func (m *SPFreshSearchRequest) GetReadOnly() bool { + if m != nil { + return m.ReadOnly + } + return false +} + +func (m *SPFreshSearchRequest) GetNeedDistance() bool { + if m != nil { + return m.NeedDistance + } + return false +} + +type SPFreshSearchResponse struct { + Rows []*SPFreshSearchRow `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"` + Stats *SPFreshSearchStats `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"` +} + +func (m *SPFreshSearchResponse) Reset() { *m = SPFreshSearchResponse{} } +func (m *SPFreshSearchResponse) String() string { return proto.CompactTextString(m) } +func (*SPFreshSearchResponse) ProtoMessage() {} +func (*SPFreshSearchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f72e9c11973690fb, []int{1} +} +func (m *SPFreshSearchResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SPFreshSearchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SPFreshSearchResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SPFreshSearchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SPFreshSearchResponse.Merge(m, src) +} +func (m *SPFreshSearchResponse) XXX_Size() int { + return m.Size() +} +func (m *SPFreshSearchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SPFreshSearchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SPFreshSearchResponse proto.InternalMessageInfo + +func (m *SPFreshSearchResponse) GetRows() []*SPFreshSearchRow { + if m != nil { + return m.Rows + } + return nil +} + +func (m *SPFreshSearchResponse) GetStats() *SPFreshSearchStats { + if m != nil { + return m.Stats + } + return nil +} + +type SPFreshSearchRow struct { + HandleBytes []byte `protobuf:"bytes,1,opt,name=handle_bytes,json=handleBytes,proto3" json:"handle_bytes,omitempty"` + Distance float32 `protobuf:"fixed32,2,opt,name=distance,proto3" json:"distance,omitempty"` + ColumnValues [][]byte `protobuf:"bytes,3,rep,name=column_values,json=columnValues,proto3" json:"column_values,omitempty"` +} + +func (m *SPFreshSearchRow) Reset() { *m = SPFreshSearchRow{} } +func (m *SPFreshSearchRow) String() string { return proto.CompactTextString(m) } +func (*SPFreshSearchRow) ProtoMessage() {} +func (*SPFreshSearchRow) Descriptor() ([]byte, []int) { + return fileDescriptor_f72e9c11973690fb, []int{2} +} +func (m *SPFreshSearchRow) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SPFreshSearchRow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SPFreshSearchRow.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SPFreshSearchRow) XXX_Merge(src proto.Message) { + xxx_messageInfo_SPFreshSearchRow.Merge(m, src) +} +func (m *SPFreshSearchRow) XXX_Size() int { + return m.Size() +} +func (m *SPFreshSearchRow) XXX_DiscardUnknown() { + xxx_messageInfo_SPFreshSearchRow.DiscardUnknown(m) +} + +var xxx_messageInfo_SPFreshSearchRow proto.InternalMessageInfo + +func (m *SPFreshSearchRow) GetHandleBytes() []byte { + if m != nil { + return m.HandleBytes + } + return nil +} + +func (m *SPFreshSearchRow) GetDistance() float32 { + if m != nil { + return m.Distance + } + return 0 +} + +func (m *SPFreshSearchRow) GetColumnValues() [][]byte { + if m != nil { + return m.ColumnValues + } + return nil +} + +type SPFreshSearchStats struct { + PartitionsScanned uint64 `protobuf:"varint,1,opt,name=partitions_scanned,json=partitionsScanned,proto3" json:"partitions_scanned,omitempty"` + VectorsScanned uint64 `protobuf:"varint,2,opt,name=vectors_scanned,json=vectorsScanned,proto3" json:"vectors_scanned,omitempty"` + TableLookupKeys uint64 `protobuf:"varint,3,opt,name=table_lookup_keys,json=tableLookupKeys,proto3" json:"table_lookup_keys,omitempty"` + TableLookupBytes uint64 `protobuf:"varint,4,opt,name=table_lookup_bytes,json=tableLookupBytes,proto3" json:"table_lookup_bytes,omitempty"` + // Time costs of each major stage in microseconds. + PermitMicros uint64 `protobuf:"varint,5,opt,name=permit_micros,json=permitMicros,proto3" json:"permit_micros,omitempty"` + ConfigMicros uint64 `protobuf:"varint,6,opt,name=config_micros,json=configMicros,proto3" json:"config_micros,omitempty"` + IndexOpenMicros uint64 `protobuf:"varint,7,opt,name=index_open_micros,json=indexOpenMicros,proto3" json:"index_open_micros,omitempty"` + SearchMicros uint64 `protobuf:"varint,8,opt,name=search_micros,json=searchMicros,proto3" json:"search_micros,omitempty"` + TableLookupMicros uint64 `protobuf:"varint,9,opt,name=table_lookup_micros,json=tableLookupMicros,proto3" json:"table_lookup_micros,omitempty"` + // Aggregated tikv-client RPC stats (best-effort) for this /spfresh_search + // request. + TikvClientRpcCount uint64 `protobuf:"varint,10,opt,name=tikv_client_rpc_count,json=tikvClientRpcCount,proto3" json:"tikv_client_rpc_count,omitempty"` + TikvClientRpcMicros uint64 `protobuf:"varint,11,opt,name=tikv_client_rpc_micros,json=tikvClientRpcMicros,proto3" json:"tikv_client_rpc_micros,omitempty"` + ReadOnly bool `protobuf:"varint,12,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` + // Effective oversample factor used by the server for this request. + OversampleFactor float64 `protobuf:"fixed64,13,opt,name=oversample_factor,json=oversampleFactor,proto3" json:"oversample_factor,omitempty"` + // Process-local partition cache stats for this request. + PartitionCacheHits uint64 `protobuf:"varint,14,opt,name=partition_cache_hits,json=partitionCacheHits,proto3" json:"partition_cache_hits,omitempty"` + PartitionCacheMisses uint64 `protobuf:"varint,15,opt,name=partition_cache_misses,json=partitionCacheMisses,proto3" json:"partition_cache_misses,omitempty"` +} + +func (m *SPFreshSearchStats) Reset() { *m = SPFreshSearchStats{} } +func (m *SPFreshSearchStats) String() string { return proto.CompactTextString(m) } +func (*SPFreshSearchStats) ProtoMessage() {} +func (*SPFreshSearchStats) Descriptor() ([]byte, []int) { + return fileDescriptor_f72e9c11973690fb, []int{3} +} +func (m *SPFreshSearchStats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SPFreshSearchStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SPFreshSearchStats.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SPFreshSearchStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_SPFreshSearchStats.Merge(m, src) +} +func (m *SPFreshSearchStats) XXX_Size() int { + return m.Size() +} +func (m *SPFreshSearchStats) XXX_DiscardUnknown() { + xxx_messageInfo_SPFreshSearchStats.DiscardUnknown(m) +} + +var xxx_messageInfo_SPFreshSearchStats proto.InternalMessageInfo + +func (m *SPFreshSearchStats) GetPartitionsScanned() uint64 { + if m != nil { + return m.PartitionsScanned + } + return 0 +} + +func (m *SPFreshSearchStats) GetVectorsScanned() uint64 { + if m != nil { + return m.VectorsScanned + } + return 0 +} + +func (m *SPFreshSearchStats) GetTableLookupKeys() uint64 { + if m != nil { + return m.TableLookupKeys + } + return 0 +} + +func (m *SPFreshSearchStats) GetTableLookupBytes() uint64 { + if m != nil { + return m.TableLookupBytes + } + return 0 +} + +func (m *SPFreshSearchStats) GetPermitMicros() uint64 { + if m != nil { + return m.PermitMicros + } + return 0 +} + +func (m *SPFreshSearchStats) GetConfigMicros() uint64 { + if m != nil { + return m.ConfigMicros + } + return 0 +} + +func (m *SPFreshSearchStats) GetIndexOpenMicros() uint64 { + if m != nil { + return m.IndexOpenMicros + } + return 0 +} + +func (m *SPFreshSearchStats) GetSearchMicros() uint64 { + if m != nil { + return m.SearchMicros + } + return 0 +} + +func (m *SPFreshSearchStats) GetTableLookupMicros() uint64 { + if m != nil { + return m.TableLookupMicros + } + return 0 +} + +func (m *SPFreshSearchStats) GetTikvClientRpcCount() uint64 { + if m != nil { + return m.TikvClientRpcCount + } + return 0 +} + +func (m *SPFreshSearchStats) GetTikvClientRpcMicros() uint64 { + if m != nil { + return m.TikvClientRpcMicros + } + return 0 +} + +func (m *SPFreshSearchStats) GetReadOnly() bool { + if m != nil { + return m.ReadOnly + } + return false +} + +func (m *SPFreshSearchStats) GetOversampleFactor() float64 { + if m != nil { + return m.OversampleFactor + } + return 0 +} + +func (m *SPFreshSearchStats) GetPartitionCacheHits() uint64 { + if m != nil { + return m.PartitionCacheHits + } + return 0 +} + +func (m *SPFreshSearchStats) GetPartitionCacheMisses() uint64 { + if m != nil { + return m.PartitionCacheMisses + } + return 0 +} + +func init() { + proto.RegisterType((*SPFreshSearchRequest)(nil), "tipb.SPFreshSearchRequest") + proto.RegisterType((*SPFreshSearchResponse)(nil), "tipb.SPFreshSearchResponse") + proto.RegisterType((*SPFreshSearchRow)(nil), "tipb.SPFreshSearchRow") + proto.RegisterType((*SPFreshSearchStats)(nil), "tipb.SPFreshSearchStats") +} + +func init() { proto.RegisterFile("spfresh_search.proto", fileDescriptor_f72e9c11973690fb) } + +var fileDescriptor_f72e9c11973690fb = []byte{ + // 806 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0x41, 0x6f, 0x23, 0x35, + 0x14, 0xc7, 0x3b, 0xcd, 0xb4, 0x4d, 0x9d, 0x69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, 0xed, + 0x05, 0xbf, 0xdd, 0xf5, 0xd6, 0x7e, 0xbf, 0xeb, 0xad, 0xbd, 0xbf, 0xeb, 0xad, 0x7d, 0xb8, 0xeb, + 0xad, 0x91, 0x83, 0x44, 0xe7, 0x43, 0x23, 0xd5, 0x55, 0x22, 0xcc, 0xd0, 0xc9, 0x74, 0x8c, 0x83, + 0xf7, 0x3a, 0x18, 0x6f, 0xe2, 0xdf, 0xf7, 0xec, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, 0xa5, + 0x9c, 0x63, 0xd0, 0x05, 0x00, 0x00, +} + +func (m *SPFreshSearchRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SPFreshSearchRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SPFreshSearchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NeedDistance { + i-- + if m.NeedDistance { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.ReadOnly { + i-- + if m.ReadOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.BaseBeamSize != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.BaseBeamSize)) + i-- + dAtA[i] = 0x48 + } + if m.OversampleFactor != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.OversampleFactor)))) + i-- + dAtA[i] = 0x41 + } + if len(m.RequiredColumns) > 0 { + for iNdEx := len(m.RequiredColumns) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RequiredColumns[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpfreshSearch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.QueryVectorF32Le) > 0 { + i -= len(m.QueryVectorF32Le) + copy(dAtA[i:], m.QueryVectorF32Le) + i = encodeVarintSpfreshSearch(dAtA, i, uint64(len(m.QueryVectorF32Le))) + i-- + dAtA[i] = 0x32 + } + if m.TopK != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.TopK)) + i-- + dAtA[i] = 0x28 + } + if m.StartTs != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.StartTs)) + i-- + dAtA[i] = 0x20 + } + if m.IndexId != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.IndexId)) + i-- + dAtA[i] = 0x18 + } + if m.TableId != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.TableId)) + i-- + dAtA[i] = 0x10 + } + if m.KeyspaceId != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.KeyspaceId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SPFreshSearchResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SPFreshSearchResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SPFreshSearchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Stats != nil { + { + size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpfreshSearch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Rows) > 0 { + for iNdEx := len(m.Rows) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rows[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpfreshSearch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SPFreshSearchRow) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SPFreshSearchRow) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SPFreshSearchRow) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ColumnValues) > 0 { + for iNdEx := len(m.ColumnValues) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ColumnValues[iNdEx]) + copy(dAtA[i:], m.ColumnValues[iNdEx]) + i = encodeVarintSpfreshSearch(dAtA, i, uint64(len(m.ColumnValues[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.Distance != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Distance)))) + i-- + dAtA[i] = 0x15 + } + if len(m.HandleBytes) > 0 { + i -= len(m.HandleBytes) + copy(dAtA[i:], m.HandleBytes) + i = encodeVarintSpfreshSearch(dAtA, i, uint64(len(m.HandleBytes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SPFreshSearchStats) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SPFreshSearchStats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SPFreshSearchStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PartitionCacheMisses != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.PartitionCacheMisses)) + i-- + dAtA[i] = 0x78 + } + if m.PartitionCacheHits != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.PartitionCacheHits)) + i-- + dAtA[i] = 0x70 + } + if m.OversampleFactor != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.OversampleFactor)))) + i-- + dAtA[i] = 0x69 + } + if m.ReadOnly { + i-- + if m.ReadOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.TikvClientRpcMicros != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.TikvClientRpcMicros)) + i-- + dAtA[i] = 0x58 + } + if m.TikvClientRpcCount != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.TikvClientRpcCount)) + i-- + dAtA[i] = 0x50 + } + if m.TableLookupMicros != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.TableLookupMicros)) + i-- + dAtA[i] = 0x48 + } + if m.SearchMicros != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.SearchMicros)) + i-- + dAtA[i] = 0x40 + } + if m.IndexOpenMicros != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.IndexOpenMicros)) + i-- + dAtA[i] = 0x38 + } + if m.ConfigMicros != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.ConfigMicros)) + i-- + dAtA[i] = 0x30 + } + if m.PermitMicros != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.PermitMicros)) + i-- + dAtA[i] = 0x28 + } + if m.TableLookupBytes != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.TableLookupBytes)) + i-- + dAtA[i] = 0x20 + } + if m.TableLookupKeys != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.TableLookupKeys)) + i-- + dAtA[i] = 0x18 + } + if m.VectorsScanned != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.VectorsScanned)) + i-- + dAtA[i] = 0x10 + } + if m.PartitionsScanned != 0 { + i = encodeVarintSpfreshSearch(dAtA, i, uint64(m.PartitionsScanned)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintSpfreshSearch(dAtA []byte, offset int, v uint64) int { + offset -= sovSpfreshSearch(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SPFreshSearchRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KeyspaceId != 0 { + n += 1 + sovSpfreshSearch(uint64(m.KeyspaceId)) + } + if m.TableId != 0 { + n += 1 + sovSpfreshSearch(uint64(m.TableId)) + } + if m.IndexId != 0 { + n += 1 + sovSpfreshSearch(uint64(m.IndexId)) + } + if m.StartTs != 0 { + n += 1 + sovSpfreshSearch(uint64(m.StartTs)) + } + if m.TopK != 0 { + n += 1 + sovSpfreshSearch(uint64(m.TopK)) + } + l = len(m.QueryVectorF32Le) + if l > 0 { + n += 1 + l + sovSpfreshSearch(uint64(l)) + } + if len(m.RequiredColumns) > 0 { + for _, e := range m.RequiredColumns { + l = e.Size() + n += 1 + l + sovSpfreshSearch(uint64(l)) + } + } + if m.OversampleFactor != 0 { + n += 9 + } + if m.BaseBeamSize != 0 { + n += 1 + sovSpfreshSearch(uint64(m.BaseBeamSize)) + } + if m.ReadOnly { + n += 2 + } + if m.NeedDistance { + n += 2 + } + return n +} + +func (m *SPFreshSearchResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rows) > 0 { + for _, e := range m.Rows { + l = e.Size() + n += 1 + l + sovSpfreshSearch(uint64(l)) + } + } + if m.Stats != nil { + l = m.Stats.Size() + n += 1 + l + sovSpfreshSearch(uint64(l)) + } + return n +} + +func (m *SPFreshSearchRow) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HandleBytes) + if l > 0 { + n += 1 + l + sovSpfreshSearch(uint64(l)) + } + if m.Distance != 0 { + n += 5 + } + if len(m.ColumnValues) > 0 { + for _, b := range m.ColumnValues { + l = len(b) + n += 1 + l + sovSpfreshSearch(uint64(l)) + } + } + return n +} + +func (m *SPFreshSearchStats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PartitionsScanned != 0 { + n += 1 + sovSpfreshSearch(uint64(m.PartitionsScanned)) + } + if m.VectorsScanned != 0 { + n += 1 + sovSpfreshSearch(uint64(m.VectorsScanned)) + } + if m.TableLookupKeys != 0 { + n += 1 + sovSpfreshSearch(uint64(m.TableLookupKeys)) + } + if m.TableLookupBytes != 0 { + n += 1 + sovSpfreshSearch(uint64(m.TableLookupBytes)) + } + if m.PermitMicros != 0 { + n += 1 + sovSpfreshSearch(uint64(m.PermitMicros)) + } + if m.ConfigMicros != 0 { + n += 1 + sovSpfreshSearch(uint64(m.ConfigMicros)) + } + if m.IndexOpenMicros != 0 { + n += 1 + sovSpfreshSearch(uint64(m.IndexOpenMicros)) + } + if m.SearchMicros != 0 { + n += 1 + sovSpfreshSearch(uint64(m.SearchMicros)) + } + if m.TableLookupMicros != 0 { + n += 1 + sovSpfreshSearch(uint64(m.TableLookupMicros)) + } + if m.TikvClientRpcCount != 0 { + n += 1 + sovSpfreshSearch(uint64(m.TikvClientRpcCount)) + } + if m.TikvClientRpcMicros != 0 { + n += 1 + sovSpfreshSearch(uint64(m.TikvClientRpcMicros)) + } + if m.ReadOnly { + n += 2 + } + if m.OversampleFactor != 0 { + n += 9 + } + if m.PartitionCacheHits != 0 { + n += 1 + sovSpfreshSearch(uint64(m.PartitionCacheHits)) + } + if m.PartitionCacheMisses != 0 { + n += 1 + sovSpfreshSearch(uint64(m.PartitionCacheMisses)) + } + return n +} + +func sovSpfreshSearch(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSpfreshSearch(x uint64) (n int) { + return sovSpfreshSearch(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SPFreshSearchRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SPFreshSearchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SPFreshSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyspaceId", wireType) + } + m.KeyspaceId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.KeyspaceId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableId", wireType) + } + m.TableId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TableId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexId", wireType) + } + m.IndexId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IndexId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTs", wireType) + } + m.StartTs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TopK", wireType) + } + m.TopK = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TopK |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryVectorF32Le", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSpfreshSearch + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSpfreshSearch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueryVectorF32Le = append(m.QueryVectorF32Le[:0], dAtA[iNdEx:postIndex]...) + if m.QueryVectorF32Le == nil { + m.QueryVectorF32Le = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequiredColumns", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSpfreshSearch + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSpfreshSearch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequiredColumns = append(m.RequiredColumns, &ColumnInfo{}) + if err := m.RequiredColumns[len(m.RequiredColumns)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field OversampleFactor", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.OversampleFactor = float64(math.Float64frombits(v)) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseBeamSize", wireType) + } + m.BaseBeamSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BaseBeamSize |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnly = bool(v != 0) + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NeedDistance", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NeedDistance = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipSpfreshSearch(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSpfreshSearch + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SPFreshSearchResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SPFreshSearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SPFreshSearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rows", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSpfreshSearch + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSpfreshSearch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rows = append(m.Rows, &SPFreshSearchRow{}) + if err := m.Rows[len(m.Rows)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSpfreshSearch + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSpfreshSearch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stats == nil { + m.Stats = &SPFreshSearchStats{} + } + if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSpfreshSearch(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSpfreshSearch + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SPFreshSearchRow) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SPFreshSearchRow: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SPFreshSearchRow: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HandleBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSpfreshSearch + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSpfreshSearch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HandleBytes = append(m.HandleBytes[:0], dAtA[iNdEx:postIndex]...) + if m.HandleBytes == nil { + m.HandleBytes = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Distance", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Distance = float32(math.Float32frombits(v)) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ColumnValues", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSpfreshSearch + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSpfreshSearch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ColumnValues = append(m.ColumnValues, make([]byte, postIndex-iNdEx)) + copy(m.ColumnValues[len(m.ColumnValues)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSpfreshSearch(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSpfreshSearch + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SPFreshSearchStats) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SPFreshSearchStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SPFreshSearchStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitionsScanned", wireType) + } + m.PartitionsScanned = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartitionsScanned |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VectorsScanned", wireType) + } + m.VectorsScanned = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VectorsScanned |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableLookupKeys", wireType) + } + m.TableLookupKeys = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TableLookupKeys |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableLookupBytes", wireType) + } + m.TableLookupBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TableLookupBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PermitMicros", wireType) + } + m.PermitMicros = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PermitMicros |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigMicros", wireType) + } + m.ConfigMicros = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ConfigMicros |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexOpenMicros", wireType) + } + m.IndexOpenMicros = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IndexOpenMicros |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchMicros", wireType) + } + m.SearchMicros = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SearchMicros |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableLookupMicros", wireType) + } + m.TableLookupMicros = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TableLookupMicros |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TikvClientRpcCount", wireType) + } + m.TikvClientRpcCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TikvClientRpcCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TikvClientRpcMicros", wireType) + } + m.TikvClientRpcMicros = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TikvClientRpcMicros |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnly = bool(v != 0) + case 13: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field OversampleFactor", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.OversampleFactor = float64(math.Float64frombits(v)) + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitionCacheHits", wireType) + } + m.PartitionCacheHits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartitionCacheHits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitionCacheMisses", wireType) + } + m.PartitionCacheMisses = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PartitionCacheMisses |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSpfreshSearch(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSpfreshSearch + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSpfreshSearch(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSpfreshSearch + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSpfreshSearch + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSpfreshSearch + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSpfreshSearch + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSpfreshSearch = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSpfreshSearch = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSpfreshSearch = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go-tipb/spfresh_teardown.pb.go b/go-tipb/spfresh_teardown.pb.go new file mode 100644 index 00000000..57191b6f --- /dev/null +++ b/go-tipb/spfresh_teardown.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: spfresh_teardown.proto + +package tipb + +import ( + "fmt" + "io" + "math" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + + math_bits "math/bits" +) + +// 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 SPFreshTeardownRequest struct { + KeyspaceId uint32 `protobuf:"varint,1,opt,name=keyspace_id,json=keyspaceId,proto3" json:"keyspace_id,omitempty"` + TableId int64 `protobuf:"varint,2,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"` + IndexId int64 `protobuf:"varint,3,opt,name=index_id,json=indexId,proto3" json:"index_id,omitempty"` +} + +func (m *SPFreshTeardownRequest) Reset() { *m = SPFreshTeardownRequest{} } +func (m *SPFreshTeardownRequest) String() string { return proto.CompactTextString(m) } +func (*SPFreshTeardownRequest) ProtoMessage() {} +func (*SPFreshTeardownRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c4c300fd4e75fe3c, []int{0} +} +func (m *SPFreshTeardownRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SPFreshTeardownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SPFreshTeardownRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SPFreshTeardownRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SPFreshTeardownRequest.Merge(m, src) +} +func (m *SPFreshTeardownRequest) XXX_Size() int { + return m.Size() +} +func (m *SPFreshTeardownRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SPFreshTeardownRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SPFreshTeardownRequest proto.InternalMessageInfo + +func (m *SPFreshTeardownRequest) GetKeyspaceId() uint32 { + if m != nil { + return m.KeyspaceId + } + return 0 +} + +func (m *SPFreshTeardownRequest) GetTableId() int64 { + if m != nil { + return m.TableId + } + return 0 +} + +func (m *SPFreshTeardownRequest) GetIndexId() int64 { + if m != nil { + return m.IndexId + } + return 0 +} + +func init() { + proto.RegisterType((*SPFreshTeardownRequest)(nil), "tipb.SPFreshTeardownRequest") +} + +func init() { proto.RegisterFile("spfresh_teardown.proto", fileDescriptor_c4c300fd4e75fe3c) } + +var fileDescriptor_c4c300fd4e75fe3c = []byte{ + // 221 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0x2e, 0x48, 0x2b, + 0x4a, 0x2d, 0xce, 0x88, 0x2f, 0x49, 0x4d, 0x2c, 0x4a, 0xc9, 0x2f, 0xcf, 0xd3, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x62, 0x29, 0xc9, 0x2c, 0x48, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x0b, + 0xe8, 0x83, 0x58, 0x10, 0x39, 0x29, 0xfe, 0xa2, 0xd2, 0xe2, 0x12, 0x30, 0x13, 0x22, 0xa0, 0x94, + 0xcf, 0x25, 0x16, 0x1c, 0xe0, 0x06, 0x32, 0x26, 0x04, 0x6a, 0x4a, 0x50, 0x6a, 0x61, 0x69, 0x6a, + 0x71, 0x89, 0x90, 0x3c, 0x17, 0x77, 0x76, 0x6a, 0x65, 0x71, 0x41, 0x62, 0x72, 0x6a, 0x7c, 0x66, + 0x8a, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x6f, 0x10, 0x17, 0x4c, 0xc8, 0x33, 0x45, 0x48, 0x92, 0x8b, + 0xa3, 0x24, 0x31, 0x29, 0x07, 0x2c, 0xcb, 0xa4, 0xc0, 0xa8, 0xc1, 0x1c, 0xc4, 0x0e, 0xe6, 0x43, + 0xa4, 0x32, 0xf3, 0x52, 0x52, 0x2b, 0x40, 0x52, 0xcc, 0x10, 0x29, 0x30, 0xdf, 0x33, 0xc5, 0xc9, + 0xf2, 0xc6, 0x0a, 0x0e, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, + 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x19, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, + 0x58, 0x8e, 0x81, 0x4b, 0x34, 0x39, 0x3f, 0x57, 0xaf, 0x20, 0x33, 0x2f, 0x3d, 0x39, 0xb1, 0x40, + 0xaf, 0x24, 0x33, 0x25, 0x49, 0x0f, 0xe4, 0xa1, 0x00, 0xc6, 0x24, 0x36, 0xb0, 0x93, 0x8d, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xda, 0x61, 0x19, 0xbf, 0xf9, 0x00, 0x00, 0x00, +} + +func (m *SPFreshTeardownRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SPFreshTeardownRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SPFreshTeardownRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IndexId != 0 { + i = encodeVarintSpfreshTeardown(dAtA, i, uint64(m.IndexId)) + i-- + dAtA[i] = 0x18 + } + if m.TableId != 0 { + i = encodeVarintSpfreshTeardown(dAtA, i, uint64(m.TableId)) + i-- + dAtA[i] = 0x10 + } + if m.KeyspaceId != 0 { + i = encodeVarintSpfreshTeardown(dAtA, i, uint64(m.KeyspaceId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintSpfreshTeardown(dAtA []byte, offset int, v uint64) int { + offset -= sovSpfreshTeardown(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SPFreshTeardownRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KeyspaceId != 0 { + n += 1 + sovSpfreshTeardown(uint64(m.KeyspaceId)) + } + if m.TableId != 0 { + n += 1 + sovSpfreshTeardown(uint64(m.TableId)) + } + if m.IndexId != 0 { + n += 1 + sovSpfreshTeardown(uint64(m.IndexId)) + } + return n +} + +func sovSpfreshTeardown(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSpfreshTeardown(x uint64) (n int) { + return sovSpfreshTeardown(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SPFreshTeardownRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshTeardown + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SPFreshTeardownRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SPFreshTeardownRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyspaceId", wireType) + } + m.KeyspaceId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshTeardown + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.KeyspaceId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableId", wireType) + } + m.TableId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshTeardown + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TableId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexId", wireType) + } + m.IndexId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpfreshTeardown + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IndexId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSpfreshTeardown(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSpfreshTeardown + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSpfreshTeardown(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSpfreshTeardown + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSpfreshTeardown + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSpfreshTeardown + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSpfreshTeardown + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSpfreshTeardown + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSpfreshTeardown + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSpfreshTeardown = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSpfreshTeardown = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSpfreshTeardown = fmt.Errorf("proto: unexpected end of group") +) diff --git a/proto/spfresh_search.proto b/proto/spfresh_search.proto new file mode 100644 index 00000000..30c89fcd --- /dev/null +++ b/proto/spfresh_search.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +package tipb; + +option java_multiple_files = true; +option java_package = "com.pingcap.tidb.tipb"; + +import "schema.proto"; + +import "gogoproto/gogo.proto"; +import "rustproto.proto"; + +option (gogoproto.marshaler_all) = true; +option (gogoproto.sizer_all) = true; +option (gogoproto.unmarshaler_all) = true; +option (gogoproto.goproto_unkeyed_all) = false; +option (gogoproto.goproto_unrecognized_all) = false; +option (gogoproto.goproto_sizecache_all) = false; +option (rustproto.lite_runtime_all) = true; + +message SPFreshSearchRequest { + uint32 keyspace_id = 1; + int64 table_id = 2; + int64 index_id = 3; + uint64 start_ts = 4; + uint32 top_k = 5; + + // query_vector_f32_le is f32 little-endian bytes, without the dims prefix. + bytes query_vector_f32_le = 6; + + repeated ColumnInfo required_columns = 7; + + // Optional tuning parameters. + double oversample_factor = 8; + // If zero, the server uses its default base beam size. + uint32 base_beam_size = 9; + + // read_only disables background fixups (split/merge) triggered by search + // observations. When enabled, the server must not enqueue fixups and should + // avoid starting any background fixup workers. + bool read_only = 10; + + // When true, the server populates SPFreshSearchRow.distance in each result row. + bool need_distance = 11; +} + +message SPFreshSearchResponse { + repeated SPFreshSearchRow rows = 1; + SPFreshSearchStats stats = 2; +} + +message SPFreshSearchRow { + bytes handle_bytes = 1; + float distance = 2; + repeated bytes column_values = 3; +} + +message SPFreshSearchStats { + uint64 partitions_scanned = 1; + uint64 vectors_scanned = 2; + uint64 table_lookup_keys = 3; + uint64 table_lookup_bytes = 4; + // Time costs of each major stage in microseconds. + uint64 permit_micros = 5; + uint64 config_micros = 6; + uint64 index_open_micros = 7; + uint64 search_micros = 8; + uint64 table_lookup_micros = 9; + // Aggregated tikv-client RPC stats (best-effort) for this /spfresh_search + // request. + uint64 tikv_client_rpc_count = 10; + uint64 tikv_client_rpc_micros = 11; + bool read_only = 12; + // Effective oversample factor used by the server for this request. + double oversample_factor = 13; + // Process-local partition cache stats for this request. + uint64 partition_cache_hits = 14; + uint64 partition_cache_misses = 15; +} diff --git a/proto/spfresh_teardown.proto b/proto/spfresh_teardown.proto new file mode 100644 index 00000000..f9525336 --- /dev/null +++ b/proto/spfresh_teardown.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package tipb; + +option java_multiple_files = true; +option java_package = "com.pingcap.tidb.tipb"; + +import "gogoproto/gogo.proto"; +import "rustproto.proto"; + +option (gogoproto.marshaler_all) = true; +option (gogoproto.sizer_all) = true; +option (gogoproto.unmarshaler_all) = true; +option (gogoproto.goproto_unkeyed_all) = false; +option (gogoproto.goproto_unrecognized_all) = false; +option (gogoproto.goproto_sizecache_all) = false; +option (rustproto.lite_runtime_all) = true; + +message SPFreshTeardownRequest { + uint32 keyspace_id = 1; + int64 table_id = 2; + int64 index_id = 3; +} diff --git a/scripts/proto.lock b/scripts/proto.lock index d98314ef..63fda5c4 100644 --- a/scripts/proto.lock +++ b/scripts/proto.lock @@ -8323,6 +8323,319 @@ ] } }, + { + "protopath": "spfresh_search.proto", + "def": { + "messages": [ + { + "name": "SPFreshSearchRequest", + "fields": [ + { + "id": 1, + "name": "keyspace_id", + "type": "uint32" + }, + { + "id": 2, + "name": "table_id", + "type": "int64" + }, + { + "id": 3, + "name": "index_id", + "type": "int64" + }, + { + "id": 4, + "name": "start_ts", + "type": "uint64" + }, + { + "id": 5, + "name": "top_k", + "type": "uint32" + }, + { + "id": 6, + "name": "query_vector_f32_le", + "type": "bytes" + }, + { + "id": 7, + "name": "required_columns", + "type": "ColumnInfo", + "is_repeated": true + }, + { + "id": 8, + "name": "oversample_factor", + "type": "double" + }, + { + "id": 9, + "name": "base_beam_size", + "type": "uint32" + }, + { + "id": 10, + "name": "read_only", + "type": "bool" + }, + { + "id": 11, + "name": "need_distance", + "type": "bool" + } + ] + }, + { + "name": "SPFreshSearchResponse", + "fields": [ + { + "id": 1, + "name": "rows", + "type": "SPFreshSearchRow", + "is_repeated": true + }, + { + "id": 2, + "name": "stats", + "type": "SPFreshSearchStats" + } + ] + }, + { + "name": "SPFreshSearchRow", + "fields": [ + { + "id": 1, + "name": "handle_bytes", + "type": "bytes" + }, + { + "id": 2, + "name": "distance", + "type": "float" + }, + { + "id": 3, + "name": "column_values", + "type": "bytes", + "is_repeated": true + } + ] + }, + { + "name": "SPFreshSearchStats", + "fields": [ + { + "id": 1, + "name": "partitions_scanned", + "type": "uint64" + }, + { + "id": 2, + "name": "vectors_scanned", + "type": "uint64" + }, + { + "id": 3, + "name": "table_lookup_keys", + "type": "uint64" + }, + { + "id": 4, + "name": "table_lookup_bytes", + "type": "uint64" + }, + { + "id": 5, + "name": "permit_micros", + "type": "uint64" + }, + { + "id": 6, + "name": "config_micros", + "type": "uint64" + }, + { + "id": 7, + "name": "index_open_micros", + "type": "uint64" + }, + { + "id": 8, + "name": "search_micros", + "type": "uint64" + }, + { + "id": 9, + "name": "table_lookup_micros", + "type": "uint64" + }, + { + "id": 10, + "name": "tikv_client_rpc_count", + "type": "uint64" + }, + { + "id": 11, + "name": "tikv_client_rpc_micros", + "type": "uint64" + }, + { + "id": 12, + "name": "read_only", + "type": "bool" + }, + { + "id": 13, + "name": "oversample_factor", + "type": "double" + }, + { + "id": 14, + "name": "partition_cache_hits", + "type": "uint64" + }, + { + "id": 15, + "name": "partition_cache_misses", + "type": "uint64" + } + ] + } + ], + "imports": [ + { + "path": "schema.proto" + }, + { + "path": "gogoproto/gogo.proto" + }, + { + "path": "rustproto.proto" + } + ], + "package": { + "name": "tipb" + }, + "options": [ + { + "name": "java_multiple_files", + "value": "true" + }, + { + "name": "java_package", + "value": "com.pingcap.tidb.tipb" + }, + { + "name": "(gogoproto.marshaler_all)", + "value": "true" + }, + { + "name": "(gogoproto.sizer_all)", + "value": "true" + }, + { + "name": "(gogoproto.unmarshaler_all)", + "value": "true" + }, + { + "name": "(gogoproto.goproto_unkeyed_all)", + "value": "false" + }, + { + "name": "(gogoproto.goproto_unrecognized_all)", + "value": "false" + }, + { + "name": "(gogoproto.goproto_sizecache_all)", + "value": "false" + }, + { + "name": "(rustproto.lite_runtime_all)", + "value": "true" + } + ] + } + }, + { + "protopath": "spfresh_teardown.proto", + "def": { + "messages": [ + { + "name": "SPFreshTeardownRequest", + "fields": [ + { + "id": 1, + "name": "keyspace_id", + "type": "uint32" + }, + { + "id": 2, + "name": "table_id", + "type": "int64" + }, + { + "id": 3, + "name": "index_id", + "type": "int64" + } + ] + } + ], + "imports": [ + { + "path": "gogoproto/gogo.proto" + }, + { + "path": "rustproto.proto" + } + ], + "package": { + "name": "tipb" + }, + "options": [ + { + "name": "java_multiple_files", + "value": "true" + }, + { + "name": "java_package", + "value": "com.pingcap.tidb.tipb" + }, + { + "name": "(gogoproto.marshaler_all)", + "value": "true" + }, + { + "name": "(gogoproto.sizer_all)", + "value": "true" + }, + { + "name": "(gogoproto.unmarshaler_all)", + "value": "true" + }, + { + "name": "(gogoproto.goproto_unkeyed_all)", + "value": "false" + }, + { + "name": "(gogoproto.goproto_unrecognized_all)", + "value": "false" + }, + { + "name": "(gogoproto.goproto_sizecache_all)", + "value": "false" + }, + { + "name": "(rustproto.lite_runtime_all)", + "value": "true" + } + ] + } + }, { "protopath": "tici:/:indexer.proto", "def": {