From 7e43d5722ae16e6955e3f07dc889206cf1fb9d8e Mon Sep 17 00:00:00 2001 From: wei liu Date: Mon, 29 Jul 2024 11:31:51 +0800 Subject: [PATCH] enhance: Update protobuf-go to protobuf-go v2 (#34394) issue: #34252 Signed-off-by: Wei Liu Co-authored-by: Congqi Xia --- Makefile | 33 +- client/client.go | 2 +- client/collection_options.go | 2 +- client/collection_test.go | 2 +- client/go.mod | 6 +- client/go.sum | 2 - client/read_options.go | 2 +- cmd/milvus/mck.go | 38 +- cmd/tools/datameta/main.go | 2 +- cmd/tools/migration/backend/backup_header.go | 28 - .../migration/backend/backup_header.pb.go | 203 +++++++ .../migration/backend/backup_header.proto | 22 + cmd/tools/migration/backend/backup_restore.go | 2 +- .../migration/backend/backup_restore_test.go | 5 +- cmd/tools/migration/backend/etcd210.go | 6 +- cmd/tools/migration/meta/meta210.go | 2 +- cmd/tools/migration/meta/meta220.go | 2 +- go.mod | 8 +- go.sum | 15 +- internal/datacoord/analyze_meta.go | 2 +- internal/datacoord/channel.go | 2 +- internal/datacoord/channel_checker.go | 2 +- internal/datacoord/channel_checker_test.go | 2 +- internal/datacoord/channel_manager_test.go | 2 +- internal/datacoord/channel_manager_v2.go | 2 +- internal/datacoord/channel_manager_v2_test.go | 2 +- internal/datacoord/channel_store.go | 2 +- internal/datacoord/channel_store_test.go | 2 +- internal/datacoord/channel_store_v2.go | 2 +- internal/datacoord/channel_store_v2_test.go | 2 +- internal/datacoord/compaction_task_meta.go | 2 +- internal/datacoord/import_job.go | 2 +- internal/datacoord/import_task.go | 2 +- internal/datacoord/index_meta.go | 2 +- internal/datacoord/meta.go | 2 +- internal/datacoord/meta_test.go | 2 +- internal/datacoord/segment_info.go | 2 +- internal/datacoord/server.go | 2 +- internal/datacoord/services_test.go | 2 +- .../compaction/clustering_compactor.go | 2 +- internal/datanode/data_sync_service_test.go | 2 +- internal/datanode/event_manager.go | 2 +- internal/datanode/event_manager_test.go | 2 +- internal/datanode/flow_graph_dd_node.go | 10 +- internal/datanode/flow_graph_dd_node_test.go | 8 +- internal/datanode/flow_graph_write_node.go | 2 +- internal/datanode/mock_test.go | 8 +- internal/datanode/stats_updater.go | 2 +- .../writebuffer/bf_write_buffer_test.go | 4 +- .../writebuffer/insert_buffer_test.go | 2 +- .../writebuffer/l0_write_buffer_test.go | 4 +- .../distributed/proxy/httpserver/handler.go | 2 +- .../proxy/httpserver/handler_test.go | 8 +- .../proxy/httpserver/handler_v1.go | 2 +- .../proxy/httpserver/handler_v2.go | 2 +- .../proxy/httpserver/handler_v2_test.go | 8 +- .../distributed/proxy/httpserver/utils.go | 2 +- .../proxy/httpserver/utils_test.go | 30 +- .../proxy/httpserver/wrap_request.go | 2 +- internal/metastore/kv/binlog/binlog_test.go | 2 +- internal/metastore/kv/datacoord/kv_catalog.go | 2 +- .../metastore/kv/datacoord/kv_catalog_test.go | 8 +- internal/metastore/kv/datacoord/util.go | 2 +- .../metastore/kv/querycoord/kv_catalog.go | 2 +- internal/metastore/kv/rootcoord/kv_catalog.go | 2 +- .../metastore/kv/rootcoord/kv_catalog_test.go | 4 +- internal/metastore/model/index.go | 2 +- internal/proxy/accesslog/info/grpc_info.go | 2 +- internal/proxy/database_interceptor_test.go | 5 +- internal/proxy/impl.go | 4 +- internal/proxy/impl_test.go | 20 +- internal/proxy/lb_policy_test.go | 2 +- internal/proxy/msg_pack.go | 5 +- internal/proxy/msg_pack_test.go | 6 +- internal/proxy/proxy_test.go | 2 +- internal/proxy/rate_limit_interceptor.go | 2 +- internal/proxy/rate_limit_interceptor_test.go | 2 +- internal/proxy/rootcoord_mock_test.go | 2 +- internal/proxy/search_util.go | 2 +- internal/proxy/task.go | 2 +- internal/proxy/task_delete.go | 33 +- internal/proxy/task_insert_test.go | 8 +- internal/proxy/task_query.go | 2 +- internal/proxy/task_query_test.go | 2 +- internal/proxy/task_scheduler_test.go | 2 +- internal/proxy/task_search.go | 2 +- internal/proxy/task_search_test.go | 2 +- internal/proxy/task_statistic.go | 2 +- internal/proxy/task_statistic_test.go | 2 +- internal/proxy/task_test.go | 12 +- internal/proxy/task_upsert.go | 6 +- internal/proxy/task_upsert_test.go | 8 +- internal/proxy/util.go | 20 +- internal/proxy/util_test.go | 62 +- internal/querycoordv2/dist/dist_handler.go | 2 +- .../querycoordv2/meta/channel_dist_manager.go | 2 +- .../querycoordv2/meta/collection_manager.go | 2 +- internal/querycoordv2/meta/replica.go | 2 +- .../querycoordv2/meta/replica_manager_test.go | 2 +- internal/querycoordv2/meta/resource_group.go | 2 +- .../querycoordv2/meta/resource_manager.go | 2 +- .../querycoordv2/meta/segment_dist_manager.go | 2 +- internal/querycoordv2/session/cluster.go | 2 +- internal/querycoordv2/session/cluster_test.go | 1 + internal/querycoordv2/utils/types_test.go | 2 +- internal/querynodev2/delegator/delegator.go | 2 +- .../delegator/delegator_data_test.go | 6 +- .../querynodev2/delegator/segment_pruner.go | 2 +- .../delegator/segment_pruner_test.go | 2 +- internal/querynodev2/mock_data.go | 2 +- internal/querynodev2/optimizers/query_hook.go | 2 +- .../querynodev2/optimizers/query_hook_test.go | 2 +- internal/querynodev2/pipeline/mock_data.go | 4 +- internal/querynodev2/segments/cgo_util.go | 2 +- internal/querynodev2/segments/collection.go | 2 +- .../querynodev2/segments/load_index_info.go | 2 +- internal/querynodev2/segments/mock_data.go | 22 +- internal/querynodev2/segments/plan_test.go | 2 +- internal/querynodev2/segments/reduce_test.go | 6 +- internal/querynodev2/segments/result.go | 2 +- internal/querynodev2/segments/segment.go | 8 +- internal/querynodev2/services.go | 2 +- internal/querynodev2/services_test.go | 2 +- internal/querynodev2/tasks/search_task.go | 2 +- .../querynodev2/tasks/search_task_test.go | 2 +- internal/rootcoord/create_collection_task.go | 4 +- .../rootcoord/create_collection_task_test.go | 2 +- internal/rootcoord/garbage_collector.go | 4 +- internal/rootcoord/timeticksync.go | 16 +- internal/storage/data_codec_test.go | 4 +- internal/storage/data_sorter_test.go | 4 +- internal/storage/insert_data.go | 2 +- internal/storage/payload_reader.go | 2 +- internal/storage/payload_test.go | 8 +- internal/storage/payload_writer.go | 2 +- internal/storage/print_binlog.go | 2 +- internal/storage/print_binlog_test.go | 2 +- internal/storage/serde.go | 2 +- internal/storage/utils.go | 2 +- internal/storage/utils_test.go | 14 +- internal/util/analyzecgowrapper/analyze.go | 2 +- internal/util/flowgraph/node_test.go | 19 +- .../util/indexcgowrapper/build_index_info.go | 2 +- internal/util/indexcgowrapper/index.go | 13 +- internal/util/streamrpc/streamer.go | 2 +- internal/util/testutil/test_util.go | 7 +- internal/util/typeutil/storage.go | 2 +- pkg/eventlog/event_log.pb.go | 449 +++++++------- pkg/eventlog/event_log_grpc.pb.go | 134 +++++ pkg/go.mod | 8 +- pkg/go.sum | 11 +- .../mqimpl/rocksmq/client/client_impl_test.go | 2 +- pkg/mq/mqimpl/rocksmq/client/util.go | 2 +- pkg/mq/msgdispatcher/mock_test.go | 14 +- pkg/mq/msgstream/factory_stream_test.go | 4 +- pkg/mq/msgstream/mq_msgstream.go | 2 +- pkg/mq/msgstream/mq_msgstream_test.go | 16 +- pkg/mq/msgstream/mq_rocksmq_msgstream_test.go | 4 +- pkg/mq/msgstream/msg.go | 92 +-- pkg/mq/msgstream/msg_for_collection.go | 32 +- pkg/mq/msgstream/msg_for_collection_test.go | 6 +- pkg/mq/msgstream/msg_for_database.go | 22 +- pkg/mq/msgstream/msg_for_database_test.go | 4 +- pkg/mq/msgstream/msg_for_index.go | 32 +- pkg/mq/msgstream/msg_for_index_test.go | 4 +- pkg/mq/msgstream/msg_for_partition.go | 22 +- pkg/mq/msgstream/msg_for_partition_test.go | 4 +- pkg/mq/msgstream/msg_test.go | 28 +- pkg/mq/msgstream/unmarshal_test.go | 4 +- .../util/message/messagepb/message.pb.go | 547 ------------------ .../impls/pulsar/message_id_data.pb.go | 177 ++++++ .../impls/pulsar/message_id_data.proto | 13 + pkg/util/funcutil/placeholdergroup.go | 2 +- pkg/util/funcutil/policy.go | 69 ++- pkg/util/testutils/gen_data.go | 42 ++ pkg/util/typeutil/convension.go | 2 +- pkg/util/typeutil/schema.go | 2 +- pkg/util/typeutil/schema_test.go | 6 +- scripts/generate_proto.sh | 36 +- tests/integration/alias/alias_test.go | 2 +- tests/integration/balance/balance_test.go | 2 +- .../balance/channel_exclusive_balance_test.go | 2 +- .../bloomfilter/bloom_filter_test.go | 2 +- .../channel_balance/channel_balance_test.go | 2 +- .../compaction/clustering_compaction_test.go | 2 +- .../compaction/l0_compaction_test.go | 2 +- .../compaction/l2_single_compaction_test.go | 2 +- .../compaction/mix_compaction_test.go | 2 +- .../search_after_coord_down_test.go | 2 +- .../coordrecovery/coord_recovery_test.go | 2 +- tests/integration/datanode/compaction_test.go | 2 +- tests/integration/datanode/datanode_test.go | 2 +- .../integration/expression/expression_test.go | 2 +- .../integration/getvector/get_vector_test.go | 2 +- .../hellomilvus/hello_milvus_test.go | 2 +- .../hybridsearch/hybridsearch_test.go | 2 +- tests/integration/import/binlog_test.go | 2 +- .../integration/import/dynamic_field_test.go | 2 +- tests/integration/import/import_test.go | 2 +- tests/integration/import/multi_vector_test.go | 2 +- .../integration/import/partition_key_test.go | 2 +- .../indexstat/get_index_statistics_test.go | 2 +- tests/integration/insert/insert_test.go | 2 +- tests/integration/jsonexpr/json_expr_test.go | 2 +- .../materialized_view_test.go | 2 +- tests/integration/meta_watcher.go | 2 +- tests/integration/meta_watcher_test.go | 2 +- .../partialsearch/partial_search_test.go | 2 +- .../partitionkey/partition_key_test.go | 2 +- tests/integration/querynode/querynode_test.go | 2 +- .../rangesearch/range_search_test.go | 2 +- .../refreshconfig/refresh_config_test.go | 2 +- tests/integration/rg/resource_group_test.go | 2 +- .../manual_rolling_upgrade_test.go | 2 +- .../seal_by_total_growing_test.go | 2 +- tests/integration/sparse/sparse_test.go | 2 +- tests/integration/target/target_test.go | 2 +- tests/integration/upsert/upsert_test.go | 2 +- tests/integration/util_collection.go | 2 +- tests/integration/util_query.go | 2 +- .../watchcompatibility/watch_test.go | 2 +- 221 files changed, 1471 insertions(+), 1388 deletions(-) create mode 100644 cmd/tools/migration/backend/backup_header.pb.go create mode 100644 cmd/tools/migration/backend/backup_header.proto create mode 100644 pkg/eventlog/event_log_grpc.pb.go delete mode 100644 pkg/streaming/util/message/messagepb/message.pb.go create mode 100644 pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go create mode 100644 pkg/streaming/walimpls/impls/pulsar/message_id_data.proto diff --git a/Makefile b/Makefile index c212efd7aec00..a5cf7f088f53f 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,14 @@ INSTALL_GOFUMPT := $(findstring $(GOFUMPT_VERSION),$(GOFUMPT_OUTPUT)) GOTESTSUM_VERSION := 1.11.0 GOTESTSUM_OUTPUT := $(shell $(INSTALL_PATH)/gotestsum --version 2>/dev/null) INSTALL_GOTESTSUM := $(findstring $(GOTESTSUM_VERSION),$(GOTESTSUM_OUTPUT)) +# protoc-gen-go +PROTOC_GEN_GO_VERSION := 1.33.0 +PROTOC_GEN_GO_OUTPUT := $(shell print | $(INSTALL_PATH)/protoc-gen-go --version 2>/dev/null) +INSTALL_PROTOC_GEN_GO := $(findstring $(PROTOC_GEN_GO_VERSION),$(PROTOC_GEN_GO_OUTPUT)) +# protoc-gen-go-grpc +PROTOC_GEN_GO_GRPC_VERSION := 1.3.0 +PROTOC_GEN_GO_GRPC_OUTPUT := $(shell print | $(INSTALL_PATH)/protoc-gen-go-grpc --version 2>/dev/null) +INSTALL_PROTOC_GEN_GO_GRPC := $(findstring $(PROTOC_GEN_GO_GRPC_VERSION),$(PROTOC_GEN_GO_GRPC_OUTPUT)) index_engine = knowhere @@ -105,6 +113,19 @@ getdeps: echo "gotestsum v$(GOTESTSUM_VERSION) already installed";\ fi +get-proto-deps: + @mkdir -p $(INSTALL_PATH) # make sure directory exists + @if [ -z "$(INSTALL_PROTOC_GEN_GO)" ]; then \ + echo "install protoc-gen-go $(PROTOC_GEN_GO_VERSION) to $(INSTALL_PATH)" && GOBIN=$(INSTALL_PATH) go install google.golang.org/protobuf/cmd/protoc-gen-go@v$(PROTOC_GEN_GO_VERSION); \ + else \ + echo "protoc-gen-go@v$(PROTOC_GEN_GO_VERSION) already installed";\ + fi + @if [ -z "$(INSTALL_PROTOC_GEN_GO_GRPC)" ]; then \ + echo "install protoc-gen-go-grpc $(PROTOC_GEN_GO_GRPC_VERSION) to $(INSTALL_PATH)" && GOBIN=$(INSTALL_PATH) go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v$(PROTOC_GEN_GO_GRPC_VERSION); \ + else \ + echo "protoc-gen-go-grpc@v$(PROTOC_GEN_GO_GRPC_VERSION) already installed";\ + fi + tools/bin/revive: tools/check/go.mod cd tools/check; \ $(GO) build -pgo=$(PGO_PATH)/default.pgo -o ../bin/revive github.com/mgechev/revive @@ -218,17 +239,13 @@ build-3rdparty: @echo "Build 3rdparty ..." @(env bash $(PWD)/scripts/3rdparty_build.sh -o ${use_opendal}) -generated-proto-without-cpp: download-milvus-proto +generated-proto-without-cpp: download-milvus-proto get-proto-deps @echo "Generate proto ..." - @mkdir -p ${GOPATH}/bin - @which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && cd /tmp && go install github.com/golang/protobuf/protoc-gen-go@v1.3.2) - @(env bash $(PWD)/scripts/generate_proto.sh) + @(env bash $(PWD)/scripts/generate_proto.sh ${INSTALL_PATH}) -generated-proto: download-milvus-proto build-3rdparty +generated-proto: download-milvus-proto build-3rdparty get-proto-deps @echo "Generate proto ..." - @mkdir -p ${GOPATH}/bin - @which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && cd /tmp && go install github.com/golang/protobuf/protoc-gen-go@v1.3.2) - @(env bash $(PWD)/scripts/generate_proto.sh) + @(env bash $(PWD)/scripts/generate_proto.sh ${INSTALL_PATH}) build-cpp: generated-proto @echo "Building Milvus cpp library ..." diff --git a/client/client.go b/client/client.go index b515781106c30..46aa57a0876d3 100644 --- a/client/client.go +++ b/client/client.go @@ -23,9 +23,9 @@ import ( "strconv" "time" - "github.com/gogo/status" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/client/collection_options.go b/client/collection_options.go index 2d3457177c7d4..96c0a4032ccfa 100644 --- a/client/collection_options.go +++ b/client/collection_options.go @@ -17,7 +17,7 @@ package client import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/client/collection_test.go b/client/collection_test.go index 2a55a786b8501..0bab40f48335c 100644 --- a/client/collection_test.go +++ b/client/collection_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/client/go.mod b/client/go.mod index 08a2331d490de..a58c43b7a4212 100644 --- a/client/go.mod +++ b/client/go.mod @@ -5,8 +5,6 @@ go 1.21 require ( github.com/blang/semver/v4 v4.0.0 github.com/cockroachdb/errors v1.9.1 - github.com/gogo/status v1.1.0 - github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/milvus-io/milvus-proto/go-api/v2 v2.4.9 github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3 @@ -16,6 +14,7 @@ require ( github.com/tidwall/gjson v1.17.1 go.uber.org/atomic v1.10.0 google.golang.org/grpc v1.57.1 + google.golang.org/protobuf v1.33.0 ) require ( @@ -39,8 +38,8 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/godbus/dbus/v5 v5.0.4 // indirect - github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect @@ -117,7 +116,6 @@ require ( google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect - google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect diff --git a/client/go.sum b/client/go.sum index 5e0e650a1890f..08a4a58849687 100644 --- a/client/go.sum +++ b/client/go.sum @@ -198,7 +198,6 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -206,7 +205,6 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= diff --git a/client/read_options.go b/client/read_options.go index 4b880153cbdbe..8d8fe18a5855d 100644 --- a/client/read_options.go +++ b/client/read_options.go @@ -20,7 +20,7 @@ import ( "encoding/json" "strconv" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/cmd/milvus/mck.go b/cmd/milvus/mck.go index 5129a67d935b1..6581356c252b6 100644 --- a/cmd/milvus/mck.go +++ b/cmd/milvus/mck.go @@ -12,9 +12,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" @@ -528,40 +528,40 @@ func (c *mck) unmarshalTask(taskID int64, t string) (string, []int64, []int64, e switch header.Base.MsgType { case commonpb.MsgType_LoadCollection: - loadReq := querypb.LoadCollectionRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadCollectionRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadCollectionRequest", err) } log.Info("LoadCollection", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadCollection", emptyInt64(), emptyInt64(), nil case commonpb.MsgType_LoadPartitions: - loadReq := querypb.LoadPartitionsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadPartitionsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadPartitionsRequest", err) } log.Info("LoadPartitions", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadPartitions", loadReq.PartitionIDs, emptyInt64(), nil case commonpb.MsgType_ReleaseCollection: - loadReq := querypb.ReleaseCollectionRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.ReleaseCollectionRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "ReleaseCollectionRequest", err) } log.Info("ReleaseCollection", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "ReleaseCollection", emptyInt64(), emptyInt64(), nil case commonpb.MsgType_ReleasePartitions: - loadReq := querypb.ReleasePartitionsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.ReleasePartitionsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "ReleasePartitionsRequest", err) } log.Info("ReleasePartitions", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "ReleasePartitions", loadReq.PartitionIDs, emptyInt64(), nil case commonpb.MsgType_LoadSegments: - loadReq := querypb.LoadSegmentsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadSegmentsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadSegmentsRequest", err) } @@ -584,16 +584,16 @@ func (c *mck) unmarshalTask(taskID int64, t string) (string, []int64, []int64, e log.Info("LoadSegments", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadSegments", removeRepeatElement(partitionIDs), removeRepeatElement(segmentIDs), nil case commonpb.MsgType_ReleaseSegments: - loadReq := querypb.ReleaseSegmentsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.ReleaseSegmentsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "ReleaseSegmentsRequest", err) } log.Info("ReleaseSegments", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "ReleaseSegments", loadReq.PartitionIDs, loadReq.SegmentIDs, nil case commonpb.MsgType_WatchDmChannels: - loadReq := querypb.WatchDmChannelsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.WatchDmChannelsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "WatchDmChannelsRequest", err) } @@ -619,16 +619,16 @@ func (c *mck) unmarshalTask(taskID int64, t string) (string, []int64, []int64, e log.Warn("legacy WatchQueryChannels type found, ignore") return "WatchQueryChannels", emptyInt64(), emptyInt64(), nil case commonpb.MsgType_LoadBalanceSegments: - loadReq := querypb.LoadBalanceRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadBalanceRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadBalanceRequest", err) } log.Info("LoadBalanceSegments", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadBalanceSegments", emptyInt64(), loadReq.SealedSegmentIDs, nil case commonpb.MsgType_HandoffSegments: - handoffReq := querypb.HandoffSegmentsRequest{} - err = proto.Unmarshal([]byte(t), &handoffReq) + handoffReq := &querypb.HandoffSegmentsRequest{} + err = proto.Unmarshal([]byte(t), handoffReq) if err != nil { return errReturn(taskID, "HandoffSegmentsRequest", err) } diff --git a/cmd/tools/datameta/main.go b/cmd/tools/datameta/main.go index d6bdffc35c2cb..9c2e495679c1f 100644 --- a/cmd/tools/datameta/main.go +++ b/cmd/tools/datameta/main.go @@ -6,8 +6,8 @@ import ( "sort" "strings" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/cmd/tools/migration/backend/backup_header.go b/cmd/tools/migration/backend/backup_header.go index 59436505ed7cb..483697ea426ad 100644 --- a/cmd/tools/migration/backend/backup_header.go +++ b/cmd/tools/migration/backend/backup_header.go @@ -3,8 +3,6 @@ package backend import ( "encoding/json" - "github.com/golang/protobuf/proto" - "github.com/milvus-io/milvus/cmd/tools/migration/console" ) @@ -14,32 +12,6 @@ const ( BackupHeaderVersionV1 BackupHeaderVersion = iota ) -// BackupHeader stores etcd backup header information -type BackupHeader struct { - // Version number for backup format - Version BackupHeaderVersion `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - // instance name, as rootPath for key prefix - Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"` - // MetaPath used in keys - MetaPath string `protobuf:"bytes,3,opt,name=meta_path,proto3" json:"meta_path,omitempty"` - // Entries record number of key-value in backup - Entries int64 `protobuf:"varint,4,opt,name=entries,proto3" json:"entries,omitempty"` - // Component is the backup target - Component string `protobuf:"bytes,5,opt,name=component,proto3" json:"component,omitempty"` - // Extra property reserved - Extra []byte `protobuf:"bytes,6,opt,name=extra,proto3" json:"-"` -} - -func (v *BackupHeader) Reset() { - *v = BackupHeader{} -} - -func (v *BackupHeader) String() string { - return proto.CompactTextString(v) -} - -func (v *BackupHeader) ProtoMessage() {} - type BackupHeaderExtra struct { EntryIncludeRootPath bool `json:"entry_include_root_path"` } diff --git a/cmd/tools/migration/backend/backup_header.pb.go b/cmd/tools/migration/backend/backup_header.pb.go new file mode 100644 index 0000000000000..83d9a37541afc --- /dev/null +++ b/cmd/tools/migration/backend/backup_header.pb.go @@ -0,0 +1,203 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.21.4 +// source: backup_header.proto + +package backend + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BackupHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Version number for backup format + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // instance name, as rootPath for key prefix + Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"` + // MetaPath used in keys + MetaPath string `protobuf:"bytes,3,opt,name=meta_path,json=metaPath,proto3" json:"meta_path,omitempty"` + // Entries record number of key-value in backup + Entries int64 `protobuf:"varint,4,opt,name=entries,proto3" json:"entries,omitempty"` + // Component is the backup target + Component string `protobuf:"bytes,5,opt,name=component,proto3" json:"component,omitempty"` + // Extra property reserved + Extra []byte `protobuf:"bytes,6,opt,name=extra,proto3" json:"extra,omitempty"` +} + +func (x *BackupHeader) Reset() { + *x = BackupHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_backup_header_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackupHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackupHeader) ProtoMessage() {} + +func (x *BackupHeader) ProtoReflect() protoreflect.Message { + mi := &file_backup_header_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackupHeader.ProtoReflect.Descriptor instead. +func (*BackupHeader) Descriptor() ([]byte, []int) { + return file_backup_header_proto_rawDescGZIP(), []int{0} +} + +func (x *BackupHeader) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *BackupHeader) GetInstance() string { + if x != nil { + return x.Instance + } + return "" +} + +func (x *BackupHeader) GetMetaPath() string { + if x != nil { + return x.MetaPath + } + return "" +} + +func (x *BackupHeader) GetEntries() int64 { + if x != nil { + return x.Entries + } + return 0 +} + +func (x *BackupHeader) GetComponent() string { + if x != nil { + return x.Component + } + return "" +} + +func (x *BackupHeader) GetExtra() []byte { + if x != nil { + return x.Extra + } + return nil +} + +var File_backup_header_proto protoreflect.FileDescriptor + +var file_backup_header_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x28, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6d, 0x64, 0x2e, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x22, + 0xaf, 0x01, 0x0a, 0x0c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x63, 0x6d, 0x64, 0x2f, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_backup_header_proto_rawDescOnce sync.Once + file_backup_header_proto_rawDescData = file_backup_header_proto_rawDesc +) + +func file_backup_header_proto_rawDescGZIP() []byte { + file_backup_header_proto_rawDescOnce.Do(func() { + file_backup_header_proto_rawDescData = protoimpl.X.CompressGZIP(file_backup_header_proto_rawDescData) + }) + return file_backup_header_proto_rawDescData +} + +var file_backup_header_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_backup_header_proto_goTypes = []interface{}{ + (*BackupHeader)(nil), // 0: milvus.proto.cmd.tools.migration.backend.BackupHeader +} +var file_backup_header_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_backup_header_proto_init() } +func file_backup_header_proto_init() { + if File_backup_header_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_backup_header_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackupHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_backup_header_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_backup_header_proto_goTypes, + DependencyIndexes: file_backup_header_proto_depIdxs, + MessageInfos: file_backup_header_proto_msgTypes, + }.Build() + File_backup_header_proto = out.File + file_backup_header_proto_rawDesc = nil + file_backup_header_proto_goTypes = nil + file_backup_header_proto_depIdxs = nil +} diff --git a/cmd/tools/migration/backend/backup_header.proto b/cmd/tools/migration/backend/backup_header.proto new file mode 100644 index 0000000000000..fef7f8dc8935e --- /dev/null +++ b/cmd/tools/migration/backend/backup_header.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package milvus.proto.cmd.tools.migration.backend; + + +option go_package = "github.com/milvus-io/milvus/internal/proto/cmd/tools/migration/backend"; + + + +message BackupHeader { + // Version number for backup format + int32 version = 1; + // instance name, as rootPath for key prefix + string instance = 2; + // MetaPath used in keys + string meta_path = 3; + // Entries record number of key-value in backup + int64 entries = 4; + // Component is the backup target + string component = 5; + // Extra property reserved + bytes extra = 6; +} diff --git a/cmd/tools/migration/backend/backup_restore.go b/cmd/tools/migration/backend/backup_restore.go index c21d096cdf1be..59678a3437522 100644 --- a/cmd/tools/migration/backend/backup_restore.go +++ b/cmd/tools/migration/backend/backup_restore.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) diff --git a/cmd/tools/migration/backend/backup_restore_test.go b/cmd/tools/migration/backend/backup_restore_test.go index 847f17ba1b03d..ded76a16fdab9 100644 --- a/cmd/tools/migration/backend/backup_restore_test.go +++ b/cmd/tools/migration/backend/backup_restore_test.go @@ -5,11 +5,12 @@ import ( "testing" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/encoding/prototext" ) func TestBackupCodec_Serialize(t *testing.T) { header := &BackupHeader{ - Version: BackupHeaderVersionV1, + Version: int32(BackupHeaderVersionV1), Instance: "/by-dev", MetaPath: "meta", Entries: 0, @@ -26,6 +27,6 @@ func TestBackupCodec_Serialize(t *testing.T) { assert.NoError(t, err) gotHeader, gotEntries, err := codec.DeSerialize(file) assert.NoError(t, err) - assert.True(t, reflect.DeepEqual(header, gotHeader)) + assert.Equal(t, prototext.Format(header), prototext.Format(gotHeader)) assert.True(t, reflect.DeepEqual(kvs, gotEntries)) } diff --git a/cmd/tools/migration/backend/etcd210.go b/cmd/tools/migration/backend/etcd210.go index 2aa3a10ed5de0..a4dfa049852f6 100644 --- a/cmd/tools/migration/backend/etcd210.go +++ b/cmd/tools/migration/backend/etcd210.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" clientv3 "go.etcd.io/etcd/client/v3" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/cmd/tools/migration/configs" "github.com/milvus-io/milvus/cmd/tools/migration/console" @@ -420,7 +420,7 @@ func (b etcd210) Backup(meta *meta.Meta, backupFile string) error { instance = metaRootPath } header := &BackupHeader{ - Version: BackupHeaderVersionV1, + Version: int32(BackupHeaderVersionV1), Instance: instance, MetaPath: metaPath, Entries: int64(len(saves)), @@ -472,7 +472,7 @@ func (b etcd210) BackupV2(file string) error { } header := &BackupHeader{ - Version: BackupHeaderVersionV1, + Version: int32(BackupHeaderVersionV1), Instance: instance, MetaPath: metaPath, Entries: int64(len(saves)), diff --git a/cmd/tools/migration/meta/meta210.go b/cmd/tools/migration/meta/meta210.go index 23016210660f9..06cba643d85f1 100644 --- a/cmd/tools/migration/meta/meta210.go +++ b/cmd/tools/migration/meta/meta210.go @@ -3,7 +3,7 @@ package meta import ( "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/cmd/tools/migration/legacy" diff --git a/cmd/tools/migration/meta/meta220.go b/cmd/tools/migration/meta/meta220.go index f190b4061c651..684f773ea2db2 100644 --- a/cmd/tools/migration/meta/meta220.go +++ b/cmd/tools/migration/meta/meta220.go @@ -2,7 +2,7 @@ package meta import ( "github.com/blang/semver/v4" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/cmd/tools/migration/versions" "github.com/milvus-io/milvus/internal/metastore/kv/datacoord" diff --git a/go.mod b/go.mod index 93bab4f391066..85500ddfcac3e 100644 --- a/go.mod +++ b/go.mod @@ -38,10 +38,9 @@ require ( github.com/soheilhy/cmux v0.1.5 github.com/spf13/cast v1.3.1 github.com/spf13/viper v1.8.1 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.865 - github.com/tidwall/gjson v1.14.4 github.com/tikv/client-go/v2 v2.0.4 go.etcd.io/etcd/api/v3 v3.5.5 go.etcd.io/etcd/client/v3 v3.5.5 @@ -71,6 +70,7 @@ require ( github.com/jolestar/go-commons-pool/v2 v2.1.2 github.com/milvus-io/milvus/pkg v0.0.0-00010101000000-000000000000 github.com/pkg/errors v0.9.1 + github.com/tidwall/gjson v1.17.3 github.com/valyala/fastjson v1.6.4 github.com/zeebo/xxh3 v1.0.2 google.golang.org/protobuf v1.33.0 @@ -194,7 +194,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stathat/consistent v1.0.0 // indirect github.com/streamnative/pulsarctl v0.5.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect github.com/tidwall/match v1.1.1 // indirect @@ -259,3 +259,5 @@ replace ( exclude github.com/apache/pulsar-client-go/oauth2 v0.0.0-20211108044248-fe3b7c4e445b replace github.com/greatroar/blobloom => github.com/milvus-io/blobloom v0.0.0-20240603110411-471ae49f3b93 + +replace github.com/milvus-io/milvus-proto/go-api/v2 => github.com/weiliu1031/milvus-proto/go-api/v2 v2.0.0-20240819072240-c49e4c21521a diff --git a/go.sum b/go.sum index ccf678bf68dc4..23bb4ad3d9b18 100644 --- a/go.sum +++ b/go.sum @@ -606,8 +606,6 @@ github.com/milvus-io/cgosymbolizer v0.0.0-20240722103217-b7dee0e50119 h1:9VXijWu github.com/milvus-io/cgosymbolizer v0.0.0-20240722103217-b7dee0e50119/go.mod h1:DvXTE/K/RtHehxU8/GtDs4vFtfw64jJ3PaCnFri8CRg= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZzUfIfYe5qYDBzt4ZYRqzUjTR6CvUzjat8= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4= -github.com/milvus-io/milvus-proto/go-api/v2 v2.4.10-0.20240819025435-512e3b98866a h1:0B/8Fo66D8Aa23Il0yrQvg1KKz92tE/BJ5BvkUxxAAk= -github.com/milvus-io/milvus-proto/go-api/v2 v2.4.10-0.20240819025435-512e3b98866a/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek= github.com/milvus-io/milvus-storage/go v0.0.0-20231227072638-ebd0b8e56d70 h1:Z+sp64fmAOxAG7mU0dfVOXvAXlwRB0c8a96rIM5HevI= github.com/milvus-io/milvus-storage/go v0.0.0-20231227072638-ebd0b8e56d70/go.mod h1:GPETMcTZq1gLY1WA6Na5kiNAKnq8SEMMiVKUZrM3sho= github.com/milvus-io/pulsar-client-go v0.6.10 h1:eqpJjU+/QX0iIhEo3nhOqMNXL+TyInAs1IAHZCrCM/A= @@ -836,8 +834,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -850,8 +849,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.865 h1:LcUqBlKC4j15LhT303yQDX/XxyHG4haEQqbHgZZA4SY= @@ -860,8 +859,8 @@ github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= github.com/thoas/go-funk v0.9.1/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM= -github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= -github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94= +github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= @@ -897,6 +896,8 @@ github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLr github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/weiliu1031/milvus-proto/go-api/v2 v2.0.0-20240819072240-c49e4c21521a h1:leNggCcpfG6aC6tXlDcpgjn/9dt1RwoFbpI15G3U9/I= +github.com/weiliu1031/milvus-proto/go-api/v2 v2.0.0-20240819072240-c49e4c21521a/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= diff --git a/internal/datacoord/analyze_meta.go b/internal/datacoord/analyze_meta.go index 402e5ee6a3850..02b4d92d2efc2 100644 --- a/internal/datacoord/analyze_meta.go +++ b/internal/datacoord/analyze_meta.go @@ -20,8 +20,8 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/metastore" "github.com/milvus-io/milvus/internal/proto/indexpb" diff --git a/internal/datacoord/channel.go b/internal/datacoord/channel.go index 9fcd71c0033e4..866dd1fe983cf 100644 --- a/internal/datacoord/channel.go +++ b/internal/datacoord/channel.go @@ -19,8 +19,8 @@ package datacoord import ( "fmt" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/datacoord/channel_checker.go b/internal/datacoord/channel_checker.go index 764ca2800f638..e116967fe984d 100644 --- a/internal/datacoord/channel_checker.go +++ b/internal/datacoord/channel_checker.go @@ -22,10 +22,10 @@ import ( "strconv" "time" - "github.com/golang/protobuf/proto" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/kv" diff --git a/internal/datacoord/channel_checker_test.go b/internal/datacoord/channel_checker_test.go index 5ed5e900f2851..10cea789cd6ec 100644 --- a/internal/datacoord/channel_checker_test.go +++ b/internal/datacoord/channel_checker_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" ) diff --git a/internal/datacoord/channel_manager_test.go b/internal/datacoord/channel_manager_test.go index 1dd12e52012bb..60d5b2cbdec39 100644 --- a/internal/datacoord/channel_manager_test.go +++ b/internal/datacoord/channel_manager_test.go @@ -24,11 +24,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.uber.org/atomic" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/util/dependency" diff --git a/internal/datacoord/channel_manager_v2.go b/internal/datacoord/channel_manager_v2.go index e2fe1bbab1cad..18fc386887a19 100644 --- a/internal/datacoord/channel_manager_v2.go +++ b/internal/datacoord/channel_manager_v2.go @@ -23,9 +23,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/kv" diff --git a/internal/datacoord/channel_manager_v2_test.go b/internal/datacoord/channel_manager_v2_test.go index 4bce9cf93f745..cd2d742126851 100644 --- a/internal/datacoord/channel_manager_v2_test.go +++ b/internal/datacoord/channel_manager_v2_test.go @@ -22,11 +22,11 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" kvmock "github.com/milvus-io/milvus/internal/kv/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/datacoord/channel_store.go b/internal/datacoord/channel_store.go index 66ae216fec004..2627a5dc6de71 100644 --- a/internal/datacoord/channel_store.go +++ b/internal/datacoord/channel_store.go @@ -23,10 +23,10 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/kv" diff --git a/internal/datacoord/channel_store_test.go b/internal/datacoord/channel_store_test.go index 4201259fb81a5..33fd07db55a80 100644 --- a/internal/datacoord/channel_store_test.go +++ b/internal/datacoord/channel_store_test.go @@ -21,10 +21,10 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/kv/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/datacoord/channel_store_v2.go b/internal/datacoord/channel_store_v2.go index b91d114d4d7ef..e2bed5acd9329 100644 --- a/internal/datacoord/channel_store_v2.go +++ b/internal/datacoord/channel_store_v2.go @@ -4,9 +4,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/kv" diff --git a/internal/datacoord/channel_store_v2_test.go b/internal/datacoord/channel_store_v2_test.go index 501d4a9d74bae..0e3ccd37851b9 100644 --- a/internal/datacoord/channel_store_v2_test.go +++ b/internal/datacoord/channel_store_v2_test.go @@ -5,11 +5,11 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/kv/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/datacoord/compaction_task_meta.go b/internal/datacoord/compaction_task_meta.go index 8047fd385070e..b487988a7bf2e 100644 --- a/internal/datacoord/compaction_task_meta.go +++ b/internal/datacoord/compaction_task_meta.go @@ -19,8 +19,8 @@ package datacoord import ( "context" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/metastore" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/datacoord/import_job.go b/internal/datacoord/import_job.go index 5d2da3d81f17a..44048105736dd 100644 --- a/internal/datacoord/import_job.go +++ b/internal/datacoord/import_job.go @@ -19,8 +19,8 @@ package datacoord import ( "time" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/datacoord/import_task.go b/internal/datacoord/import_task.go index 82d3c70b2f099..1261cd5854d19 100644 --- a/internal/datacoord/import_task.go +++ b/internal/datacoord/import_task.go @@ -17,7 +17,7 @@ package datacoord import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" ) diff --git a/internal/datacoord/index_meta.go b/internal/datacoord/index_meta.go index 45983c8394208..d7d0652f87de3 100644 --- a/internal/datacoord/index_meta.go +++ b/internal/datacoord/index_meta.go @@ -22,10 +22,10 @@ import ( "fmt" "strconv" - "github.com/golang/protobuf/proto" "github.com/prometheus/client_golang/prometheus" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/datacoord/meta.go b/internal/datacoord/meta.go index 8015a6beefb37..b854ff88f0e0d 100644 --- a/internal/datacoord/meta.go +++ b/internal/datacoord/meta.go @@ -26,10 +26,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" "golang.org/x/exp/maps" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/datacoord/meta_test.go b/internal/datacoord/meta_test.go index 1a3d9ba894b70..36154e8c09e3b 100644 --- a/internal/datacoord/meta_test.go +++ b/internal/datacoord/meta_test.go @@ -21,11 +21,11 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/datacoord/segment_info.go b/internal/datacoord/segment_info.go index 670d2f08d7e06..5cfaee5a160bb 100644 --- a/internal/datacoord/segment_info.go +++ b/internal/datacoord/segment_info.go @@ -19,10 +19,10 @@ package datacoord import ( "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/datacoord/server.go b/internal/datacoord/server.go index 130ce1324e005..5d44736519081 100644 --- a/internal/datacoord/server.go +++ b/internal/datacoord/server.go @@ -779,7 +779,7 @@ func (s *Server) handleDataNodeTimetickMsgstream(ctx context.Context, ttMsgStrea checker.Check() } - if err := s.handleDataNodeTtMsg(ctx, &ttMsg.DataNodeTtMsg); err != nil { + if err := s.handleDataNodeTtMsg(ctx, ttMsg.DataNodeTtMsg); err != nil { log.Warn("failed to handle timetick message", zap.Error(err)) continue } diff --git a/internal/datacoord/services_test.go b/internal/datacoord/services_test.go index 60b753e48a282..5de663ca9eb69 100644 --- a/internal/datacoord/services_test.go +++ b/internal/datacoord/services_test.go @@ -77,7 +77,7 @@ func genMsg(msgType commonpb.MsgType, ch string, t Timestamp, sourceID int64) *m BaseMsg: msgstream.BaseMsg{ HashValues: []uint32{0}, }, - DataNodeTtMsg: msgpb.DataNodeTtMsg{ + DataNodeTtMsg: &msgpb.DataNodeTtMsg{ Base: &commonpb.MsgBase{ MsgType: msgType, Timestamp: t, diff --git a/internal/datanode/compaction/clustering_compactor.go b/internal/datanode/compaction/clustering_compactor.go index 90deb758466a4..d2cef2314b3d8 100644 --- a/internal/datanode/compaction/clustering_compactor.go +++ b/internal/datanode/compaction/clustering_compactor.go @@ -31,11 +31,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datanode/allocator" diff --git a/internal/datanode/data_sync_service_test.go b/internal/datanode/data_sync_service_test.go index 55c9f58fac658..1225b7f73f999 100644 --- a/internal/datanode/data_sync_service_test.go +++ b/internal/datanode/data_sync_service_test.go @@ -528,7 +528,7 @@ func (s *DataSyncServiceSuite) TestStartStop() { EndTimestamp: tsoutil.GetCurrentTime(), HashValues: []uint32{0}, }, - TimeTickMsg: msgpb.TimeTickMsg{ + TimeTickMsg: &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: UniqueID(0), diff --git a/internal/datanode/event_manager.go b/internal/datanode/event_manager.go index 2e78195b51cb8..db67a84655441 100644 --- a/internal/datanode/event_manager.go +++ b/internal/datanode/event_manager.go @@ -24,10 +24,10 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/kv" diff --git a/internal/datanode/event_manager_test.go b/internal/datanode/event_manager_test.go index 1854c8e8c8e46..708a8e446a446 100644 --- a/internal/datanode/event_manager_test.go +++ b/internal/datanode/event_manager_test.go @@ -26,9 +26,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/datanode/flow_graph_dd_node.go b/internal/datanode/flow_graph_dd_node.go index 2e4e5cd333f0a..da46d9390d747 100644 --- a/internal/datanode/flow_graph_dd_node.go +++ b/internal/datanode/flow_graph_dd_node.go @@ -22,9 +22,9 @@ import ( "reflect" "sync/atomic" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -180,11 +180,11 @@ func (ddn *ddNode) Operate(in []Msg) []Msg { continue } - rateCol.Add(metricsinfo.InsertConsumeThroughput, float64(proto.Size(&imsg.InsertRequest))) + rateCol.Add(metricsinfo.InsertConsumeThroughput, float64(proto.Size(imsg.InsertRequest))) metrics.DataNodeConsumeBytesCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.InsertLabel). - Add(float64(proto.Size(&imsg.InsertRequest))) + Add(float64(proto.Size(imsg.InsertRequest))) metrics.DataNodeConsumeMsgCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.InsertLabel, fmt.Sprint(ddn.collectionID)). @@ -214,11 +214,11 @@ func (ddn *ddNode) Operate(in []Msg) []Msg { } log.Debug("DDNode receive delete messages", zap.String("channel", ddn.vChannelName), zap.Int64("numRows", dmsg.NumRows)) - rateCol.Add(metricsinfo.DeleteConsumeThroughput, float64(proto.Size(&dmsg.DeleteRequest))) + rateCol.Add(metricsinfo.DeleteConsumeThroughput, float64(proto.Size(dmsg.DeleteRequest))) metrics.DataNodeConsumeBytesCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.DeleteLabel). - Add(float64(proto.Size(&dmsg.DeleteRequest))) + Add(float64(proto.Size(dmsg.DeleteRequest))) metrics.DataNodeConsumeMsgCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.DeleteLabel, fmt.Sprint(ddn.collectionID)). diff --git a/internal/datanode/flow_graph_dd_node_test.go b/internal/datanode/flow_graph_dd_node_test.go index 8cf42894d81f7..d1a8b3c00e999 100644 --- a/internal/datanode/flow_graph_dd_node_test.go +++ b/internal/datanode/flow_graph_dd_node_test.go @@ -146,7 +146,7 @@ func TestFlowGraph_DDNode_Operate(t *testing.T) { } var dropCollMsg msgstream.TsMsg = &msgstream.DropCollectionMsg{ - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropCollection}, CollectionID: test.msgCollID, }, @@ -199,7 +199,7 @@ func TestFlowGraph_DDNode_Operate(t *testing.T) { } var dropPartMsg msgstream.TsMsg = &msgstream.DropPartitionMsg{ - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropPartition}, CollectionID: test.msgCollID, PartitionID: test.msgPartID, @@ -261,7 +261,7 @@ func TestFlowGraph_DDNode_Operate(t *testing.T) { EndTimestamp: test.MsgEndTs, HashValues: []uint32{0}, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Delete}, ShardName: "by-dev-rootcoord-dml-mock-0", CollectionID: test.inMsgCollID, @@ -595,7 +595,7 @@ func getInsertMsg(segmentID UniqueID, ts Timestamp) *msgstream.InsertMsg { func getInsertMsgWithChannel(segmentID UniqueID, ts Timestamp, vChannelName string) *msgstream.InsertMsg { return &msgstream.InsertMsg{ BaseMsg: msgstream.BaseMsg{EndTimestamp: ts}, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Insert}, SegmentID: segmentID, CollectionID: 1, diff --git a/internal/datanode/flow_graph_write_node.go b/internal/datanode/flow_graph_write_node.go index e00f53f2775b3..2425a9591bf50 100644 --- a/internal/datanode/flow_graph_write_node.go +++ b/internal/datanode/flow_graph_write_node.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/datanode/mock_test.go b/internal/datanode/mock_test.go index e945973971a71..b0c0821c588fa 100644 --- a/internal/datanode/mock_test.go +++ b/internal/datanode/mock_test.go @@ -751,7 +751,7 @@ func (df *DataFactory) GenMsgStreamInsertMsg(idx int, chanName string) *msgstrea BaseMsg: msgstream.BaseMsg{ HashValues: []uint32{uint32(idx)}, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -781,7 +781,7 @@ func (df *DataFactory) GenMsgStreamInsertMsgWithTs(idx int, chanName string, ts BeginTimestamp: ts, EndTimestamp: ts, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -831,7 +831,7 @@ func (df *DataFactory) GenMsgStreamDeleteMsg(pks []storage.PrimaryKey, chanName BaseMsg: msgstream.BaseMsg{ HashValues: []uint32{uint32(idx)}, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 0, @@ -857,7 +857,7 @@ func (df *DataFactory) GenMsgStreamDeleteMsgWithTs(idx int, pks []storage.Primar BeginTimestamp: ts, EndTimestamp: ts, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, diff --git a/internal/datanode/stats_updater.go b/internal/datanode/stats_updater.go index 2f25c88136bba..87be27044e02b 100644 --- a/internal/datanode/stats_updater.go +++ b/internal/datanode/stats_updater.go @@ -58,7 +58,7 @@ func (u *mqStatsUpdater) send(ts Timestamp, segmentIDs []int64) error { EndTimestamp: ts, HashValues: []uint32{0}, }, - DataNodeTtMsg: msgpb.DataNodeTtMsg{ + DataNodeTtMsg: &msgpb.DataNodeTtMsg{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_DataNodeTt), commonpbutil.WithTimeStamp(ts), diff --git a/internal/datanode/writebuffer/bf_write_buffer_test.go b/internal/datanode/writebuffer/bf_write_buffer_test.go index f4796930e8d48..7cfe976b2c0dd 100644 --- a/internal/datanode/writebuffer/bf_write_buffer_test.go +++ b/internal/datanode/writebuffer/bf_write_buffer_test.go @@ -132,7 +132,7 @@ func (s *BFWriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim } flatten := lo.Flatten(vectors) return tss, &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ SegmentID: segmentID, Version: msgpb.InsertDataVersion_ColumnBased, RowIDs: tss, @@ -183,7 +183,7 @@ func (s *BFWriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim func (s *BFWriteBufferSuite) composeDeleteMsg(pks []storage.PrimaryKey) *msgstream.DeleteMsg { delMsg := &msgstream.DeleteMsg{ - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ PrimaryKeys: storage.ParsePrimaryKeys2IDs(pks), Timestamps: lo.RepeatBy(len(pks), func(idx int) uint64 { return tsoutil.ComposeTSByTime(time.Now(), int64(idx+1)) }), }, diff --git a/internal/datanode/writebuffer/insert_buffer_test.go b/internal/datanode/writebuffer/insert_buffer_test.go index a55b286c88dce..bcb54aebc9f9f 100644 --- a/internal/datanode/writebuffer/insert_buffer_test.go +++ b/internal/datanode/writebuffer/insert_buffer_test.go @@ -53,7 +53,7 @@ func (s *InsertBufferSuite) composeInsertMsg(rowCount int, dim int) ([]int64, *m }) flatten := lo.Flatten(vectors) return tss, &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Version: msgpb.InsertDataVersion_ColumnBased, RowIDs: tss, Timestamps: lo.Map(tss, func(id int64, _ int) uint64 { return uint64(id) }), diff --git a/internal/datanode/writebuffer/l0_write_buffer_test.go b/internal/datanode/writebuffer/l0_write_buffer_test.go index 0cd644cf1dff8..5d79a25b40203 100644 --- a/internal/datanode/writebuffer/l0_write_buffer_test.go +++ b/internal/datanode/writebuffer/l0_write_buffer_test.go @@ -103,7 +103,7 @@ func (s *L0WriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim } } return tss, &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ SegmentID: segmentID, Version: msgpb.InsertDataVersion_ColumnBased, RowIDs: tss, @@ -154,7 +154,7 @@ func (s *L0WriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim func (s *L0WriteBufferSuite) composeDeleteMsg(pks []storage.PrimaryKey) *msgstream.DeleteMsg { delMsg := &msgstream.DeleteMsg{ - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ PrimaryKeys: storage.ParsePrimaryKeys2IDs(pks), Timestamps: lo.RepeatBy(len(pks), func(idx int) uint64 { return tsoutil.ComposeTSByTime(time.Now(), int64(idx)+1) }), }, diff --git a/internal/distributed/proxy/httpserver/handler.go b/internal/distributed/proxy/httpserver/handler.go index 2685448874ec7..6b781181d9d6f 100644 --- a/internal/distributed/proxy/httpserver/handler.go +++ b/internal/distributed/proxy/httpserver/handler.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/gin-gonic/gin" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/types" diff --git a/internal/distributed/proxy/httpserver/handler_test.go b/internal/distributed/proxy/httpserver/handler_test.go index cdfff887ca9fc..4b69022229a7c 100644 --- a/internal/distributed/proxy/httpserver/handler_test.go +++ b/internal/distributed/proxy/httpserver/handler_test.go @@ -209,7 +209,7 @@ func (m *mockProxyComponent) Query(ctx context.Context, request *milvuspb.QueryR return &queryResult, nil } -var flushResult = milvuspb.FlushResponse{ +var flushResult = &milvuspb.FlushResponse{ DbName: "default", } @@ -217,10 +217,10 @@ func (m *mockProxyComponent) Flush(ctx context.Context, request *milvuspb.FlushR if len(request.CollectionNames) < 1 { return nil, errors.New("body parse err") } - return &flushResult, nil + return flushResult, nil } -var calcDistanceResult = milvuspb.CalcDistanceResults{ +var calcDistanceResult = &milvuspb.CalcDistanceResults{ Array: &milvuspb.CalcDistanceResults_IntDist{ IntDist: &schemapb.IntArray{ Data: []int32{1, 2, 3}, @@ -232,7 +232,7 @@ func (m *mockProxyComponent) CalcDistance(ctx context.Context, request *milvuspb if len(request.Params) < 1 { return nil, errors.New("body parse err") } - return &calcDistanceResult, nil + return calcDistanceResult, nil } func (m *mockProxyComponent) GetFlushState(ctx context.Context, request *milvuspb.GetFlushStateRequest) (*milvuspb.GetFlushStateResponse, error) { diff --git a/internal/distributed/proxy/httpserver/handler_v1.go b/internal/distributed/proxy/httpserver/handler_v1.go index af200a9be72bb..9e6003e6d53bc 100644 --- a/internal/distributed/proxy/httpserver/handler_v1.go +++ b/internal/distributed/proxy/httpserver/handler_v1.go @@ -8,10 +8,10 @@ import ( "github.com/cockroachdb/errors" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" - "github.com/golang/protobuf/proto" "github.com/tidwall/gjson" "go.uber.org/zap" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/distributed/proxy/httpserver/handler_v2.go b/internal/distributed/proxy/httpserver/handler_v2.go index f7a23a1f81ed7..77f8c18deceae 100644 --- a/internal/distributed/proxy/httpserver/handler_v2.go +++ b/internal/distributed/proxy/httpserver/handler_v2.go @@ -13,13 +13,13 @@ import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" validator "github.com/go-playground/validator/v10" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/tidwall/gjson" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/distributed/proxy/httpserver/handler_v2_test.go b/internal/distributed/proxy/httpserver/handler_v2_test.go index 1a97ebe7ff008..deaa09b6365c5 100644 --- a/internal/distributed/proxy/httpserver/handler_v2_test.go +++ b/internal/distributed/proxy/httpserver/handler_v2_test.go @@ -1359,10 +1359,10 @@ func TestSearchV2(t *testing.T) { bfloat16VectorField.Name = "bfloat16Vector" sparseFloatVectorField := generateVectorFieldSchema(schemapb.DataType_SparseFloatVector) sparseFloatVectorField.Name = "sparseFloatVector" - collSchema.Fields = append(collSchema.Fields, &binaryVectorField) - collSchema.Fields = append(collSchema.Fields, &float16VectorField) - collSchema.Fields = append(collSchema.Fields, &bfloat16VectorField) - collSchema.Fields = append(collSchema.Fields, &sparseFloatVectorField) + collSchema.Fields = append(collSchema.Fields, binaryVectorField) + collSchema.Fields = append(collSchema.Fields, float16VectorField) + collSchema.Fields = append(collSchema.Fields, bfloat16VectorField) + collSchema.Fields = append(collSchema.Fields, sparseFloatVectorField) mp.EXPECT().DescribeCollection(mock.Anything, mock.Anything).Return(&milvuspb.DescribeCollectionResponse{ CollectionName: DefaultCollectionName, Schema: collSchema, diff --git a/internal/distributed/proxy/httpserver/utils.go b/internal/distributed/proxy/httpserver/utils.go index 93b38ab683119..e05d871f801f4 100644 --- a/internal/distributed/proxy/httpserver/utils.go +++ b/internal/distributed/proxy/httpserver/utils.go @@ -10,10 +10,10 @@ import ( "strings" "github.com/gin-gonic/gin" - "github.com/golang/protobuf/proto" "github.com/spf13/cast" "github.com/tidwall/gjson" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/distributed/proxy/httpserver/utils_test.go b/internal/distributed/proxy/httpserver/utils_test.go index f860bb37fb125..897728f38de51 100644 --- a/internal/distributed/proxy/httpserver/utils_test.go +++ b/internal/distributed/proxy/httpserver/utils_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/tidwall/gjson" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" @@ -27,8 +27,8 @@ const ( var DefaultScores = []float32{0.01, 0.04, 0.09} -func generatePrimaryField(datatype schemapb.DataType) schemapb.FieldSchema { - return schemapb.FieldSchema{ +func generatePrimaryField(datatype schemapb.DataType) *schemapb.FieldSchema { + return &schemapb.FieldSchema{ FieldID: common.StartOfUserFieldID, Name: FieldBookID, IsPrimaryKey: true, @@ -69,12 +69,12 @@ func generateIDs(dataType schemapb.DataType, num int) *schemapb.IDs { return nil } -func generateVectorFieldSchema(dataType schemapb.DataType) schemapb.FieldSchema { +func generateVectorFieldSchema(dataType schemapb.DataType) *schemapb.FieldSchema { dim := "2" if dataType == schemapb.DataType_BinaryVector { dim = "8" } - return schemapb.FieldSchema{ + return &schemapb.FieldSchema{ FieldID: common.StartOfUserFieldID + int64(dataType), IsPrimaryKey: false, DataType: dataType, @@ -97,14 +97,14 @@ func generateCollectionSchema(primaryDataType schemapb.DataType) *schemapb.Colle Description: "", AutoID: false, Fields: []*schemapb.FieldSchema{ - &primaryField, { + primaryField, { FieldID: common.StartOfUserFieldID + 1, Name: FieldWordCount, IsPrimaryKey: false, Description: "", DataType: 5, AutoID: false, - }, &vectorField, + }, vectorField, }, EnableDynamicField: true, } @@ -465,14 +465,14 @@ func TestPrimaryField(t *testing.T) { primaryField := generatePrimaryField(schemapb.DataType_Int64) field, ok := getPrimaryField(coll) assert.Equal(t, true, ok) - assert.Equal(t, primaryField, *field) + assert.EqualExportedValues(t, primaryField, field) assert.Equal(t, "1,2,3", joinArray([]int64{1, 2, 3})) assert.Equal(t, "1,2,3", joinArray([]string{"1", "2", "3"})) jsonStr := "{\"id\": [1, 2, 3]}" idStr := gjson.Get(jsonStr, "id") - rangeStr, err := convertRange(&primaryField, idStr) + rangeStr, err := convertRange(primaryField, idStr) assert.Equal(t, nil, err) assert.Equal(t, "1,2,3", rangeStr) filter, err := checkGetPrimaryKey(coll, idStr) @@ -482,7 +482,7 @@ func TestPrimaryField(t *testing.T) { primaryField = generatePrimaryField(schemapb.DataType_VarChar) jsonStr = "{\"id\": [\"1\", \"2\", \"3\"]}" idStr = gjson.Get(jsonStr, "id") - rangeStr, err = convertRange(&primaryField, idStr) + rangeStr, err = convertRange(primaryField, idStr) assert.Equal(t, nil, err) assert.Equal(t, `"1","2","3"`, rangeStr) coll2 := generateCollectionSchema(schemapb.DataType_VarChar) @@ -524,7 +524,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &floatVectorField, + primaryField, floatVectorField, }, EnableDynamicField: true, }) @@ -533,7 +533,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &binaryVectorField, + primaryField, binaryVectorField, }, EnableDynamicField: true, }) @@ -542,7 +542,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &float16VectorField, + primaryField, float16VectorField, }, EnableDynamicField: true, }) @@ -551,7 +551,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &bfloat16VectorField, + primaryField, bfloat16VectorField, }, EnableDynamicField: true, }) @@ -1293,7 +1293,7 @@ func TestVector(t *testing.T) { Description: "", AutoID: false, Fields: []*schemapb.FieldSchema{ - &primaryField, &floatVectorField, &binaryVectorField, &float16VectorField, &bfloat16VectorField, &sparseFloatVectorField, + primaryField, floatVectorField, binaryVectorField, float16VectorField, bfloat16VectorField, sparseFloatVectorField, }, EnableDynamicField: true, } diff --git a/internal/distributed/proxy/httpserver/wrap_request.go b/internal/distributed/proxy/httpserver/wrap_request.go index 79d2f0dfa80c4..045dbf13d568e 100644 --- a/internal/distributed/proxy/httpserver/wrap_request.go +++ b/internal/distributed/proxy/httpserver/wrap_request.go @@ -7,7 +7,7 @@ import ( "math" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/metastore/kv/binlog/binlog_test.go b/internal/metastore/kv/binlog/binlog_test.go index 3c2c5114b5f27..3437ce742540e 100644 --- a/internal/metastore/kv/binlog/binlog_test.go +++ b/internal/metastore/kv/binlog/binlog_test.go @@ -20,8 +20,8 @@ import ( "math/rand" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/metastore/kv/datacoord/kv_catalog.go b/internal/metastore/kv/datacoord/kv_catalog.go index 8904424fd806f..9899b506e3b92 100644 --- a/internal/metastore/kv/datacoord/kv_catalog.go +++ b/internal/metastore/kv/datacoord/kv_catalog.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" "go.uber.org/zap" "golang.org/x/exp/maps" "golang.org/x/sync/errgroup" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/metastore/kv/datacoord/kv_catalog_test.go b/internal/metastore/kv/datacoord/kv_catalog_test.go index f7aaa47ac6b37..3c2e76999e381 100644 --- a/internal/metastore/kv/datacoord/kv_catalog_test.go +++ b/internal/metastore/kv/datacoord/kv_catalog_test.go @@ -27,10 +27,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "golang.org/x/exp/maps" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -1364,7 +1364,7 @@ func TestCatalog_Import(t *testing.T) { assert.NoError(t, err) err = kc.SaveImportJob(nil) - assert.Error(t, err) + assert.NoError(t, err) txn = mocks.NewMetaKv(t) txn.EXPECT().Save(mock.Anything, mock.Anything).Return(mockErr) @@ -1418,7 +1418,7 @@ func TestCatalog_Import(t *testing.T) { assert.NoError(t, err) err = kc.SavePreImportTask(nil) - assert.Error(t, err) + assert.NoError(t, err) txn = mocks.NewMetaKv(t) txn.EXPECT().Save(mock.Anything, mock.Anything).Return(mockErr) @@ -1472,7 +1472,7 @@ func TestCatalog_Import(t *testing.T) { assert.NoError(t, err) err = kc.SaveImportTask(nil) - assert.Error(t, err) + assert.NoError(t, err) txn = mocks.NewMetaKv(t) txn.EXPECT().Save(mock.Anything, mock.Anything).Return(mockErr) diff --git a/internal/metastore/kv/datacoord/util.go b/internal/metastore/kv/datacoord/util.go index 3c57e8e483563..be924c03b0f6b 100644 --- a/internal/metastore/kv/datacoord/util.go +++ b/internal/metastore/kv/datacoord/util.go @@ -19,8 +19,8 @@ package datacoord import ( "fmt" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/metastore/kv/querycoord/kv_catalog.go b/internal/metastore/kv/querycoord/kv_catalog.go index 97b141ed154d6..aee78b53928c0 100644 --- a/internal/metastore/kv/querycoord/kv_catalog.go +++ b/internal/metastore/kv/querycoord/kv_catalog.go @@ -6,11 +6,11 @@ import ( "io" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/klauspost/compress/zstd" "github.com/pingcap/log" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/metastore/kv/rootcoord/kv_catalog.go b/internal/metastore/kv/rootcoord/kv_catalog.go index f3c8463926f4b..049ff40284044 100644 --- a/internal/metastore/kv/rootcoord/kv_catalog.go +++ b/internal/metastore/kv/rootcoord/kv_catalog.go @@ -7,9 +7,9 @@ import ( "sort" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/metastore/kv/rootcoord/kv_catalog_test.go b/internal/metastore/kv/rootcoord/kv_catalog_test.go index fbdf8c244c0e7..b56a5b7801d5d 100644 --- a/internal/metastore/kv/rootcoord/kv_catalog_test.go +++ b/internal/metastore/kv/rootcoord/kv_catalog_test.go @@ -9,13 +9,13 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.uber.org/atomic" "go.uber.org/zap" "golang.org/x/exp/maps" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" @@ -1273,7 +1273,7 @@ func TestCatalog_DropCollection(t *testing.T) { } func getUserInfoMetaString(username string) string { - validInfo := internalpb.CredentialInfo{Username: username, EncryptedPassword: "pwd" + username} + validInfo := &internalpb.CredentialInfo{Username: username, EncryptedPassword: "pwd" + username} validBytes, _ := json.Marshal(validInfo) return string(validBytes) } diff --git a/internal/metastore/model/index.go b/internal/metastore/model/index.go index ffbecd13a5167..1e44ebeb0db86 100644 --- a/internal/metastore/model/index.go +++ b/internal/metastore/model/index.go @@ -1,7 +1,7 @@ package model import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/indexpb" diff --git a/internal/proxy/accesslog/info/grpc_info.go b/internal/proxy/accesslog/info/grpc_info.go index 570ac03889d8e..b42a6c4c7de28 100644 --- a/internal/proxy/accesslog/info/grpc_info.go +++ b/internal/proxy/accesslog/info/grpc_info.go @@ -22,13 +22,13 @@ import ( "path" "time" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/database_interceptor_test.go b/internal/proxy/database_interceptor_test.go index 91bafffb62869..92aad0ad74ef2 100644 --- a/internal/proxy/database_interceptor_test.go +++ b/internal/proxy/database_interceptor_test.go @@ -4,10 +4,11 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/pkg/util" @@ -133,7 +134,7 @@ func TestDatabaseInterceptor(t *testing.T) { assert.NoError(t, err) if len(after) != len(before) { - t.Errorf("req has been modified:%s", req.String()) + t.Errorf("req has been modified:%s", prototext.Format(req)) } } }) diff --git a/internal/proxy/impl.go b/internal/proxy/impl.go index c32e096766da3..6359d9c127bc1 100644 --- a/internal/proxy/impl.go +++ b/internal/proxy/impl.go @@ -26,11 +26,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/zap" "golang.org/x/sync/errgroup" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/federpb" @@ -2515,7 +2515,7 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest) BaseMsg: msgstream.BaseMsg{ HashValues: request.HashKeys, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithSourceID(paramtable.GetNodeID()), diff --git a/internal/proxy/impl_test.go b/internal/proxy/impl_test.go index 53f0ef9da172b..c9f7f2439ef3f 100644 --- a/internal/proxy/impl_test.go +++ b/internal/proxy/impl_test.go @@ -1421,14 +1421,13 @@ func TestProxy_ReplicateMessage(t *testing.T) { } { - timeTickResult := msgpb.TimeTickMsg{} timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: 1, EndTimestamp: 10, HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{}, } msgBytes, _ := timeTickMsg.Marshal(timeTickMsg) resp, err := node.ReplicateMessage(context.TODO(), &milvuspb.ReplicateMessageRequest{ @@ -1441,20 +1440,19 @@ func TestProxy_ReplicateMessage(t *testing.T) { } { - timeTickResult := msgpb.TimeTickMsg{ - Base: commonpbutil.NewMsgBase( - commonpbutil.WithMsgType(commonpb.MsgType(-1)), - commonpbutil.WithTimeStamp(10), - commonpbutil.WithSourceID(-1), - ), - } timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: 1, EndTimestamp: 10, HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{ + Base: commonpbutil.NewMsgBase( + commonpbutil.WithMsgType(commonpb.MsgType(-1)), + commonpbutil.WithTimeStamp(10), + commonpbutil.WithSourceID(-1), + ), + }, } msgBytes, _ := timeTickMsg.Marshal(timeTickMsg) resp, err := node.ReplicateMessage(context.TODO(), &milvuspb.ReplicateMessageRequest{ @@ -1512,7 +1510,7 @@ func TestProxy_ReplicateMessage(t *testing.T) { MsgID: []byte("mock message id 2"), }, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 10001, diff --git a/internal/proxy/lb_policy_test.go b/internal/proxy/lb_policy_test.go index bf3c32c896de3..86551df24a6d5 100644 --- a/internal/proxy/lb_policy_test.go +++ b/internal/proxy/lb_policy_test.go @@ -21,10 +21,10 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/atomic" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/msg_pack.go b/internal/proxy/msg_pack.go index 1177bd8adc1dd..426cc0a9d1f7b 100644 --- a/internal/proxy/msg_pack.go +++ b/internal/proxy/msg_pack.go @@ -50,7 +50,7 @@ func genInsertMsgsByPartition(ctx context.Context, // create empty insert message createInsertMsg := func(segmentID UniqueID, channelName string) *msgstream.InsertMsg { - insertReq := msgpb.InsertRequest{ + insertReq := &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithTimeStamp(insertMsg.BeginTimestamp), // entity's timestamp was set to equal it.BeginTimestamp in preExecute() @@ -63,9 +63,8 @@ func genInsertMsgsByPartition(ctx context.Context, SegmentID: segmentID, ShardName: channelName, Version: msgpb.InsertDataVersion_ColumnBased, + FieldsData: make([]*schemapb.FieldData, len(insertMsg.GetFieldsData())), } - insertReq.FieldsData = make([]*schemapb.FieldData, len(insertMsg.GetFieldsData())) - msg := &msgstream.InsertMsg{ BaseMsg: msgstream.BaseMsg{ Ctx: ctx, diff --git a/internal/proxy/msg_pack_test.go b/internal/proxy/msg_pack_test.go index f41e0516296b7..29873f11b0821 100644 --- a/internal/proxy/msg_pack_test.go +++ b/internal/proxy/msg_pack_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" @@ -91,7 +91,7 @@ func TestRepackInsertData(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -201,7 +201,7 @@ func TestRepackInsertDataWithPartitionKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, diff --git a/internal/proxy/proxy_test.go b/internal/proxy/proxy_test.go index 4abdd24597072..5ace8e5108f0d 100644 --- a/internal/proxy/proxy_test.go +++ b/internal/proxy/proxy_test.go @@ -31,7 +31,6 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" @@ -40,6 +39,7 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/keepalive" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/rate_limit_interceptor.go b/internal/proxy/rate_limit_interceptor.go index 0185237ea1b49..c671512b48716 100644 --- a/internal/proxy/rate_limit_interceptor.go +++ b/internal/proxy/rate_limit_interceptor.go @@ -21,9 +21,9 @@ import ( "fmt" "strconv" - "github.com/golang/protobuf/proto" "go.uber.org/zap" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/proxy/rate_limit_interceptor_test.go b/internal/proxy/rate_limit_interceptor_test.go index 9004bc8d56858..f690f0ccb63f3 100644 --- a/internal/proxy/rate_limit_interceptor_test.go +++ b/internal/proxy/rate_limit_interceptor_test.go @@ -21,10 +21,10 @@ import ( "testing" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/rootcoord_mock_test.go b/internal/proxy/rootcoord_mock_test.go index 166a64e5c859a..a7c8f96e24cad 100644 --- a/internal/proxy/rootcoord_mock_test.go +++ b/internal/proxy/rootcoord_mock_test.go @@ -24,8 +24,8 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/search_util.go b/internal/proxy/search_util.go index 2adfb3e3757d6..544fe85c4de93 100644 --- a/internal/proxy/search_util.go +++ b/internal/proxy/search_util.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task.go b/internal/proxy/task.go index c4e096650f80d..0cc4424dec121 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -23,8 +23,8 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_delete.go b/internal/proxy/task_delete.go index f3a523f967ccd..4e2e202325467 100644 --- a/internal/proxy/task_delete.go +++ b/internal/proxy/task_delete.go @@ -6,10 +6,10 @@ import ( "io" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" @@ -202,26 +202,25 @@ func (dt *deleteTask) newDeleteMsg(ctx context.Context) (*msgstream.DeleteMsg, e if err != nil { return nil, errors.Wrap(err, "failed to allocate MsgID of delete") } - sliceRequest := msgpb.DeleteRequest{ - Base: commonpbutil.NewMsgBase( - commonpbutil.WithMsgType(commonpb.MsgType_Delete), - // msgid of delete msg must be set - // or it will be seen as duplicated msg in mq - commonpbutil.WithMsgID(msgid), - commonpbutil.WithTimeStamp(dt.ts), - commonpbutil.WithSourceID(paramtable.GetNodeID()), - ), - CollectionID: dt.collectionID, - PartitionID: dt.partitionID, - CollectionName: dt.req.GetCollectionName(), - PartitionName: dt.req.GetPartitionName(), - PrimaryKeys: &schemapb.IDs{}, - } return &msgstream.DeleteMsg{ BaseMsg: msgstream.BaseMsg{ Ctx: ctx, }, - DeleteRequest: sliceRequest, + DeleteRequest: &msgpb.DeleteRequest{ + Base: commonpbutil.NewMsgBase( + commonpbutil.WithMsgType(commonpb.MsgType_Delete), + // msgid of delete msg must be set + // or it will be seen as duplicated msg in mq + commonpbutil.WithMsgID(msgid), + commonpbutil.WithTimeStamp(dt.ts), + commonpbutil.WithSourceID(paramtable.GetNodeID()), + ), + CollectionID: dt.collectionID, + PartitionID: dt.partitionID, + CollectionName: dt.req.GetCollectionName(), + PartitionName: dt.req.GetPartitionName(), + PrimaryKeys: &schemapb.IDs{}, + }, }, nil } diff --git a/internal/proxy/task_insert_test.go b/internal/proxy/task_insert_test.go index 4fa7480d23ca8..a397b1ecdc330 100644 --- a/internal/proxy/task_insert_test.go +++ b/internal/proxy/task_insert_test.go @@ -22,7 +22,7 @@ func TestInsertTask_CheckAligned(t *testing.T) { // passed NumRows is less than 0 case1 := insertTask{ insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -52,7 +52,7 @@ func TestInsertTask_CheckAligned(t *testing.T) { dim := 128 case2 := insertTask{ insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -275,7 +275,7 @@ func TestInsertTask(t *testing.T) { it := insertTask{ ctx: context.Background(), insertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: collectionName, }, }, @@ -297,7 +297,7 @@ func TestMaxInsertSize(t *testing.T) { it := insertTask{ ctx: context.Background(), insertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ DbName: "hooooooo", CollectionName: "fooooo", }, diff --git a/internal/proxy/task_query.go b/internal/proxy/task_query.go index 60f808e52381d..40fb5c8e2ac52 100644 --- a/internal/proxy/task_query.go +++ b/internal/proxy/task_query.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_query_test.go b/internal/proxy/task_query_test.go index 07631390d7a7b..06d318f6c726a 100644 --- a/internal/proxy/task_query_test.go +++ b/internal/proxy/task_query_test.go @@ -22,11 +22,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_scheduler_test.go b/internal/proxy/task_scheduler_test.go index 771a5eb9f1d86..9b16150b4cf5e 100644 --- a/internal/proxy/task_scheduler_test.go +++ b/internal/proxy/task_scheduler_test.go @@ -582,7 +582,7 @@ func TestTaskScheduler_concurrentPushAndPop(t *testing.T) { it := &insertTask{ ctx: context.Background(), insertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{}, CollectionName: collectionName, }, diff --git a/internal/proxy/task_search.go b/internal/proxy/task_search.go index f9263497ac468..18e7260fb6f00 100644 --- a/internal/proxy/task_search.go +++ b/internal/proxy/task_search.go @@ -7,10 +7,10 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_search_test.go b/internal/proxy/task_search_test.go index 84457f9d0c10d..66cb0dba90cf7 100644 --- a/internal/proxy/task_search_test.go +++ b/internal/proxy/task_search_test.go @@ -23,12 +23,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_statistic.go b/internal/proxy/task_statistic.go index 20425151fa0d4..09e43b64df506 100644 --- a/internal/proxy/task_statistic.go +++ b/internal/proxy/task_statistic.go @@ -6,9 +6,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_statistic_test.go b/internal/proxy/task_statistic_test.go index 2288d4c23ab79..c3438d0f13465 100644 --- a/internal/proxy/task_statistic_test.go +++ b/internal/proxy/task_statistic_test.go @@ -20,9 +20,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/proxy/task_test.go b/internal/proxy/task_test.go index 2430b7268bec6..a85813c6330b8 100644 --- a/internal/proxy/task_test.go +++ b/internal/proxy/task_test.go @@ -27,10 +27,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" @@ -1712,7 +1712,7 @@ func TestTask_Int64PrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1906,7 +1906,7 @@ func TestTask_VarCharPrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1962,7 +1962,7 @@ func TestTask_VarCharPrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1979,7 +1979,7 @@ func TestTask_VarCharPrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 0, @@ -3322,7 +3322,7 @@ func TestPartitionKey(t *testing.T) { it := &insertTask{ insertMsg: &BaseInsertTask{ BaseMsg: msgstream.BaseMsg{}, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, diff --git a/internal/proxy/task_upsert.go b/internal/proxy/task_upsert.go index 550e95d7b5580..ed82be44bb286 100644 --- a/internal/proxy/task_upsert.go +++ b/internal/proxy/task_upsert.go @@ -324,7 +324,7 @@ func (it *upsertTask) PreExecute(ctx context.Context) error { it.upsertMsg = &msgstream.UpsertMsg{ InsertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithSourceID(paramtable.GetNodeID()), @@ -338,7 +338,7 @@ func (it *upsertTask) PreExecute(ctx context.Context) error { }, }, DeleteMsg: &msgstream.DeleteMsg{ - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Delete), commonpbutil.WithSourceID(paramtable.GetNodeID()), @@ -466,7 +466,7 @@ func (it *upsertTask) deleteExecute(ctx context.Context, msgPack *msgstream.MsgP if err != nil { errors.Wrap(err, "failed to allocate MsgID for delete of upsert") } - sliceRequest := msgpb.DeleteRequest{ + sliceRequest := &msgpb.DeleteRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Delete), commonpbutil.WithTimeStamp(ts), diff --git a/internal/proxy/task_upsert_test.go b/internal/proxy/task_upsert_test.go index 032ee18b21ab0..a23162e0f8342 100644 --- a/internal/proxy/task_upsert_test.go +++ b/internal/proxy/task_upsert_test.go @@ -41,11 +41,11 @@ func TestUpsertTask_CheckAligned(t *testing.T) { }, upsertMsg: &msgstream.UpsertMsg{ InsertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{}, + InsertRequest: &msgpb.InsertRequest{}, }, }, } - case1.upsertMsg.InsertMsg.InsertRequest = msgpb.InsertRequest{ + case1.upsertMsg.InsertMsg.InsertRequest = &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), ), @@ -102,7 +102,7 @@ func TestUpsertTask_CheckAligned(t *testing.T) { schema: schema, upsertMsg: &msgstream.UpsertMsg{ InsertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{}, + InsertRequest: &msgpb.InsertRequest{}, }, }, } @@ -120,7 +120,7 @@ func TestUpsertTask_CheckAligned(t *testing.T) { newBinaryVectorFieldData("BinaryVector", numRows, dim), newScalarFieldData(varCharFieldSchema, "VarChar", numRows), } - case2.upsertMsg.InsertMsg.InsertRequest = msgpb.InsertRequest{ + case2.upsertMsg.InsertMsg.InsertRequest = &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), ), diff --git a/internal/proxy/util.go b/internal/proxy/util.go index 6f9c4fd403018..bb9f027bff6fb 100644 --- a/internal/proxy/util.go +++ b/internal/proxy/util.go @@ -1567,52 +1567,52 @@ func SendReplicateMessagePack(ctx context.Context, replicateMsgStream msgstream. case *milvuspb.CreateDatabaseRequest: tsMsg = &msgstream.CreateDatabaseMsg{ BaseMsg: getBaseMsg(ctx, ts), - CreateDatabaseRequest: *r, + CreateDatabaseRequest: r, } case *milvuspb.DropDatabaseRequest: tsMsg = &msgstream.DropDatabaseMsg{ BaseMsg: getBaseMsg(ctx, ts), - DropDatabaseRequest: *r, + DropDatabaseRequest: r, } case *milvuspb.FlushRequest: tsMsg = &msgstream.FlushMsg{ BaseMsg: getBaseMsg(ctx, ts), - FlushRequest: *r, + FlushRequest: r, } case *milvuspb.LoadCollectionRequest: tsMsg = &msgstream.LoadCollectionMsg{ BaseMsg: getBaseMsg(ctx, ts), - LoadCollectionRequest: *r, + LoadCollectionRequest: r, } case *milvuspb.ReleaseCollectionRequest: tsMsg = &msgstream.ReleaseCollectionMsg{ BaseMsg: getBaseMsg(ctx, ts), - ReleaseCollectionRequest: *r, + ReleaseCollectionRequest: r, } case *milvuspb.CreateIndexRequest: tsMsg = &msgstream.CreateIndexMsg{ BaseMsg: getBaseMsg(ctx, ts), - CreateIndexRequest: *r, + CreateIndexRequest: r, } case *milvuspb.DropIndexRequest: tsMsg = &msgstream.DropIndexMsg{ BaseMsg: getBaseMsg(ctx, ts), - DropIndexRequest: *r, + DropIndexRequest: r, } case *milvuspb.LoadPartitionsRequest: tsMsg = &msgstream.LoadPartitionsMsg{ BaseMsg: getBaseMsg(ctx, ts), - LoadPartitionsRequest: *r, + LoadPartitionsRequest: r, } case *milvuspb.ReleasePartitionsRequest: tsMsg = &msgstream.ReleasePartitionsMsg{ BaseMsg: getBaseMsg(ctx, ts), - ReleasePartitionsRequest: *r, + ReleasePartitionsRequest: r, } case *milvuspb.AlterIndexRequest: tsMsg = &msgstream.AlterIndexMsg{ BaseMsg: getBaseMsg(ctx, ts), - AlterIndexRequest: *r, + AlterIndexRequest: r, } default: log.Warn("unknown request", zap.Any("request", request)) diff --git a/internal/proxy/util_test.go b/internal/proxy/util_test.go index 08b6b07621435..a1d5d013962ef 100644 --- a/internal/proxy/util_test.go +++ b/internal/proxy/util_test.go @@ -1136,7 +1136,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { Fields: []*schemapb.FieldSchema{}, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1168,7 +1168,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1202,7 +1202,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1231,7 +1231,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1259,7 +1259,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1287,7 +1287,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1321,7 +1321,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1365,7 +1365,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1399,7 +1399,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1432,7 +1432,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1465,7 +1465,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1507,7 +1507,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1549,7 +1549,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1592,7 +1592,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1628,7 +1628,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { Fields: []*schemapb.FieldSchema{}, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1663,7 +1663,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1705,7 +1705,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1747,7 +1747,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1793,7 +1793,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { Fields: []*schemapb.FieldSchema{}, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1830,7 +1830,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1873,7 +1873,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1918,7 +1918,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1963,7 +1963,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2009,7 +2009,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2048,7 +2048,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2089,7 +2089,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2219,7 +2219,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData(jsonData) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2248,7 +2248,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData(jsonData) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2276,7 +2276,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData(jsonData) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2292,7 +2292,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData([][]byte{[]byte(data)}) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2305,7 +2305,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { t.Run("no json data", func(t *testing.T) { schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{}, NumRows: 1, diff --git a/internal/querycoordv2/dist/dist_handler.go b/internal/querycoordv2/dist/dist_handler.go index ac1abbd360c0a..e737aa4bdc311 100644 --- a/internal/querycoordv2/dist/dist_handler.go +++ b/internal/querycoordv2/dist/dist_handler.go @@ -21,9 +21,9 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/querycoordv2/meta/channel_dist_manager.go b/internal/querycoordv2/meta/channel_dist_manager.go index 890e67f30158e..9ecd29d06efe5 100644 --- a/internal/querycoordv2/meta/channel_dist_manager.go +++ b/internal/querycoordv2/meta/channel_dist_manager.go @@ -19,8 +19,8 @@ package meta import ( "sync" - "github.com/golang/protobuf/proto" "github.com/samber/lo" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/util/typeutil" diff --git a/internal/querycoordv2/meta/collection_manager.go b/internal/querycoordv2/meta/collection_manager.go index b5b5bdbe7928f..8a1b3ff1a336b 100644 --- a/internal/querycoordv2/meta/collection_manager.go +++ b/internal/querycoordv2/meta/collection_manager.go @@ -23,10 +23,10 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/metastore" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querycoordv2/meta/replica.go b/internal/querycoordv2/meta/replica.go index 387dc910d57d1..217dfc7144747 100644 --- a/internal/querycoordv2/meta/replica.go +++ b/internal/querycoordv2/meta/replica.go @@ -1,7 +1,7 @@ package meta import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/querypb" "github.com/milvus-io/milvus/pkg/util/paramtable" diff --git a/internal/querycoordv2/meta/replica_manager_test.go b/internal/querycoordv2/meta/replica_manager_test.go index 36db70a73845c..55d3c471a12c6 100644 --- a/internal/querycoordv2/meta/replica_manager_test.go +++ b/internal/querycoordv2/meta/replica_manager_test.go @@ -19,9 +19,9 @@ package meta import ( "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" diff --git a/internal/querycoordv2/meta/resource_group.go b/internal/querycoordv2/meta/resource_group.go index d1ee0bec45fa6..e9bbd87551652 100644 --- a/internal/querycoordv2/meta/resource_group.go +++ b/internal/querycoordv2/meta/resource_group.go @@ -2,7 +2,7 @@ package meta import ( "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/rgpb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querycoordv2/meta/resource_manager.go b/internal/querycoordv2/meta/resource_manager.go index c6b15f96d2da9..45b44201d939b 100644 --- a/internal/querycoordv2/meta/resource_manager.go +++ b/internal/querycoordv2/meta/resource_manager.go @@ -21,9 +21,9 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/rgpb" "github.com/milvus-io/milvus/internal/metastore" diff --git a/internal/querycoordv2/meta/segment_dist_manager.go b/internal/querycoordv2/meta/segment_dist_manager.go index 3cf01329c22a6..a0c401359625d 100644 --- a/internal/querycoordv2/meta/segment_dist_manager.go +++ b/internal/querycoordv2/meta/segment_dist_manager.go @@ -19,8 +19,8 @@ package meta import ( "sync" - "github.com/golang/protobuf/proto" "github.com/samber/lo" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querycoordv2/session/cluster.go b/internal/querycoordv2/session/cluster.go index 2a70dd62119bc..7b6bc316ebe25 100644 --- a/internal/querycoordv2/session/cluster.go +++ b/internal/querycoordv2/session/cluster.go @@ -23,8 +23,8 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/querycoordv2/session/cluster_test.go b/internal/querycoordv2/session/cluster_test.go index e724da592c6d1..6ba387249877a 100644 --- a/internal/querycoordv2/session/cluster_test.go +++ b/internal/querycoordv2/session/cluster_test.go @@ -221,6 +221,7 @@ func (suite *ClusterTestSuite) TestLoadSegments() { Base: &commonpb.MsgBase{}, Infos: []*querypb.SegmentLoadInfo{{}}, }) + suite.NoError(err) merr.Ok(status) diff --git a/internal/querycoordv2/utils/types_test.go b/internal/querycoordv2/utils/types_test.go index 2376f55693613..41743c6882218 100644 --- a/internal/querycoordv2/utils/types_test.go +++ b/internal/querycoordv2/utils/types_test.go @@ -20,8 +20,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/internal/proto/datapb" diff --git a/internal/querynodev2/delegator/delegator.go b/internal/querynodev2/delegator/delegator.go index 6d786bf0ed4fa..1d11b4c5add68 100644 --- a/internal/querynodev2/delegator/delegator.go +++ b/internal/querynodev2/delegator/delegator.go @@ -26,11 +26,11 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/querynodev2/delegator/delegator_data_test.go b/internal/querynodev2/delegator/delegator_data_test.go index 7a96b3d919cd2..407de0effd9c0 100644 --- a/internal/querynodev2/delegator/delegator_data_test.go +++ b/internal/querynodev2/delegator/delegator_data_test.go @@ -1203,10 +1203,10 @@ func (s *DelegatorDataSuite) TestReadDeleteFromMsgstream() { datas := []*msgstream.MsgPack{ {EndTs: 10, EndPositions: []*msgpb.MsgPosition{{Timestamp: 10}}, Msgs: []msgstream.TsMsg{ - &msgstream.DeleteMsg{DeleteRequest: msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 1, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{1}}}, - &msgstream.DeleteMsg{DeleteRequest: msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: -1, PrimaryKeys: storage.ParseInt64s2IDs(2), Timestamps: []uint64{5}}}, + &msgstream.DeleteMsg{DeleteRequest: &msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 1, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{1}}}, + &msgstream.DeleteMsg{DeleteRequest: &msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: -1, PrimaryKeys: storage.ParseInt64s2IDs(2), Timestamps: []uint64{5}}}, // invalid msg because partition wrong - &msgstream.DeleteMsg{DeleteRequest: msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 2, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{10}}}, + &msgstream.DeleteMsg{DeleteRequest: &msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 2, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{10}}}, }}, } diff --git a/internal/querynodev2/delegator/segment_pruner.go b/internal/querynodev2/delegator/segment_pruner.go index dbb11e9a0daa3..24cb690a16dad 100644 --- a/internal/querynodev2/delegator/segment_pruner.go +++ b/internal/querynodev2/delegator/segment_pruner.go @@ -7,9 +7,9 @@ import ( "sort" "strconv" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/delegator/segment_pruner_test.go b/internal/querynodev2/delegator/segment_pruner_test.go index 71b9f81a0954b..220db6f026617 100644 --- a/internal/querynodev2/delegator/segment_pruner_test.go +++ b/internal/querynodev2/delegator/segment_pruner_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/mock_data.go b/internal/querynodev2/mock_data.go index fafc6bdf543fa..735decaaa224a 100644 --- a/internal/querynodev2/mock_data.go +++ b/internal/querynodev2/mock_data.go @@ -21,7 +21,7 @@ import ( "math/rand" "strconv" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/optimizers/query_hook.go b/internal/querynodev2/optimizers/query_hook.go index ed06688b48b00..0ef1307f8fa88 100644 --- a/internal/querynodev2/optimizers/query_hook.go +++ b/internal/querynodev2/optimizers/query_hook.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/planpb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/internal/querynodev2/optimizers/query_hook_test.go b/internal/querynodev2/optimizers/query_hook_test.go index 6b99525b0ca5a..f34acd8ccd15f 100644 --- a/internal/querynodev2/optimizers/query_hook_test.go +++ b/internal/querynodev2/optimizers/query_hook_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/proto/planpb" diff --git a/internal/querynodev2/pipeline/mock_data.go b/internal/querynodev2/pipeline/mock_data.go index a26b0d56603c7..f0090d9abc58c 100644 --- a/internal/querynodev2/pipeline/mock_data.go +++ b/internal/querynodev2/pipeline/mock_data.go @@ -53,7 +53,7 @@ func buildInsertMsg(collectionID int64, partitionID int64, segmentID int64, chan } func emptyDeleteMsg(collectionID int64, partitionID int64, channel string) *msgstream.DeleteMsg { - deleteReq := msgpb.DeleteRequest{ + deleteReq := &msgpb.DeleteRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Delete), commonpbutil.WithTimeStamp(0), @@ -70,7 +70,7 @@ func emptyDeleteMsg(collectionID int64, partitionID int64, channel string) *msgs } func emptyInsertMsg(collectionID int64, partitionID int64, segmentID int64, channel string) *msgstream.InsertMsg { - insertReq := msgpb.InsertRequest{ + insertReq := &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithTimeStamp(0), diff --git a/internal/querynodev2/segments/cgo_util.go b/internal/querynodev2/segments/cgo_util.go index f82d25ae298d8..11c9957e7d414 100644 --- a/internal/querynodev2/segments/cgo_util.go +++ b/internal/querynodev2/segments/cgo_util.go @@ -31,8 +31,8 @@ import ( "math" "unsafe" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/util/cgoconverter" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/querynodev2/segments/collection.go b/internal/querynodev2/segments/collection.go index df6bb3eca4e12..6baf1bd4bb94b 100644 --- a/internal/querynodev2/segments/collection.go +++ b/internal/querynodev2/segments/collection.go @@ -28,10 +28,10 @@ import ( "sync" "unsafe" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/querynodev2/segments/load_index_info.go b/internal/querynodev2/segments/load_index_info.go index 04632bed95f2d..f733d8c18151b 100644 --- a/internal/querynodev2/segments/load_index_info.go +++ b/internal/querynodev2/segments/load_index_info.go @@ -29,9 +29,9 @@ import ( "runtime" "unsafe" - "github.com/golang/protobuf/proto" "github.com/pingcap/log" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datacoord" diff --git a/internal/querynodev2/segments/mock_data.go b/internal/querynodev2/segments/mock_data.go index 6d15212d047e4..0b69cd1491762 100644 --- a/internal/querynodev2/segments/mock_data.go +++ b/internal/querynodev2/segments/mock_data.go @@ -27,8 +27,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -585,9 +586,12 @@ func genInsertData(msgLength int, schema *schemapb.CollectionSchema) (*storage.I Dim: dim, } case schemapb.DataType_SparseFloatVector: - sparseData := testutils.GenerateSparseFloatVectors(msgLength) + contents, dim := testutils.GenerateSparseFloatVectorsData(msgLength) insertData.Data[f.FieldID] = &storage.SparseFloatVectorFieldData{ - SparseFloatArray: *sparseData, + SparseFloatArray: schemapb.SparseFloatArray{ + Contents: contents, + Dim: dim, + }, } default: err := errors.New("data type not supported") @@ -693,9 +697,12 @@ func GenAndSaveIndexV2(collectionID, partitionID, segmentID, buildID int64, case schemapb.DataType_BFloat16Vector: dataset = indexcgowrapper.GenBFloat16VecDataset(testutils.GenerateBFloat16Vectors(msgLength, defaultDim)) case schemapb.DataType_SparseFloatVector: - data := testutils.GenerateSparseFloatVectors(msgLength) + contents, dim := testutils.GenerateSparseFloatVectorsData(msgLength) dataset = indexcgowrapper.GenSparseFloatVecDataset(&storage.SparseFloatVectorFieldData{ - SparseFloatArray: *data, + SparseFloatArray: schemapb.SparseFloatArray{ + Contents: contents, + Dim: dim, + }, }) } @@ -869,7 +876,8 @@ func genSearchRequest(nq int64, indexType string, collection *Collection) (*inte return nil, err2 } var planpb planpb.PlanNode - proto.UnmarshalText(planStr, &planpb) + // proto.UnmarshalText(planStr, &planpb) + prototext.Unmarshal([]byte(planStr), &planpb) serializedPlan, err3 := proto.Marshal(&planpb) if err3 != nil { return nil, err3 @@ -1108,7 +1116,7 @@ func genInsertMsg(collection *Collection, partitionID, segment int64, numRows in return &msgstream.InsertMsg{ BaseMsg: genMsgStreamBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: genCommonMsgBase(commonpb.MsgType_Insert, 0), CollectionName: "test-collection", PartitionName: "test-partition", diff --git a/internal/querynodev2/segments/plan_test.go b/internal/querynodev2/segments/plan_test.go index 6fc6e1f414a86..cc4c000113e40 100644 --- a/internal/querynodev2/segments/plan_test.go +++ b/internal/querynodev2/segments/plan_test.go @@ -20,8 +20,8 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/planpb" diff --git a/internal/querynodev2/segments/reduce_test.go b/internal/querynodev2/segments/reduce_test.go index 9693dc2f717ad..8d85590744499 100644 --- a/internal/querynodev2/segments/reduce_test.go +++ b/internal/querynodev2/segments/reduce_test.go @@ -23,8 +23,9 @@ import ( "math" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" @@ -167,7 +168,8 @@ func (suite *ReduceSuite) TestReduceAllFunc() { placeholder_tag: "$0" >` var planpb planpb.PlanNode - proto.UnmarshalText(planStr, &planpb) + // proto.UnmarshalText(planStr, &planpb) + prototext.Unmarshal([]byte(planStr), &planpb) serializedPlan, err := proto.Marshal(&planpb) suite.NoError(err) plan, err := createSearchPlanByExpr(context.Background(), suite.collection, serializedPlan) diff --git a/internal/querynodev2/segments/result.go b/internal/querynodev2/segments/result.go index 5095b9d24b025..38fc5b942748b 100644 --- a/internal/querynodev2/segments/result.go +++ b/internal/querynodev2/segments/result.go @@ -21,10 +21,10 @@ import ( "fmt" "math" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/querynodev2/segments/segment.go b/internal/querynodev2/segments/segment.go index 08e6707b1b626..880518592e2bb 100644 --- a/internal/querynodev2/segments/segment.go +++ b/internal/querynodev2/segments/segment.go @@ -36,10 +36,10 @@ import ( "github.com/apache/arrow/go/v12/arrow/array" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -239,7 +239,7 @@ func (s *baseSegment) SetNeedUpdatedVersion(version int64) { } type FieldInfo struct { - datapb.FieldBinlog + *datapb.FieldBinlog RowCount int64 } @@ -426,7 +426,7 @@ func (s *LocalSegment) initializeSegment() error { }) if !typeutil.IsVectorType(field.GetDataType()) && !s.HasRawData(fieldID) { s.fields.Insert(fieldID, &FieldInfo{ - FieldBinlog: *info.FieldBinlog, + FieldBinlog: info.FieldBinlog, RowCount: loadInfo.GetNumOfRows(), }) } @@ -434,7 +434,7 @@ func (s *LocalSegment) initializeSegment() error { for _, binlogs := range fieldBinlogs { s.fields.Insert(binlogs.FieldID, &FieldInfo{ - FieldBinlog: *binlogs, + FieldBinlog: binlogs, RowCount: loadInfo.GetNumOfRows(), }) } diff --git a/internal/querynodev2/services.go b/internal/querynodev2/services.go index 732cfd79cde09..b367e03c95bfc 100644 --- a/internal/querynodev2/services.go +++ b/internal/querynodev2/services.go @@ -23,11 +23,11 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "golang.org/x/sync/errgroup" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/querynodev2/services_test.go b/internal/querynodev2/services_test.go index 86b011106f028..329e2d8aa2fc9 100644 --- a/internal/querynodev2/services_test.go +++ b/internal/querynodev2/services_test.go @@ -27,12 +27,12 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/querynodev2/tasks/search_task.go b/internal/querynodev2/tasks/search_task.go index 6b1f4e1f673c3..497bf14d73919 100644 --- a/internal/querynodev2/tasks/search_task.go +++ b/internal/querynodev2/tasks/search_task.go @@ -10,11 +10,11 @@ import ( "fmt" "strconv" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/querynodev2/tasks/search_task_test.go b/internal/querynodev2/tasks/search_task_test.go index 433fade9b63b3..eab7ff49c4371 100644 --- a/internal/querynodev2/tasks/search_task_test.go +++ b/internal/querynodev2/tasks/search_task_test.go @@ -22,9 +22,9 @@ import ( "math/rand" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/rootcoord/create_collection_task.go b/internal/rootcoord/create_collection_task.go index d694d90191e1c..b597ffc33d5ae 100644 --- a/internal/rootcoord/create_collection_task.go +++ b/internal/rootcoord/create_collection_task.go @@ -23,8 +23,8 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" @@ -412,7 +412,7 @@ func (t *createCollectionTask) genCreateCollectionMsg(ctx context.Context, ts ui EndTimestamp: ts, HashValues: []uint32{0}, }, - CreateCollectionRequest: msgpb.CreateCollectionRequest{ + CreateCollectionRequest: &msgpb.CreateCollectionRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_CreateCollection), commonpbutil.WithTimeStamp(ts), diff --git a/internal/rootcoord/create_collection_task_test.go b/internal/rootcoord/create_collection_task_test.go index 114ceaef17add..6cc64bafd96ac 100644 --- a/internal/rootcoord/create_collection_task_test.go +++ b/internal/rootcoord/create_collection_task_test.go @@ -24,9 +24,9 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/internal/rootcoord/garbage_collector.go b/internal/rootcoord/garbage_collector.go index 523191da2274f..6657ca959269a 100644 --- a/internal/rootcoord/garbage_collector.go +++ b/internal/rootcoord/garbage_collector.go @@ -176,7 +176,7 @@ func (c *bgGarbageCollector) notifyCollectionGc(ctx context.Context, coll *model EndTimestamp: ts, HashValues: []uint32{0}, }, - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_DropCollection), commonpbutil.WithTimeStamp(ts), @@ -208,7 +208,7 @@ func (c *bgGarbageCollector) notifyPartitionGc(ctx context.Context, pChannels [] EndTimestamp: ts, HashValues: []uint32{0}, }, - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_DropPartition), commonpbutil.WithTimeStamp(ts), diff --git a/internal/rootcoord/timeticksync.go b/internal/rootcoord/timeticksync.go index 4ad56bc05911b..fee0c59ca1f8d 100644 --- a/internal/rootcoord/timeticksync.go +++ b/internal/rootcoord/timeticksync.go @@ -327,20 +327,20 @@ func (t *timetickSync) sendTimeTickToChannel(chanNames []string, ts typeutil.Tim }() msgPack := msgstream.MsgPack{} - timeTickResult := msgpb.TimeTickMsg{ - Base: commonpbutil.NewMsgBase( - commonpbutil.WithMsgType(commonpb.MsgType_TimeTick), - commonpbutil.WithTimeStamp(ts), - commonpbutil.WithSourceID(t.sourceID), - ), - } + timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: ts, EndTimestamp: ts, HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{ + Base: commonpbutil.NewMsgBase( + commonpbutil.WithMsgType(commonpb.MsgType_TimeTick), + commonpbutil.WithTimeStamp(ts), + commonpbutil.WithSourceID(t.sourceID), + ), + }, } msgPack.Msgs = append(msgPack.Msgs, timeTickMsg) if err := t.dmlChannels.broadcast(chanNames, &msgPack); err != nil { diff --git a/internal/storage/data_codec_test.go b/internal/storage/data_codec_test.go index b074d045d337b..d1847a034b494 100644 --- a/internal/storage/data_codec_test.go +++ b/internal/storage/data_codec_test.go @@ -449,7 +449,7 @@ func TestInsertCodec(t *testing.T) { 0, 255, 0, 255, 0, 255, 0, 255, }, resultData.Data[BFloat16VectorField].(*BFloat16VectorFieldData).Data) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ // merged dim should be max of all dims Dim: 600, Contents: [][]byte{ @@ -460,7 +460,7 @@ func TestInsertCodec(t *testing.T) { typeutil.CreateSparseFloatRow([]uint32{10, 20, 30}, []float32{2.1, 2.2, 2.3}), typeutil.CreateSparseFloatRow([]uint32{100, 200, 599}, []float32{3.1, 3.2, 3.3}), }, - }, resultData.Data[SparseFloatVectorField].(*SparseFloatVectorFieldData).SparseFloatArray) + }, &resultData.Data[SparseFloatVectorField].(*SparseFloatVectorFieldData).SparseFloatArray) int32ArrayList := [][]int32{{1, 2, 3}, {4, 5, 6}, {3, 2, 1}, {6, 5, 4}} resultArrayList := [][]int32{} diff --git a/internal/storage/data_sorter_test.go b/internal/storage/data_sorter_test.go index e433967701ab7..1ca05285f9a50 100644 --- a/internal/storage/data_sorter_test.go +++ b/internal/storage/data_sorter_test.go @@ -270,14 +270,14 @@ func TestDataSorter(t *testing.T) { assert.Equal(t, []float32{16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, dataSorter.InsertData.Data[109].(*FloatVectorFieldData).Data) assert.Equal(t, []byte{16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, dataSorter.InsertData.Data[110].(*Float16VectorFieldData).Data) assert.Equal(t, []byte{16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, dataSorter.InsertData.Data[111].(*BFloat16VectorFieldData).Data) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ Dim: 600, Contents: [][]byte{ typeutil.CreateSparseFloatRow([]uint32{100, 200, 599}, []float32{3.1, 3.2, 3.3}), typeutil.CreateSparseFloatRow([]uint32{0, 1, 2}, []float32{1.1, 1.2, 1.3}), typeutil.CreateSparseFloatRow([]uint32{10, 20, 30}, []float32{2.1, 2.2, 2.3}), }, - }, dataSorter.InsertData.Data[112].(*SparseFloatVectorFieldData).SparseFloatArray) + }, &dataSorter.InsertData.Data[112].(*SparseFloatVectorFieldData).SparseFloatArray) } func TestDataSorter_Len(t *testing.T) { diff --git a/internal/storage/insert_data.go b/internal/storage/insert_data.go index b94067f8417b6..97e73fea6624a 100644 --- a/internal/storage/insert_data.go +++ b/internal/storage/insert_data.go @@ -20,7 +20,7 @@ import ( "encoding/binary" "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/storage/payload_reader.go b/internal/storage/payload_reader.go index b3c0cc4e21bb4..a3019f502200e 100644 --- a/internal/storage/payload_reader.go +++ b/internal/storage/payload_reader.go @@ -11,7 +11,7 @@ import ( "github.com/apache/arrow/go/v12/parquet/file" "github.com/apache/arrow/go/v12/parquet/pqarrow" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/util/typeutil" diff --git a/internal/storage/payload_test.go b/internal/storage/payload_test.go index b7109043dd238..5f72282da92e4 100644 --- a/internal/storage/payload_test.go +++ b/internal/storage/payload_test.go @@ -668,7 +668,7 @@ func TestPayload_ReaderAndWriter(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 600, dim) assert.Equal(t, 6, len(floatVecs.Contents)) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ // merged dim should be max of all dims Dim: 600, Contents: [][]byte{ @@ -679,7 +679,7 @@ func TestPayload_ReaderAndWriter(t *testing.T) { typeutil.CreateSparseFloatRow([]uint32{60, 80, 230}, []float32{2.1, 2.2, 2.3}), typeutil.CreateSparseFloatRow([]uint32{170, 300, 579}, []float32{3.1, 3.2, 3.3}), }, - }, floatVecs.SparseFloatArray) + }, &floatVecs.SparseFloatArray) ifloatVecs, dim, err := r.GetDataFromPayload() assert.NoError(t, err) @@ -721,10 +721,10 @@ func TestPayload_ReaderAndWriter(t *testing.T) { assert.NoError(t, err) assert.Equal(t, actualDim, dim) assert.Equal(t, 3, len(floatVecs.Contents)) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ Dim: int64(dim), Contents: rows, - }, floatVecs.SparseFloatArray) + }, &floatVecs.SparseFloatArray) ifloatVecs, dim, err := r.GetDataFromPayload() assert.NoError(t, err) diff --git a/internal/storage/payload_writer.go b/internal/storage/payload_writer.go index d9a8f1f11fdf3..f6c98b2bafe58 100644 --- a/internal/storage/payload_writer.go +++ b/internal/storage/payload_writer.go @@ -29,7 +29,7 @@ import ( "github.com/apache/arrow/go/v12/parquet/compress" "github.com/apache/arrow/go/v12/parquet/pqarrow" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/storage/print_binlog.go b/internal/storage/print_binlog.go index 61cb03cb6d8ef..d7176eedd902f 100644 --- a/internal/storage/print_binlog.go +++ b/internal/storage/print_binlog.go @@ -22,8 +22,8 @@ import ( "os" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "golang.org/x/exp/mmap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/storage/print_binlog_test.go b/internal/storage/print_binlog_test.go index 89cefe1c4e954..c7ddd16583227 100644 --- a/internal/storage/print_binlog_test.go +++ b/internal/storage/print_binlog_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/internal/storage/serde.go b/internal/storage/serde.go index d7e8ca2808711..b5201a960ae0c 100644 --- a/internal/storage/serde.go +++ b/internal/storage/serde.go @@ -33,8 +33,8 @@ import ( "github.com/apache/arrow/go/v12/parquet/compress" "github.com/apache/arrow/go/v12/parquet/pqarrow" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "go.uber.org/atomic" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/storage/utils.go b/internal/storage/utils.go index 06e8d1ca7c947..292b425510354 100644 --- a/internal/storage/utils.go +++ b/internal/storage/utils.go @@ -28,9 +28,9 @@ import ( "strconv" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/storage/utils_test.go b/internal/storage/utils_test.go index 25eb19cf064eb..ec9a4d6518dce 100644 --- a/internal/storage/utils_test.go +++ b/internal/storage/utils_test.go @@ -24,10 +24,10 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -543,7 +543,7 @@ func genRowBasedInsertMsg(numRows, fVecDim, bVecDim, f16VecDim, bf16VecDim int) HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -581,7 +581,7 @@ func genColumnBasedInsertMsg(schema *schemapb.CollectionSchema, numRows, fVecDim HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -924,7 +924,7 @@ func TestRowBasedInsertMsgToInsertFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -967,7 +967,7 @@ func TestRowBasedInsertMsgToInsertBFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1028,7 +1028,7 @@ func TestColumnBasedInsertMsgToInsertFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1072,7 +1072,7 @@ func TestColumnBasedInsertMsgToInsertBFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, diff --git a/internal/util/analyzecgowrapper/analyze.go b/internal/util/analyzecgowrapper/analyze.go index 1b5b631194b1e..3bfe9d3ff068d 100644 --- a/internal/util/analyzecgowrapper/analyze.go +++ b/internal/util/analyzecgowrapper/analyze.go @@ -29,8 +29,8 @@ import ( "runtime" "unsafe" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/clusteringpb" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/util/flowgraph/node_test.go b/internal/util/flowgraph/node_test.go index 850fd183a267f..238e1f485f1a8 100644 --- a/internal/util/flowgraph/node_test.go +++ b/internal/util/flowgraph/node_test.go @@ -35,21 +35,20 @@ import ( func generateMsgPack() msgstream.MsgPack { msgPack := msgstream.MsgPack{} - timeTickResult := msgpb.TimeTickMsg{ - Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_TimeTick, - MsgID: 0, - Timestamp: math.MaxUint64, - SourceID: 0, - }, - } timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: uint64(time.Now().Unix()), EndTimestamp: uint64(time.Now().Unix() + 1), HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{ + Base: &commonpb.MsgBase{ + MsgType: commonpb.MsgType_TimeTick, + MsgID: 0, + Timestamp: math.MaxUint64, + SourceID: 0, + }, + }, } msgPack.Msgs = append(msgPack.Msgs, timeTickMsg) @@ -64,7 +63,7 @@ func generateInsertMsgPack() msgstream.MsgPack { EndTimestamp: uint64(time.Now().Unix() + 1), HashValues: []uint32{0}, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Insert}, }, } diff --git a/internal/util/indexcgowrapper/build_index_info.go b/internal/util/indexcgowrapper/build_index_info.go index 0ae75b317b6a7..efef8020d0810 100644 --- a/internal/util/indexcgowrapper/build_index_info.go +++ b/internal/util/indexcgowrapper/build_index_info.go @@ -27,7 +27,7 @@ import ( "fmt" "unsafe" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/internal/util/indexcgowrapper/index.go b/internal/util/indexcgowrapper/index.go index e76e5cff1d572..523a2ac1ecd2a 100644 --- a/internal/util/indexcgowrapper/index.go +++ b/internal/util/indexcgowrapper/index.go @@ -15,8 +15,9 @@ import ( "runtime" "unsafe" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" @@ -59,7 +60,8 @@ func NewCgoIndex(dtype schemapb.DataType, typeParams, indexParams map[string]str for key, value := range typeParams { protoTypeParams.Params = append(protoTypeParams.Params, &commonpb.KeyValuePair{Key: key, Value: value}) } - typeParamsStr := proto.MarshalTextString(protoTypeParams) + // typeParamsStr := proto.MarshalTextString(protoTypeParams) + typeParamsStr, _ := prototext.Marshal(protoTypeParams) protoIndexParams := &indexcgopb.IndexParams{ Params: make([]*commonpb.KeyValuePair, 0), @@ -67,10 +69,11 @@ func NewCgoIndex(dtype schemapb.DataType, typeParams, indexParams map[string]str for key, value := range indexParams { protoIndexParams.Params = append(protoIndexParams.Params, &commonpb.KeyValuePair{Key: key, Value: value}) } - indexParamsStr := proto.MarshalTextString(protoIndexParams) + // indexParamsStr := proto.MarshalTextString(protoIndexParams) + indexParamsStr, _ := prototext.Marshal(protoIndexParams) - typeParamsPointer := C.CString(typeParamsStr) - indexParamsPointer := C.CString(indexParamsStr) + typeParamsPointer := C.CString(string(typeParamsStr)) + indexParamsPointer := C.CString(string(indexParamsStr)) defer C.free(unsafe.Pointer(typeParamsPointer)) defer C.free(unsafe.Pointer(indexParamsPointer)) diff --git a/internal/util/streamrpc/streamer.go b/internal/util/streamrpc/streamer.go index 79f47c8bc3c52..30f482ff917fb 100644 --- a/internal/util/streamrpc/streamer.go +++ b/internal/util/streamrpc/streamer.go @@ -5,8 +5,8 @@ import ( "io" "sync" - "github.com/golang/protobuf/proto" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/util/testutil/test_util.go b/internal/util/testutil/test_util.go index 4548f0e77ff31..698530b361b64 100644 --- a/internal/util/testutil/test_util.go +++ b/internal/util/testutil/test_util.go @@ -177,9 +177,12 @@ func CreateInsertData(schema *schemapb.CollectionSchema, rows int) (*storage.Ins Dim: int(dim), } case schemapb.DataType_SparseFloatVector: - sparseFloatVecData := testutils.GenerateSparseFloatVectors(rows) + data, dim := testutils.GenerateSparseFloatVectorsData(rows) insertData.Data[f.FieldID] = &storage.SparseFloatVectorFieldData{ - SparseFloatArray: *sparseFloatVecData, + SparseFloatArray: schemapb.SparseFloatArray{ + Contents: data, + Dim: dim, + }, } case schemapb.DataType_String, schemapb.DataType_VarChar: insertData.Data[f.FieldID] = &storage.StringFieldData{ diff --git a/internal/util/typeutil/storage.go b/internal/util/typeutil/storage.go index 6e3b44845e20b..984de5e4878f2 100644 --- a/internal/util/typeutil/storage.go +++ b/internal/util/typeutil/storage.go @@ -6,7 +6,7 @@ import ( "path" "github.com/apache/arrow/go/v12/arrow/array" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/pkg/eventlog/event_log.pb.go b/pkg/eventlog/event_log.pb.go index b5f84d92b7722..60318589bad82 100644 --- a/pkg/eventlog/event_log.pb.go +++ b/pkg/eventlog/event_log.pb.go @@ -1,28 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.21.4 // source: event_log.proto package eventlog import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// 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 +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Level int32 @@ -34,257 +30,268 @@ const ( Level_Error Level = 4 ) -var Level_name = map[int32]string{ - 0: "Undefined", - 1: "Debug", - 2: "Info", - 3: "Warn", - 4: "Error", -} +// Enum value maps for Level. +var ( + Level_name = map[int32]string{ + 0: "Undefined", + 1: "Debug", + 2: "Info", + 3: "Warn", + 4: "Error", + } + Level_value = map[string]int32{ + "Undefined": 0, + "Debug": 1, + "Info": 2, + "Warn": 3, + "Error": 4, + } +) -var Level_value = map[string]int32{ - "Undefined": 0, - "Debug": 1, - "Info": 2, - "Warn": 3, - "Error": 4, +func (x Level) Enum() *Level { + p := new(Level) + *p = x + return p } func (x Level) String() string { - return proto.EnumName(Level_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (Level) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_443313318a2fd90c, []int{0} +func (Level) Descriptor() protoreflect.EnumDescriptor { + return file_event_log_proto_enumTypes[0].Descriptor() } -type ListenRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (Level) Type() protoreflect.EnumType { + return &file_event_log_proto_enumTypes[0] } -func (m *ListenRequest) Reset() { *m = ListenRequest{} } -func (m *ListenRequest) String() string { return proto.CompactTextString(m) } -func (*ListenRequest) ProtoMessage() {} -func (*ListenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_443313318a2fd90c, []int{0} -} - -func (m *ListenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListenRequest.Unmarshal(m, b) -} -func (m *ListenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListenRequest.Marshal(b, m, deterministic) +func (x Level) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *ListenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListenRequest.Merge(m, src) -} -func (m *ListenRequest) XXX_Size() int { - return xxx_messageInfo_ListenRequest.Size(m) -} -func (m *ListenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListenRequest proto.InternalMessageInfo -type Event struct { - Level Level `protobuf:"varint,1,opt,name=level,proto3,enum=milvus.proto.eventlog.Level" json:"level,omitempty"` - Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Ts int64 `protobuf:"varint,4,opt,name=ts,proto3" json:"ts,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_443313318a2fd90c, []int{1} +// Deprecated: Use Level.Descriptor instead. +func (Level) EnumDescriptor() ([]byte, []int) { + return file_event_log_proto_rawDescGZIP(), []int{0} } -func (m *Event) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Event.Unmarshal(m, b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) -} -func (m *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(m, src) -} -func (m *Event) XXX_Size() int { - return xxx_messageInfo_Event.Size(m) -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) +type ListenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -var xxx_messageInfo_Event proto.InternalMessageInfo - -func (m *Event) GetLevel() Level { - if m != nil { - return m.Level +func (x *ListenRequest) Reset() { + *x = ListenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_event_log_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return Level_Undefined } -func (m *Event) GetType() int32 { - if m != nil { - return m.Type - } - return 0 +func (x *ListenRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Event) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} +func (*ListenRequest) ProtoMessage() {} -func (m *Event) GetTs() int64 { - if m != nil { - return m.Ts +func (x *ListenRequest) ProtoReflect() protoreflect.Message { + mi := &file_event_log_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return 0 + return mi.MessageOf(x) } -func init() { - proto.RegisterEnum("milvus.proto.eventlog.Level", Level_name, Level_value) - proto.RegisterType((*ListenRequest)(nil), "milvus.proto.eventlog.ListenRequest") - proto.RegisterType((*Event)(nil), "milvus.proto.eventlog.Event") -} - -func init() { proto.RegisterFile("event_log.proto", fileDescriptor_443313318a2fd90c) } - -var fileDescriptor_443313318a2fd90c = []byte{ - // 276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x8f, 0x5f, 0x4b, 0xc3, 0x30, - 0x14, 0xc5, 0x97, 0xae, 0x1d, 0xee, 0xe2, 0xb6, 0x12, 0x10, 0x8a, 0xf8, 0x50, 0x8a, 0x0f, 0x65, - 0x60, 0x2b, 0xf5, 0x0b, 0x88, 0xb8, 0x07, 0xa1, 0x0f, 0x52, 0x11, 0xc1, 0x17, 0xe9, 0x9f, 0xbb, - 0x18, 0xec, 0x92, 0x9a, 0xa4, 0x05, 0xbf, 0xbd, 0x34, 0x55, 0xf0, 0xc1, 0xbd, 0x9d, 0xe4, 0x9c, - 0xfb, 0xe3, 0x1c, 0xd8, 0xe0, 0x80, 0xc2, 0xbc, 0xb5, 0x92, 0x25, 0x9d, 0x92, 0x46, 0xd2, 0xb3, - 0x03, 0x6f, 0x87, 0x5e, 0x4f, 0xaf, 0xc4, 0xba, 0xad, 0x64, 0xd1, 0x06, 0x56, 0x39, 0xd7, 0x06, - 0x45, 0x81, 0x9f, 0x3d, 0x6a, 0x13, 0x69, 0xf0, 0x76, 0xa3, 0x49, 0x33, 0xf0, 0x5a, 0x1c, 0xb0, - 0x0d, 0x48, 0x48, 0xe2, 0x75, 0x76, 0x91, 0xfc, 0x0b, 0x48, 0xf2, 0x31, 0x53, 0x4c, 0x51, 0x4a, - 0xc1, 0x35, 0x5f, 0x1d, 0x06, 0x4e, 0x48, 0x62, 0xaf, 0xb0, 0x7a, 0xfc, 0x6b, 0x4a, 0x53, 0x06, - 0xf3, 0x90, 0xc4, 0xa7, 0x85, 0xd5, 0x74, 0x0d, 0x8e, 0xd1, 0x81, 0x1b, 0x92, 0x78, 0x5e, 0x38, - 0x46, 0x6f, 0x6f, 0xc1, 0xb3, 0x1c, 0xba, 0x82, 0xe5, 0xb3, 0x68, 0x70, 0xcf, 0x05, 0x36, 0xfe, - 0x8c, 0x2e, 0xc1, 0xbb, 0xc7, 0xaa, 0x67, 0x3e, 0xa1, 0x27, 0xe0, 0x3e, 0x88, 0xbd, 0xf4, 0x9d, - 0x51, 0xbd, 0x94, 0x4a, 0xf8, 0xf3, 0xd1, 0xde, 0x29, 0x25, 0x95, 0xef, 0x66, 0x35, 0x6c, 0x6c, - 0xed, 0x5c, 0xb2, 0x27, 0x54, 0x03, 0xaf, 0x91, 0x3e, 0xc2, 0x62, 0x9a, 0x46, 0x2f, 0x8f, 0x75, - 0xff, 0xbb, 0xfc, 0xfc, 0xd8, 0x42, 0xcb, 0x8d, 0x66, 0xd7, 0xe4, 0x6e, 0xfb, 0x1a, 0x33, 0x6e, - 0xde, 0xfb, 0x2a, 0xa9, 0xe5, 0x21, 0x9d, 0xd2, 0x57, 0x5c, 0xfe, 0xa8, 0xb4, 0xfb, 0x60, 0xe9, - 0xef, 0x55, 0xb5, 0xb0, 0x94, 0x9b, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x46, 0x60, 0x11, - 0x89, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// EventLogServiceClient is the client API for EventLogService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EventLogServiceClient interface { - Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) -} - -type eventLogServiceClient struct { - cc *grpc.ClientConn -} - -func NewEventLogServiceClient(cc *grpc.ClientConn) EventLogServiceClient { - return &eventLogServiceClient{cc} +// Deprecated: Use ListenRequest.ProtoReflect.Descriptor instead. +func (*ListenRequest) Descriptor() ([]byte, []int) { + return file_event_log_proto_rawDescGZIP(), []int{0} } -func (c *eventLogServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) { - stream, err := c.cc.NewStream(ctx, &_EventLogService_serviceDesc.Streams[0], "/milvus.proto.eventlog.EventLogService/Listen", opts...) - if err != nil { - return nil, err - } - x := &eventLogServiceListenClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err +type Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Level Level `protobuf:"varint,1,opt,name=level,proto3,enum=milvus.proto.eventlog.Level" json:"level,omitempty"` + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Ts int64 `protobuf:"varint,4,opt,name=ts,proto3" json:"ts,omitempty"` +} + +func (x *Event) Reset() { + *x = Event{} + if protoimpl.UnsafeEnabled { + mi := &file_event_log_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return x, nil } -type EventLogService_ListenClient interface { - Recv() (*Event, error) - grpc.ClientStream +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) } -type eventLogServiceListenClient struct { - grpc.ClientStream -} +func (*Event) ProtoMessage() {} -func (x *eventLogServiceListenClient) Recv() (*Event, error) { - m := new(Event) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_event_log_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return m, nil + return mi.MessageOf(x) } -// EventLogServiceServer is the server API for EventLogService service. -type EventLogServiceServer interface { - Listen(*ListenRequest, EventLogService_ListenServer) error -} - -// UnimplementedEventLogServiceServer can be embedded to have forward compatible implementations. -type UnimplementedEventLogServiceServer struct { -} - -func (*UnimplementedEventLogServiceServer) Listen(req *ListenRequest, srv EventLogService_ListenServer) error { - return status.Errorf(codes.Unimplemented, "method Listen not implemented") +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_event_log_proto_rawDescGZIP(), []int{1} } -func RegisterEventLogServiceServer(s *grpc.Server, srv EventLogServiceServer) { - s.RegisterService(&_EventLogService_serviceDesc, srv) +func (x *Event) GetLevel() Level { + if x != nil { + return x.Level + } + return Level_Undefined } -func _EventLogService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListenRequest) - if err := stream.RecvMsg(m); err != nil { - return err +func (x *Event) GetType() int32 { + if x != nil { + return x.Type } - return srv.(EventLogServiceServer).Listen(m, &eventLogServiceListenServer{stream}) + return 0 } -type EventLogService_ListenServer interface { - Send(*Event) error - grpc.ServerStream +func (x *Event) GetData() []byte { + if x != nil { + return x.Data + } + return nil } -type eventLogServiceListenServer struct { - grpc.ServerStream +func (x *Event) GetTs() int64 { + if x != nil { + return x.Ts + } + return 0 } -func (x *eventLogServiceListenServer) Send(m *Event) error { - return x.ServerStream.SendMsg(m) -} +var File_event_log_proto protoreflect.FileDescriptor + +var file_event_log_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x15, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x73, 0x0a, 0x05, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1c, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, + 0x0a, 0x02, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x74, 0x73, 0x2a, 0x40, + 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x10, + 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x57, + 0x61, 0x72, 0x6e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x04, + 0x32, 0x63, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x06, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x12, 0x24, 0x2e, + 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x67, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x22, 0x00, 0x30, 0x01, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, + 0x6c, 0x76, 0x75, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x6c, 0x6f, + 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_event_log_proto_rawDescOnce sync.Once + file_event_log_proto_rawDescData = file_event_log_proto_rawDesc +) -var _EventLogService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "milvus.proto.eventlog.EventLogService", - HandlerType: (*EventLogServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Listen", - Handler: _EventLogService_Listen_Handler, - ServerStreams: true, +func file_event_log_proto_rawDescGZIP() []byte { + file_event_log_proto_rawDescOnce.Do(func() { + file_event_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_event_log_proto_rawDescData) + }) + return file_event_log_proto_rawDescData +} + +var file_event_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_event_log_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_event_log_proto_goTypes = []interface{}{ + (Level)(0), // 0: milvus.proto.eventlog.Level + (*ListenRequest)(nil), // 1: milvus.proto.eventlog.ListenRequest + (*Event)(nil), // 2: milvus.proto.eventlog.Event +} +var file_event_log_proto_depIdxs = []int32{ + 0, // 0: milvus.proto.eventlog.Event.level:type_name -> milvus.proto.eventlog.Level + 1, // 1: milvus.proto.eventlog.EventLogService.Listen:input_type -> milvus.proto.eventlog.ListenRequest + 2, // 2: milvus.proto.eventlog.EventLogService.Listen:output_type -> milvus.proto.eventlog.Event + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_event_log_proto_init() } +func file_event_log_proto_init() { + if File_event_log_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_event_log_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_event_log_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_event_log_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, }, - }, - Metadata: "event_log.proto", + GoTypes: file_event_log_proto_goTypes, + DependencyIndexes: file_event_log_proto_depIdxs, + EnumInfos: file_event_log_proto_enumTypes, + MessageInfos: file_event_log_proto_msgTypes, + }.Build() + File_event_log_proto = out.File + file_event_log_proto_rawDesc = nil + file_event_log_proto_goTypes = nil + file_event_log_proto_depIdxs = nil } diff --git a/pkg/eventlog/event_log_grpc.pb.go b/pkg/eventlog/event_log_grpc.pb.go new file mode 100644 index 0000000000000..1c72082770fda --- /dev/null +++ b/pkg/eventlog/event_log_grpc.pb.go @@ -0,0 +1,134 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.21.4 +// source: event_log.proto + +package eventlog + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + EventLogService_Listen_FullMethodName = "/milvus.proto.eventlog.EventLogService/Listen" +) + +// EventLogServiceClient is the client API for EventLogService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EventLogServiceClient interface { + Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) +} + +type eventLogServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEventLogServiceClient(cc grpc.ClientConnInterface) EventLogServiceClient { + return &eventLogServiceClient{cc} +} + +func (c *eventLogServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error) { + stream, err := c.cc.NewStream(ctx, &EventLogService_ServiceDesc.Streams[0], EventLogService_Listen_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &eventLogServiceListenClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type EventLogService_ListenClient interface { + Recv() (*Event, error) + grpc.ClientStream +} + +type eventLogServiceListenClient struct { + grpc.ClientStream +} + +func (x *eventLogServiceListenClient) Recv() (*Event, error) { + m := new(Event) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// EventLogServiceServer is the server API for EventLogService service. +// All implementations should embed UnimplementedEventLogServiceServer +// for forward compatibility +type EventLogServiceServer interface { + Listen(*ListenRequest, EventLogService_ListenServer) error +} + +// UnimplementedEventLogServiceServer should be embedded to have forward compatible implementations. +type UnimplementedEventLogServiceServer struct { +} + +func (UnimplementedEventLogServiceServer) Listen(*ListenRequest, EventLogService_ListenServer) error { + return status.Errorf(codes.Unimplemented, "method Listen not implemented") +} + +// UnsafeEventLogServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EventLogServiceServer will +// result in compilation errors. +type UnsafeEventLogServiceServer interface { + mustEmbedUnimplementedEventLogServiceServer() +} + +func RegisterEventLogServiceServer(s grpc.ServiceRegistrar, srv EventLogServiceServer) { + s.RegisterService(&EventLogService_ServiceDesc, srv) +} + +func _EventLogService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListenRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(EventLogServiceServer).Listen(m, &eventLogServiceListenServer{stream}) +} + +type EventLogService_ListenServer interface { + Send(*Event) error + grpc.ServerStream +} + +type eventLogServiceListenServer struct { + grpc.ServerStream +} + +func (x *eventLogServiceListenServer) Send(m *Event) error { + return x.ServerStream.SendMsg(m) +} + +// EventLogService_ServiceDesc is the grpc.ServiceDesc for EventLogService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EventLogService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "milvus.proto.eventlog.EventLogService", + HandlerType: (*EventLogServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Listen", + Handler: _EventLogService_Listen_Handler, + ServerStreams: true, + }, + }, + Metadata: "event_log.proto", +} diff --git a/pkg/go.mod b/pkg/go.mod index ee251d0eaafed..cc476985602de 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -10,7 +10,6 @@ require ( github.com/confluentinc/confluent-kafka-go v1.9.1 github.com/containerd/cgroups/v3 v3.0.3 github.com/expr-lang/expr v1.15.7 - github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/klauspost/compress v1.17.7 github.com/milvus-io/milvus-proto/go-api/v2 v2.4.10-0.20240819025435-512e3b98866a @@ -27,7 +26,7 @@ require ( github.com/spf13/cast v1.3.1 github.com/spf13/viper v1.8.1 github.com/streamnative/pulsarctl v0.5.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c github.com/tikv/client-go/v2 v2.0.4 github.com/uber/jaeger-client-go v2.30.0+incompatible @@ -92,6 +91,7 @@ require ( github.com/godbus/dbus/v5 v5.0.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/uuid v1.3.1 // indirect @@ -145,7 +145,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stathat/consistent v1.0.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07 // indirect @@ -191,3 +191,5 @@ replace ( ) exclude github.com/apache/pulsar-client-go/oauth2 v0.0.0-20211108044248-fe3b7c4e445b + +replace github.com/milvus-io/milvus-proto/go-api/v2 => github.com/weiliu1031/milvus-proto/go-api/v2 v2.0.0-20240819072240-c49e4c21521a diff --git a/pkg/go.sum b/pkg/go.sum index fb24f48af6c3c..2764bdeb34ec9 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -503,8 +503,6 @@ github.com/milvus-io/cgosymbolizer v0.0.0-20240722103217-b7dee0e50119 h1:9VXijWu github.com/milvus-io/cgosymbolizer v0.0.0-20240722103217-b7dee0e50119/go.mod h1:DvXTE/K/RtHehxU8/GtDs4vFtfw64jJ3PaCnFri8CRg= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZzUfIfYe5qYDBzt4ZYRqzUjTR6CvUzjat8= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4= -github.com/milvus-io/milvus-proto/go-api/v2 v2.4.10-0.20240819025435-512e3b98866a h1:0B/8Fo66D8Aa23Il0yrQvg1KKz92tE/BJ5BvkUxxAAk= -github.com/milvus-io/milvus-proto/go-api/v2 v2.4.10-0.20240819025435-512e3b98866a/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek= github.com/milvus-io/pulsar-client-go v0.6.10 h1:eqpJjU+/QX0iIhEo3nhOqMNXL+TyInAs1IAHZCrCM/A= github.com/milvus-io/pulsar-client-go v0.6.10/go.mod h1:lQqCkgwDF8YFYjKA+zOheTk1tev2B+bKj5j7+nm8M1w= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= @@ -709,8 +707,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -721,8 +720,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= @@ -754,6 +753,8 @@ github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBn github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/weiliu1031/milvus-proto/go-api/v2 v2.0.0-20240819072240-c49e4c21521a h1:leNggCcpfG6aC6tXlDcpgjn/9dt1RwoFbpI15G3U9/I= +github.com/weiliu1031/milvus-proto/go-api/v2 v2.0.0-20240819072240-c49e4c21521a/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= diff --git a/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go b/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go index 52a8d650891da..057359a9e2300 100644 --- a/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go +++ b/pkg/mq/mqimpl/rocksmq/client/client_impl_test.go @@ -17,9 +17,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/pkg/mq/mqimpl/rocksmq/client/util.go b/pkg/mq/mqimpl/rocksmq/client/util.go index bdefdb666d4f4..7aaa27f9e5af5 100644 --- a/pkg/mq/mqimpl/rocksmq/client/util.go +++ b/pkg/mq/mqimpl/rocksmq/client/util.go @@ -14,7 +14,7 @@ package client import ( "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) diff --git a/pkg/mq/msgdispatcher/mock_test.go b/pkg/mq/msgdispatcher/mock_test.go index 38b9cc21cc65a..a1be264befe77 100644 --- a/pkg/mq/msgdispatcher/mock_test.go +++ b/pkg/mq/msgdispatcher/mock_test.go @@ -110,7 +110,7 @@ func genInsertMsg(numRows int, vchannel string, msgID typeutil.UniqueID) *msgstr } return &msgstream.InsertMsg{ BaseMsg: msgstream.BaseMsg{HashValues: hashValues}, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Insert, MsgID: msgID}, ShardName: vchannel, Timestamps: genTimestamps(numRows), @@ -132,7 +132,7 @@ func genInsertMsg(numRows int, vchannel string, msgID typeutil.UniqueID) *msgstr func genDeleteMsg(numRows int, vchannel string, msgID typeutil.UniqueID) *msgstream.DeleteMsg { return &msgstream.DeleteMsg{ BaseMsg: msgstream.BaseMsg{HashValues: make([]uint32, numRows)}, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Delete, MsgID: msgID}, ShardName: vchannel, PrimaryKeys: &schemapb.IDs{ @@ -153,28 +153,28 @@ func genDDLMsg(msgType commonpb.MsgType) msgstream.TsMsg { case commonpb.MsgType_CreateCollection: return &msgstream.CreateCollectionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - CreateCollectionRequest: msgpb.CreateCollectionRequest{ + CreateCollectionRequest: &msgpb.CreateCollectionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_CreateCollection}, }, } case commonpb.MsgType_DropCollection: return &msgstream.DropCollectionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropCollection}, }, } case commonpb.MsgType_CreatePartition: return &msgstream.CreatePartitionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - CreatePartitionRequest: msgpb.CreatePartitionRequest{ + CreatePartitionRequest: &msgpb.CreatePartitionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_CreatePartition}, }, } case commonpb.MsgType_DropPartition: return &msgstream.DropPartitionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropPartition}, }, } @@ -185,7 +185,7 @@ func genDDLMsg(msgType commonpb.MsgType) msgstream.TsMsg { func genTimeTickMsg(ts typeutil.Timestamp) *msgstream.TimeTickMsg { return &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - TimeTickMsg: msgpb.TimeTickMsg{ + TimeTickMsg: &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, Timestamp: ts, diff --git a/pkg/mq/msgstream/factory_stream_test.go b/pkg/mq/msgstream/factory_stream_test.go index 0cf5fcbd7acdb..38803e9723cbe 100644 --- a/pkg/mq/msgstream/factory_stream_test.go +++ b/pkg/mq/msgstream/factory_stream_test.go @@ -90,7 +90,7 @@ func testInsertWithRepack(t *testing.T, f []Factory) { } func testInsertRepackFuncWithDifferentClient(t *testing.T, f []Factory) { - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -119,7 +119,7 @@ func testInsertRepackFuncWithDifferentClient(t *testing.T, f []Factory) { } func testDeleteRepackFuncWithDifferentClient(t *testing.T, f []Factory) { - deleteRequest := msgpb.DeleteRequest{ + deleteRequest := &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, diff --git a/pkg/mq/msgstream/mq_msgstream.go b/pkg/mq/msgstream/mq_msgstream.go index 40f9b21cf002b..0fa3e004fc9d5 100644 --- a/pkg/mq/msgstream/mq_msgstream.go +++ b/pkg/mq/msgstream/mq_msgstream.go @@ -26,10 +26,10 @@ import ( "time" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" uatomic "go.uber.org/atomic" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/pkg/mq/msgstream/mq_msgstream_test.go b/pkg/mq/msgstream/mq_msgstream_test.go index 3bf6e6a0b3548..1fbefef9e160f 100644 --- a/pkg/mq/msgstream/mq_msgstream_test.go +++ b/pkg/mq/msgstream/mq_msgstream_test.go @@ -245,7 +245,7 @@ func TestStream_PulsarMsgStream_InsertRepackFunc(t *testing.T) { consumerChannels := []string{c1, c2} consumerSubName := funcutil.RandomString(8) - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -299,7 +299,7 @@ func TestStream_PulsarMsgStream_DeleteRepackFunc(t *testing.T) { consumerChannels := []string{c1, c2} consumerSubName := funcutil.RandomString(8) - deleteRequest := msgpb.DeleteRequest{ + deleteRequest := &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, @@ -1251,7 +1251,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { time := uint64(reqID) switch msgType { case commonpb.MsgType_Insert: - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: reqID, @@ -1276,7 +1276,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { } return insertMsg case commonpb.MsgType_Delete: - deleteRequest := msgpb.DeleteRequest{ + deleteRequest := &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: reqID, @@ -1299,7 +1299,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { } return deleteMsg case commonpb.MsgType_CreateCollection: - createCollectionRequest := msgpb.CreateCollectionRequest{ + createCollectionRequest := &msgpb.CreateCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateCollection, MsgID: reqID, @@ -1326,7 +1326,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { } return createCollectionMsg case commonpb.MsgType_TimeTick: - timeTickResult := msgpb.TimeTickMsg{ + timeTickResult := &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, @@ -1350,7 +1350,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { func getTimeTickMsg(reqID UniqueID) TsMsg { hashValue := uint32(reqID) time := uint64(reqID) - timeTickResult := msgpb.TimeTickMsg{ + timeTickResult := &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, @@ -1399,7 +1399,7 @@ func getInsertMsgUniqueID(ts UniqueID) TsMsg { hashValue := uint32(ts) time := uint64(ts) - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: idCounter.Inc(), diff --git a/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go b/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go index b3de2b1895bcc..73f3f069b491a 100644 --- a/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go +++ b/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go @@ -84,7 +84,7 @@ func TestMqMsgStream_ComputeProduceChannelIndexes(t *testing.T) { // not called AsProducer yet insertMsg := &InsertMsg{ BaseMsg: generateBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -137,7 +137,7 @@ func TestMqMsgStream_Produce(t *testing.T) { // Produce before called AsProducer insertMsg := &InsertMsg{ BaseMsg: generateBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, diff --git a/pkg/mq/msgstream/msg.go b/pkg/mq/msgstream/msg.go index 2db757a0f6ed5..179fe44d11576 100644 --- a/pkg/mq/msgstream/msg.go +++ b/pkg/mq/msgstream/msg.go @@ -22,7 +22,7 @@ import ( "sync" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -125,7 +125,7 @@ func convertToByteArray(input interface{}) ([]byte, error) { // InsertMsg is a message pack that contains insert request type InsertMsg struct { BaseMsg - msgpb.InsertRequest + *msgpb.InsertRequest } // interface implementation validation @@ -154,7 +154,7 @@ func (it *InsertMsg) SourceID() int64 { // Marshal is used to serialize a message pack to byte array func (it *InsertMsg) Marshal(input TsMsg) (MarshalType, error) { insertMsg := input.(*InsertMsg) - insertRequest := &insertMsg.InsertRequest + insertRequest := insertMsg.InsertRequest mb, err := proto.Marshal(insertRequest) if err != nil { return nil, err @@ -164,12 +164,12 @@ func (it *InsertMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserialize a message pack from byte array func (it *InsertMsg) Unmarshal(input MarshalType) (TsMsg, error) { - insertRequest := msgpb.InsertRequest{} + insertRequest := &msgpb.InsertRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &insertRequest) + err = proto.Unmarshal(in, insertRequest) if err != nil { return nil, err } @@ -234,8 +234,8 @@ func (it *InsertMsg) CheckAligned() error { return nil } -func (it *InsertMsg) rowBasedIndexRequest(index int) msgpb.InsertRequest { - return msgpb.InsertRequest{ +func (it *InsertMsg) rowBasedIndexRequest(index int) *msgpb.InsertRequest { + return &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithMsgID(it.Base.MsgID), @@ -256,11 +256,11 @@ func (it *InsertMsg) rowBasedIndexRequest(index int) msgpb.InsertRequest { } } -func (it *InsertMsg) columnBasedIndexRequest(index int) msgpb.InsertRequest { +func (it *InsertMsg) columnBasedIndexRequest(index int) *msgpb.InsertRequest { colNum := len(it.GetFieldsData()) fieldsData := make([]*schemapb.FieldData, colNum) typeutil.AppendFieldData(fieldsData, it.GetFieldsData(), int64(index)) - return msgpb.InsertRequest{ + return &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithMsgID(it.Base.MsgID), @@ -282,7 +282,7 @@ func (it *InsertMsg) columnBasedIndexRequest(index int) msgpb.InsertRequest { } } -func (it *InsertMsg) IndexRequest(index int) msgpb.InsertRequest { +func (it *InsertMsg) IndexRequest(index int) *msgpb.InsertRequest { if it.IsRowBased() { return it.rowBasedIndexRequest(index) } @@ -303,7 +303,7 @@ func (it *InsertMsg) IndexMsg(index int) *InsertMsg { } func (it *InsertMsg) Size() int { - return proto.Size(&it.InsertRequest) + return proto.Size(it.InsertRequest) } /////////////////////////////////////////Delete////////////////////////////////////////// @@ -311,7 +311,7 @@ func (it *InsertMsg) Size() int { // DeleteMsg is a message pack that contains delete request type DeleteMsg struct { BaseMsg - msgpb.DeleteRequest + *msgpb.DeleteRequest } // interface implementation validation @@ -340,7 +340,7 @@ func (dt *DeleteMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (dt *DeleteMsg) Marshal(input TsMsg) (MarshalType, error) { deleteMsg := input.(*DeleteMsg) - deleteRequest := &deleteMsg.DeleteRequest + deleteRequest := deleteMsg.DeleteRequest mb, err := proto.Marshal(deleteRequest) if err != nil { return nil, err @@ -351,12 +351,12 @@ func (dt *DeleteMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (dt *DeleteMsg) Unmarshal(input MarshalType) (TsMsg, error) { - deleteRequest := msgpb.DeleteRequest{} + deleteRequest := &msgpb.DeleteRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &deleteRequest) + err = proto.Unmarshal(in, deleteRequest) if err != nil { return nil, err } @@ -406,7 +406,7 @@ func (dt *DeleteMsg) CheckAligned() error { } func (dt *DeleteMsg) Size() int { - return proto.Size(&dt.DeleteRequest) + return proto.Size(dt.DeleteRequest) } // ///////////////////////////////////////Upsert////////////////////////////////////////// @@ -420,7 +420,7 @@ type UpsertMsg struct { // TimeTickMsg is a message pack that contains time tick only type TimeTickMsg struct { BaseMsg - msgpb.TimeTickMsg + *msgpb.TimeTickMsg } // interface implementation validation @@ -449,7 +449,7 @@ func (tst *TimeTickMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (tst *TimeTickMsg) Marshal(input TsMsg) (MarshalType, error) { timeTickTask := input.(*TimeTickMsg) - timeTick := &timeTickTask.TimeTickMsg + timeTick := timeTickTask.TimeTickMsg mb, err := proto.Marshal(timeTick) if err != nil { return nil, err @@ -459,12 +459,12 @@ func (tst *TimeTickMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (tst *TimeTickMsg) Unmarshal(input MarshalType) (TsMsg, error) { - timeTickMsg := msgpb.TimeTickMsg{} + timeTickMsg := &msgpb.TimeTickMsg{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &timeTickMsg) + err = proto.Unmarshal(in, timeTickMsg) if err != nil { return nil, err } @@ -476,7 +476,7 @@ func (tst *TimeTickMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (tst *TimeTickMsg) Size() int { - return proto.Size(&tst.TimeTickMsg) + return proto.Size(tst.TimeTickMsg) } /////////////////////////////////////////CreateCollection////////////////////////////////////////// @@ -484,7 +484,7 @@ func (tst *TimeTickMsg) Size() int { // CreateCollectionMsg is a message pack that contains create collection request type CreateCollectionMsg struct { BaseMsg - msgpb.CreateCollectionRequest + *msgpb.CreateCollectionRequest } // interface implementation validation @@ -513,7 +513,7 @@ func (cc *CreateCollectionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (cc *CreateCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { createCollectionMsg := input.(*CreateCollectionMsg) - createCollectionRequest := &createCollectionMsg.CreateCollectionRequest + createCollectionRequest := createCollectionMsg.CreateCollectionRequest mb, err := proto.Marshal(createCollectionRequest) if err != nil { return nil, err @@ -523,12 +523,12 @@ func (cc *CreateCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (cc *CreateCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createCollectionRequest := msgpb.CreateCollectionRequest{} + createCollectionRequest := &msgpb.CreateCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createCollectionRequest) + err = proto.Unmarshal(in, createCollectionRequest) if err != nil { return nil, err } @@ -540,7 +540,7 @@ func (cc *CreateCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (cc *CreateCollectionMsg) Size() int { - return proto.Size(&cc.CreateCollectionRequest) + return proto.Size(cc.CreateCollectionRequest) } /////////////////////////////////////////DropCollection////////////////////////////////////////// @@ -548,7 +548,7 @@ func (cc *CreateCollectionMsg) Size() int { // DropCollectionMsg is a message pack that contains drop collection request type DropCollectionMsg struct { BaseMsg - msgpb.DropCollectionRequest + *msgpb.DropCollectionRequest } // interface implementation validation @@ -577,7 +577,7 @@ func (dc *DropCollectionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (dc *DropCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { dropCollectionMsg := input.(*DropCollectionMsg) - dropCollectionRequest := &dropCollectionMsg.DropCollectionRequest + dropCollectionRequest := dropCollectionMsg.DropCollectionRequest mb, err := proto.Marshal(dropCollectionRequest) if err != nil { return nil, err @@ -587,12 +587,12 @@ func (dc *DropCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (dc *DropCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropCollectionRequest := msgpb.DropCollectionRequest{} + dropCollectionRequest := &msgpb.DropCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropCollectionRequest) + err = proto.Unmarshal(in, dropCollectionRequest) if err != nil { return nil, err } @@ -604,7 +604,7 @@ func (dc *DropCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (dc *DropCollectionMsg) Size() int { - return proto.Size(&dc.DropCollectionRequest) + return proto.Size(dc.DropCollectionRequest) } /////////////////////////////////////////CreatePartition////////////////////////////////////////// @@ -612,7 +612,7 @@ func (dc *DropCollectionMsg) Size() int { // CreatePartitionMsg is a message pack that contains create partition request type CreatePartitionMsg struct { BaseMsg - msgpb.CreatePartitionRequest + *msgpb.CreatePartitionRequest } // interface implementation validation @@ -641,7 +641,7 @@ func (cp *CreatePartitionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (cp *CreatePartitionMsg) Marshal(input TsMsg) (MarshalType, error) { createPartitionMsg := input.(*CreatePartitionMsg) - createPartitionRequest := &createPartitionMsg.CreatePartitionRequest + createPartitionRequest := createPartitionMsg.CreatePartitionRequest mb, err := proto.Marshal(createPartitionRequest) if err != nil { return nil, err @@ -651,12 +651,12 @@ func (cp *CreatePartitionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (cp *CreatePartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createPartitionRequest := msgpb.CreatePartitionRequest{} + createPartitionRequest := &msgpb.CreatePartitionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createPartitionRequest) + err = proto.Unmarshal(in, createPartitionRequest) if err != nil { return nil, err } @@ -668,7 +668,7 @@ func (cp *CreatePartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (cp *CreatePartitionMsg) Size() int { - return proto.Size(&cp.CreatePartitionRequest) + return proto.Size(cp.CreatePartitionRequest) } /////////////////////////////////////////DropPartition////////////////////////////////////////// @@ -676,7 +676,7 @@ func (cp *CreatePartitionMsg) Size() int { // DropPartitionMsg is a message pack that contains drop partition request type DropPartitionMsg struct { BaseMsg - msgpb.DropPartitionRequest + *msgpb.DropPartitionRequest } // interface implementation validation @@ -705,7 +705,7 @@ func (dp *DropPartitionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (dp *DropPartitionMsg) Marshal(input TsMsg) (MarshalType, error) { dropPartitionMsg := input.(*DropPartitionMsg) - dropPartitionRequest := &dropPartitionMsg.DropPartitionRequest + dropPartitionRequest := dropPartitionMsg.DropPartitionRequest mb, err := proto.Marshal(dropPartitionRequest) if err != nil { return nil, err @@ -715,12 +715,12 @@ func (dp *DropPartitionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (dp *DropPartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropPartitionRequest := msgpb.DropPartitionRequest{} + dropPartitionRequest := &msgpb.DropPartitionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropPartitionRequest) + err = proto.Unmarshal(in, dropPartitionRequest) if err != nil { return nil, err } @@ -732,7 +732,7 @@ func (dp *DropPartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (dp *DropPartitionMsg) Size() int { - return proto.Size(&dp.DropPartitionRequest) + return proto.Size(dp.DropPartitionRequest) } /////////////////////////////////////////DataNodeTtMsg////////////////////////////////////////// @@ -740,7 +740,7 @@ func (dp *DropPartitionMsg) Size() int { // DataNodeTtMsg is a message pack that contains datanode time tick type DataNodeTtMsg struct { BaseMsg - msgpb.DataNodeTtMsg + *msgpb.DataNodeTtMsg } // interface implementation validation @@ -769,7 +769,7 @@ func (m *DataNodeTtMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (m *DataNodeTtMsg) Marshal(input TsMsg) (MarshalType, error) { msg := input.(*DataNodeTtMsg) - t, err := proto.Marshal(&msg.DataNodeTtMsg) + t, err := proto.Marshal(msg.DataNodeTtMsg) if err != nil { return nil, err } @@ -778,12 +778,12 @@ func (m *DataNodeTtMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (m *DataNodeTtMsg) Unmarshal(input MarshalType) (TsMsg, error) { - msg := msgpb.DataNodeTtMsg{} + msg := &msgpb.DataNodeTtMsg{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &msg) + err = proto.Unmarshal(in, msg) if err != nil { return nil, err } @@ -793,5 +793,5 @@ func (m *DataNodeTtMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (m *DataNodeTtMsg) Size() int { - return proto.Size(&m.DataNodeTtMsg) + return proto.Size(m.DataNodeTtMsg) } diff --git a/pkg/mq/msgstream/msg_for_collection.go b/pkg/mq/msgstream/msg_for_collection.go index a0fc13fd296ed..ae08317fe7173 100644 --- a/pkg/mq/msgstream/msg_for_collection.go +++ b/pkg/mq/msgstream/msg_for_collection.go @@ -19,7 +19,7 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) @@ -27,7 +27,7 @@ import ( // LoadCollectionMsg is a message pack that contains load collection request type LoadCollectionMsg struct { BaseMsg - milvuspb.LoadCollectionRequest + *milvuspb.LoadCollectionRequest } // interface implementation validation @@ -51,7 +51,7 @@ func (l *LoadCollectionMsg) SourceID() int64 { func (l *LoadCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { loadCollectionMsg := input.(*LoadCollectionMsg) - loadCollectionRequest := &loadCollectionMsg.LoadCollectionRequest + loadCollectionRequest := loadCollectionMsg.LoadCollectionRequest mb, err := proto.Marshal(loadCollectionRequest) if err != nil { return nil, err @@ -60,12 +60,12 @@ func (l *LoadCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { } func (l *LoadCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - loadCollectionRequest := milvuspb.LoadCollectionRequest{} + loadCollectionRequest := &milvuspb.LoadCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &loadCollectionRequest) + err = proto.Unmarshal(in, loadCollectionRequest) if err != nil { return nil, err } @@ -77,13 +77,13 @@ func (l *LoadCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (l *LoadCollectionMsg) Size() int { - return proto.Size(&l.LoadCollectionRequest) + return proto.Size(l.LoadCollectionRequest) } // ReleaseCollectionMsg is a message pack that contains release collection request type ReleaseCollectionMsg struct { BaseMsg - milvuspb.ReleaseCollectionRequest + *milvuspb.ReleaseCollectionRequest } var _ TsMsg = &ReleaseCollectionMsg{} @@ -106,7 +106,7 @@ func (r *ReleaseCollectionMsg) SourceID() int64 { func (r *ReleaseCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { releaseCollectionMsg := input.(*ReleaseCollectionMsg) - releaseCollectionRequest := &releaseCollectionMsg.ReleaseCollectionRequest + releaseCollectionRequest := releaseCollectionMsg.ReleaseCollectionRequest mb, err := proto.Marshal(releaseCollectionRequest) if err != nil { return nil, err @@ -115,12 +115,12 @@ func (r *ReleaseCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { } func (r *ReleaseCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - releaseCollectionRequest := milvuspb.ReleaseCollectionRequest{} + releaseCollectionRequest := &milvuspb.ReleaseCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &releaseCollectionRequest) + err = proto.Unmarshal(in, releaseCollectionRequest) if err != nil { return nil, err } @@ -132,12 +132,12 @@ func (r *ReleaseCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (r *ReleaseCollectionMsg) Size() int { - return proto.Size(&r.ReleaseCollectionRequest) + return proto.Size(r.ReleaseCollectionRequest) } type FlushMsg struct { BaseMsg - milvuspb.FlushRequest + *milvuspb.FlushRequest } var _ TsMsg = &FlushMsg{} @@ -160,7 +160,7 @@ func (f *FlushMsg) SourceID() int64 { func (f *FlushMsg) Marshal(input TsMsg) (MarshalType, error) { flushMsg := input.(*FlushMsg) - flushRequest := &flushMsg.FlushRequest + flushRequest := flushMsg.FlushRequest mb, err := proto.Marshal(flushRequest) if err != nil { return nil, err @@ -169,12 +169,12 @@ func (f *FlushMsg) Marshal(input TsMsg) (MarshalType, error) { } func (f *FlushMsg) Unmarshal(input MarshalType) (TsMsg, error) { - flushRequest := milvuspb.FlushRequest{} + flushRequest := &milvuspb.FlushRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &flushRequest) + err = proto.Unmarshal(in, flushRequest) if err != nil { return nil, err } @@ -186,5 +186,5 @@ func (f *FlushMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (f *FlushMsg) Size() int { - return proto.Size(&f.FlushRequest) + return proto.Size(f.FlushRequest) } diff --git a/pkg/mq/msgstream/msg_for_collection_test.go b/pkg/mq/msgstream/msg_for_collection_test.go index f84f17fefd408..665baa0d0ad07 100644 --- a/pkg/mq/msgstream/msg_for_collection_test.go +++ b/pkg/mq/msgstream/msg_for_collection_test.go @@ -29,7 +29,7 @@ import ( func TestFlushMsg(t *testing.T) { var msg TsMsg = &FlushMsg{ - FlushRequest: milvuspb.FlushRequest{ + FlushRequest: &milvuspb.FlushRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Flush, MsgID: 100, @@ -68,7 +68,7 @@ func TestFlushMsg(t *testing.T) { func TestLoadCollection(t *testing.T) { var msg TsMsg = &LoadCollectionMsg{ - LoadCollectionRequest: milvuspb.LoadCollectionRequest{ + LoadCollectionRequest: &milvuspb.LoadCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_LoadCollection, MsgID: 100, @@ -107,7 +107,7 @@ func TestLoadCollection(t *testing.T) { func TestReleaseCollection(t *testing.T) { var msg TsMsg = &ReleaseCollectionMsg{ - ReleaseCollectionRequest: milvuspb.ReleaseCollectionRequest{ + ReleaseCollectionRequest: &milvuspb.ReleaseCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_ReleaseCollection, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_for_database.go b/pkg/mq/msgstream/msg_for_database.go index b08bc98e01b49..c094ef76cd03f 100644 --- a/pkg/mq/msgstream/msg_for_database.go +++ b/pkg/mq/msgstream/msg_for_database.go @@ -19,14 +19,14 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) type CreateDatabaseMsg struct { BaseMsg - milvuspb.CreateDatabaseRequest + *milvuspb.CreateDatabaseRequest } var _ TsMsg = &CreateDatabaseMsg{} @@ -49,7 +49,7 @@ func (c *CreateDatabaseMsg) SourceID() int64 { func (c *CreateDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { createDataBaseMsg := input.(*CreateDatabaseMsg) - createDatabaseRequest := &createDataBaseMsg.CreateDatabaseRequest + createDatabaseRequest := createDataBaseMsg.CreateDatabaseRequest mb, err := proto.Marshal(createDatabaseRequest) if err != nil { return nil, err @@ -58,12 +58,12 @@ func (c *CreateDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { } func (c *CreateDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createDatabaseRequest := milvuspb.CreateDatabaseRequest{} + createDatabaseRequest := &milvuspb.CreateDatabaseRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createDatabaseRequest) + err = proto.Unmarshal(in, createDatabaseRequest) if err != nil { return nil, err } @@ -75,12 +75,12 @@ func (c *CreateDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (c *CreateDatabaseMsg) Size() int { - return proto.Size(&c.CreateDatabaseRequest) + return proto.Size(c.CreateDatabaseRequest) } type DropDatabaseMsg struct { BaseMsg - milvuspb.DropDatabaseRequest + *milvuspb.DropDatabaseRequest } var _ TsMsg = &DropDatabaseMsg{} @@ -103,7 +103,7 @@ func (d *DropDatabaseMsg) SourceID() int64 { func (d *DropDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { dropDataBaseMsg := input.(*DropDatabaseMsg) - dropDatabaseRequest := &dropDataBaseMsg.DropDatabaseRequest + dropDatabaseRequest := dropDataBaseMsg.DropDatabaseRequest mb, err := proto.Marshal(dropDatabaseRequest) if err != nil { return nil, err @@ -112,12 +112,12 @@ func (d *DropDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { } func (d *DropDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropDatabaseRequest := milvuspb.DropDatabaseRequest{} + dropDatabaseRequest := &milvuspb.DropDatabaseRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropDatabaseRequest) + err = proto.Unmarshal(in, dropDatabaseRequest) if err != nil { return nil, err } @@ -129,5 +129,5 @@ func (d *DropDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (d *DropDatabaseMsg) Size() int { - return proto.Size(&d.DropDatabaseRequest) + return proto.Size(d.DropDatabaseRequest) } diff --git a/pkg/mq/msgstream/msg_for_database_test.go b/pkg/mq/msgstream/msg_for_database_test.go index e3d9579599fb6..941b96ed8a5b8 100644 --- a/pkg/mq/msgstream/msg_for_database_test.go +++ b/pkg/mq/msgstream/msg_for_database_test.go @@ -29,7 +29,7 @@ import ( func TestCreateDatabase(t *testing.T) { var msg TsMsg = &CreateDatabaseMsg{ - CreateDatabaseRequest: milvuspb.CreateDatabaseRequest{ + CreateDatabaseRequest: &milvuspb.CreateDatabaseRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateDatabase, MsgID: 100, @@ -66,7 +66,7 @@ func TestCreateDatabase(t *testing.T) { func TestDropDatabase(t *testing.T) { var msg TsMsg = &DropDatabaseMsg{ - DropDatabaseRequest: milvuspb.DropDatabaseRequest{ + DropDatabaseRequest: &milvuspb.DropDatabaseRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropDatabase, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_for_index.go b/pkg/mq/msgstream/msg_for_index.go index 96c593d8bb731..3c2cc62f930d6 100644 --- a/pkg/mq/msgstream/msg_for_index.go +++ b/pkg/mq/msgstream/msg_for_index.go @@ -19,7 +19,7 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) @@ -27,7 +27,7 @@ import ( // CreateIndexMsg is a message pack that contains create index request type CreateIndexMsg struct { BaseMsg - milvuspb.CreateIndexRequest + *milvuspb.CreateIndexRequest } // interface implementation validation @@ -56,7 +56,7 @@ func (it *CreateIndexMsg) SourceID() int64 { // Marshal is used to serialize a message pack to byte array func (it *CreateIndexMsg) Marshal(input TsMsg) (MarshalType, error) { createIndexMsg := input.(*CreateIndexMsg) - createIndexRequest := &createIndexMsg.CreateIndexRequest + createIndexRequest := createIndexMsg.CreateIndexRequest mb, err := proto.Marshal(createIndexRequest) if err != nil { return nil, err @@ -66,12 +66,12 @@ func (it *CreateIndexMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserialize a message pack from byte array func (it *CreateIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createIndexRequest := milvuspb.CreateIndexRequest{} + createIndexRequest := &milvuspb.CreateIndexRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createIndexRequest) + err = proto.Unmarshal(in, createIndexRequest) if err != nil { return nil, err } @@ -83,13 +83,13 @@ func (it *CreateIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (it *CreateIndexMsg) Size() int { - return proto.Size(&it.CreateIndexRequest) + return proto.Size(it.CreateIndexRequest) } // AlterIndexMsg is a message pack that contains create index request type AlterIndexMsg struct { BaseMsg - milvuspb.AlterIndexRequest + *milvuspb.AlterIndexRequest } // interface implementation validation @@ -118,7 +118,7 @@ func (it *AlterIndexMsg) SourceID() int64 { // Marshal is used to serialize a message pack to byte array func (it *AlterIndexMsg) Marshal(input TsMsg) (MarshalType, error) { AlterIndexMsg := input.(*AlterIndexMsg) - AlterIndexRequest := &AlterIndexMsg.AlterIndexRequest + AlterIndexRequest := AlterIndexMsg.AlterIndexRequest mb, err := proto.Marshal(AlterIndexRequest) if err != nil { return nil, err @@ -128,12 +128,12 @@ func (it *AlterIndexMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserialize a message pack from byte array func (it *AlterIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { - alterIndexRequest := milvuspb.AlterIndexRequest{} + alterIndexRequest := &milvuspb.AlterIndexRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &alterIndexRequest) + err = proto.Unmarshal(in, alterIndexRequest) if err != nil { return nil, err } @@ -145,13 +145,13 @@ func (it *AlterIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (it *AlterIndexMsg) Size() int { - return proto.Size(&it.AlterIndexRequest) + return proto.Size(it.AlterIndexRequest) } // DropIndexMsg is a message pack that contains drop index request type DropIndexMsg struct { BaseMsg - milvuspb.DropIndexRequest + *milvuspb.DropIndexRequest } var _ TsMsg = &DropIndexMsg{} @@ -174,7 +174,7 @@ func (d *DropIndexMsg) SourceID() int64 { func (d *DropIndexMsg) Marshal(input TsMsg) (MarshalType, error) { dropIndexMsg := input.(*DropIndexMsg) - dropIndexRequest := &dropIndexMsg.DropIndexRequest + dropIndexRequest := dropIndexMsg.DropIndexRequest mb, err := proto.Marshal(dropIndexRequest) if err != nil { return nil, err @@ -183,12 +183,12 @@ func (d *DropIndexMsg) Marshal(input TsMsg) (MarshalType, error) { } func (d *DropIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropIndexRequest := milvuspb.DropIndexRequest{} + dropIndexRequest := &milvuspb.DropIndexRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropIndexRequest) + err = proto.Unmarshal(in, dropIndexRequest) if err != nil { return nil, err } @@ -200,5 +200,5 @@ func (d *DropIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (d *DropIndexMsg) Size() int { - return proto.Size(&d.DropIndexRequest) + return proto.Size(d.DropIndexRequest) } diff --git a/pkg/mq/msgstream/msg_for_index_test.go b/pkg/mq/msgstream/msg_for_index_test.go index 590231c16380e..bbbf64f650956 100644 --- a/pkg/mq/msgstream/msg_for_index_test.go +++ b/pkg/mq/msgstream/msg_for_index_test.go @@ -29,7 +29,7 @@ import ( func TestCreateIndex(t *testing.T) { var msg TsMsg = &CreateIndexMsg{ - CreateIndexRequest: milvuspb.CreateIndexRequest{ + CreateIndexRequest: &milvuspb.CreateIndexRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateIndex, MsgID: 100, @@ -65,7 +65,7 @@ func TestCreateIndex(t *testing.T) { func TestDropIndex(t *testing.T) { var msg TsMsg = &DropIndexMsg{ - DropIndexRequest: milvuspb.DropIndexRequest{ + DropIndexRequest: &milvuspb.DropIndexRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropIndex, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_for_partition.go b/pkg/mq/msgstream/msg_for_partition.go index 6a3117fa5ec62..d600ba854febf 100644 --- a/pkg/mq/msgstream/msg_for_partition.go +++ b/pkg/mq/msgstream/msg_for_partition.go @@ -19,14 +19,14 @@ package msgstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) type LoadPartitionsMsg struct { BaseMsg - milvuspb.LoadPartitionsRequest + *milvuspb.LoadPartitionsRequest } var _ TsMsg = &LoadPartitionsMsg{} @@ -49,7 +49,7 @@ func (l *LoadPartitionsMsg) SourceID() int64 { func (l *LoadPartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { loadPartitionsMsg := input.(*LoadPartitionsMsg) - loadPartitionsRequest := &loadPartitionsMsg.LoadPartitionsRequest + loadPartitionsRequest := loadPartitionsMsg.LoadPartitionsRequest mb, err := proto.Marshal(loadPartitionsRequest) if err != nil { return nil, err @@ -58,12 +58,12 @@ func (l *LoadPartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { } func (l *LoadPartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { - loadPartitionsRequest := milvuspb.LoadPartitionsRequest{} + loadPartitionsRequest := &milvuspb.LoadPartitionsRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &loadPartitionsRequest) + err = proto.Unmarshal(in, loadPartitionsRequest) if err != nil { return nil, err } @@ -75,12 +75,12 @@ func (l *LoadPartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (l *LoadPartitionsMsg) Size() int { - return proto.Size(&l.LoadPartitionsRequest) + return proto.Size(l.LoadPartitionsRequest) } type ReleasePartitionsMsg struct { BaseMsg - milvuspb.ReleasePartitionsRequest + *milvuspb.ReleasePartitionsRequest } var _ TsMsg = &ReleasePartitionsMsg{} @@ -103,7 +103,7 @@ func (r *ReleasePartitionsMsg) SourceID() int64 { func (r *ReleasePartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { releasePartitionsMsg := input.(*ReleasePartitionsMsg) - releasePartitionsRequest := &releasePartitionsMsg.ReleasePartitionsRequest + releasePartitionsRequest := releasePartitionsMsg.ReleasePartitionsRequest mb, err := proto.Marshal(releasePartitionsRequest) if err != nil { return nil, err @@ -112,12 +112,12 @@ func (r *ReleasePartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { } func (r *ReleasePartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { - releasePartitionsRequest := milvuspb.ReleasePartitionsRequest{} + releasePartitionsRequest := &milvuspb.ReleasePartitionsRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &releasePartitionsRequest) + err = proto.Unmarshal(in, releasePartitionsRequest) if err != nil { return nil, err } @@ -128,5 +128,5 @@ func (r *ReleasePartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (r *ReleasePartitionsMsg) Size() int { - return proto.Size(&r.ReleasePartitionsRequest) + return proto.Size(r.ReleasePartitionsRequest) } diff --git a/pkg/mq/msgstream/msg_for_partition_test.go b/pkg/mq/msgstream/msg_for_partition_test.go index 981be41bc6c3a..caed9a9b92d67 100644 --- a/pkg/mq/msgstream/msg_for_partition_test.go +++ b/pkg/mq/msgstream/msg_for_partition_test.go @@ -29,7 +29,7 @@ import ( func TestLoadPartitions(t *testing.T) { msg := &LoadPartitionsMsg{ - LoadPartitionsRequest: milvuspb.LoadPartitionsRequest{ + LoadPartitionsRequest: &milvuspb.LoadPartitionsRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_LoadPartitions, MsgID: 100, @@ -74,7 +74,7 @@ func TestLoadPartitions(t *testing.T) { func TestReleasePartitions(t *testing.T) { msg := &ReleasePartitionsMsg{ - ReleasePartitionsRequest: milvuspb.ReleasePartitionsRequest{ + ReleasePartitionsRequest: &milvuspb.ReleasePartitionsRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_ReleasePartitions, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_test.go b/pkg/mq/msgstream/msg_test.go index 20e7b4c81c1e7..67e3a9286c22a 100644 --- a/pkg/mq/msgstream/msg_test.go +++ b/pkg/mq/msgstream/msg_test.go @@ -83,7 +83,7 @@ func generateBaseMsg() BaseMsg { func TestInsertMsg(t *testing.T) { insertMsg := &InsertMsg{ BaseMsg: generateBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -136,7 +136,7 @@ func TestInsertMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestInsertMsg_RowBasedFormat(t *testing.T) { msg := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Version: msgpb.InsertDataVersion_RowBased, }, } @@ -145,7 +145,7 @@ func TestInsertMsg_RowBasedFormat(t *testing.T) { func TestInsertMsg_ColumnBasedFormat(t *testing.T) { msg := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Version: msgpb.InsertDataVersion_ColumnBased, }, } @@ -154,7 +154,7 @@ func TestInsertMsg_ColumnBasedFormat(t *testing.T) { func TestInsertMsg_NRows(t *testing.T) { msg1 := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ RowData: []*commonpb.Blob{ {}, {}, @@ -165,7 +165,7 @@ func TestInsertMsg_NRows(t *testing.T) { } assert.Equal(t, uint64(2), msg1.NRows()) msg2 := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ RowData: nil, FieldsData: []*schemapb.FieldData{ {}, @@ -179,7 +179,7 @@ func TestInsertMsg_NRows(t *testing.T) { func TestInsertMsg_CheckAligned(t *testing.T) { msg1 := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Timestamps: []uint64{1}, RowIDs: []int64{1}, RowData: []*commonpb.Blob{ @@ -217,7 +217,7 @@ func TestInsertMsg_IndexMsg(t *testing.T) { BeginTimestamp: 1, EndTimestamp: 2, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 3, @@ -272,7 +272,7 @@ func TestInsertMsg_IndexMsg(t *testing.T) { func TestDeleteMsg(t *testing.T) { deleteMsg := &DeleteMsg{ BaseMsg: generateBaseMsg(), - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, @@ -321,7 +321,7 @@ func TestDeleteMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestTimeTickMsg(t *testing.T) { timeTickMsg := &TimeTickMsg{ BaseMsg: generateBaseMsg(), - TimeTickMsg: msgpb.TimeTickMsg{ + TimeTickMsg: &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: 1, @@ -364,7 +364,7 @@ func TestTimeTickMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestCreateCollectionMsg(t *testing.T) { createCollectionMsg := &CreateCollectionMsg{ BaseMsg: generateBaseMsg(), - CreateCollectionRequest: msgpb.CreateCollectionRequest{ + CreateCollectionRequest: &msgpb.CreateCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateCollection, MsgID: 1, @@ -416,7 +416,7 @@ func TestCreateCollectionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestDropCollectionMsg(t *testing.T) { dropCollectionMsg := &DropCollectionMsg{ BaseMsg: generateBaseMsg(), - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropCollection, MsgID: 1, @@ -463,7 +463,7 @@ func TestDropCollectionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestCreatePartitionMsg(t *testing.T) { createPartitionMsg := &CreatePartitionMsg{ BaseMsg: generateBaseMsg(), - CreatePartitionRequest: msgpb.CreatePartitionRequest{ + CreatePartitionRequest: &msgpb.CreatePartitionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreatePartition, MsgID: 1, @@ -512,7 +512,7 @@ func TestCreatePartitionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestDropPartitionMsg(t *testing.T) { dropPartitionMsg := &DropPartitionMsg{ BaseMsg: generateBaseMsg(), - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropPartition, MsgID: 1, @@ -561,7 +561,7 @@ func TestDropPartitionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestDataNodeTtMsg(t *testing.T) { dataNodeTtMsg := &DataNodeTtMsg{ BaseMsg: generateBaseMsg(), - DataNodeTtMsg: msgpb.DataNodeTtMsg{ + DataNodeTtMsg: &msgpb.DataNodeTtMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DataNodeTt, MsgID: 1, diff --git a/pkg/mq/msgstream/unmarshal_test.go b/pkg/mq/msgstream/unmarshal_test.go index 962102bafed5c..cabc70044d539 100644 --- a/pkg/mq/msgstream/unmarshal_test.go +++ b/pkg/mq/msgstream/unmarshal_test.go @@ -19,8 +19,8 @@ package msgstream import ( "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -34,7 +34,7 @@ func Test_ProtoUnmarshalDispatcher(t *testing.T) { EndTimestamp: 0, HashValues: []uint32{1}, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, diff --git a/pkg/streaming/util/message/messagepb/message.pb.go b/pkg/streaming/util/message/messagepb/message.pb.go deleted file mode 100644 index 025c3c7e0c12d..0000000000000 --- a/pkg/streaming/util/message/messagepb/message.pb.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: message.proto - -package messagepb - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - 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 - -// FlushMessagePayload is the payload of flush message. -type FlushMessagePayload struct { - CollectionId int64 `protobuf:"varint,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - SegmentId []int64 `protobuf:"varint,2,rep,packed,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FlushMessagePayload) Reset() { *m = FlushMessagePayload{} } -func (m *FlushMessagePayload) String() string { return proto.CompactTextString(m) } -func (*FlushMessagePayload) ProtoMessage() {} -func (*FlushMessagePayload) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0} -} - -func (m *FlushMessagePayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FlushMessagePayload.Unmarshal(m, b) -} -func (m *FlushMessagePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FlushMessagePayload.Marshal(b, m, deterministic) -} -func (m *FlushMessagePayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlushMessagePayload.Merge(m, src) -} -func (m *FlushMessagePayload) XXX_Size() int { - return xxx_messageInfo_FlushMessagePayload.Size(m) -} -func (m *FlushMessagePayload) XXX_DiscardUnknown() { - xxx_messageInfo_FlushMessagePayload.DiscardUnknown(m) -} - -var xxx_messageInfo_FlushMessagePayload proto.InternalMessageInfo - -func (m *FlushMessagePayload) GetCollectionId() int64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -func (m *FlushMessagePayload) GetSegmentId() []int64 { - if m != nil { - return m.SegmentId - } - return nil -} - -// TimeTickMessageHeader just nothing. -type TimeTickMessageHeader struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TimeTickMessageHeader) Reset() { *m = TimeTickMessageHeader{} } -func (m *TimeTickMessageHeader) String() string { return proto.CompactTextString(m) } -func (*TimeTickMessageHeader) ProtoMessage() {} -func (*TimeTickMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1} -} - -func (m *TimeTickMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TimeTickMessageHeader.Unmarshal(m, b) -} -func (m *TimeTickMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TimeTickMessageHeader.Marshal(b, m, deterministic) -} -func (m *TimeTickMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeTickMessageHeader.Merge(m, src) -} -func (m *TimeTickMessageHeader) XXX_Size() int { - return xxx_messageInfo_TimeTickMessageHeader.Size(m) -} -func (m *TimeTickMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_TimeTickMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeTickMessageHeader proto.InternalMessageInfo - -// InsertMessageHeader is the header of insert message. -type InsertMessageHeader struct { - CollectionId int64 `protobuf:"varint,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - Partitions []*PartitionSegmentAssignment `protobuf:"bytes,2,rep,name=partitions,proto3" json:"partitions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InsertMessageHeader) Reset() { *m = InsertMessageHeader{} } -func (m *InsertMessageHeader) String() string { return proto.CompactTextString(m) } -func (*InsertMessageHeader) ProtoMessage() {} -func (*InsertMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{2} -} - -func (m *InsertMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InsertMessageHeader.Unmarshal(m, b) -} -func (m *InsertMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InsertMessageHeader.Marshal(b, m, deterministic) -} -func (m *InsertMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_InsertMessageHeader.Merge(m, src) -} -func (m *InsertMessageHeader) XXX_Size() int { - return xxx_messageInfo_InsertMessageHeader.Size(m) -} -func (m *InsertMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_InsertMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_InsertMessageHeader proto.InternalMessageInfo - -func (m *InsertMessageHeader) GetCollectionId() int64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -func (m *InsertMessageHeader) GetPartitions() []*PartitionSegmentAssignment { - if m != nil { - return m.Partitions - } - return nil -} - -// PartitionSegmentAssignment is the segment assignment of a partition. -type PartitionSegmentAssignment struct { - PartitionId int64 `protobuf:"varint,1,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` - Rows uint64 `protobuf:"varint,2,opt,name=rows,proto3" json:"rows,omitempty"` - BinarySize uint64 `protobuf:"varint,3,opt,name=binary_size,json=binarySize,proto3" json:"binary_size,omitempty"` - SegmentAssignment *SegmentAssignment `protobuf:"bytes,4,opt,name=segment_assignment,json=segmentAssignment,proto3" json:"segment_assignment,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionSegmentAssignment) Reset() { *m = PartitionSegmentAssignment{} } -func (m *PartitionSegmentAssignment) String() string { return proto.CompactTextString(m) } -func (*PartitionSegmentAssignment) ProtoMessage() {} -func (*PartitionSegmentAssignment) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{3} -} - -func (m *PartitionSegmentAssignment) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PartitionSegmentAssignment.Unmarshal(m, b) -} -func (m *PartitionSegmentAssignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PartitionSegmentAssignment.Marshal(b, m, deterministic) -} -func (m *PartitionSegmentAssignment) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionSegmentAssignment.Merge(m, src) -} -func (m *PartitionSegmentAssignment) XXX_Size() int { - return xxx_messageInfo_PartitionSegmentAssignment.Size(m) -} -func (m *PartitionSegmentAssignment) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionSegmentAssignment.DiscardUnknown(m) -} - -var xxx_messageInfo_PartitionSegmentAssignment proto.InternalMessageInfo - -func (m *PartitionSegmentAssignment) GetPartitionId() int64 { - if m != nil { - return m.PartitionId - } - return 0 -} - -func (m *PartitionSegmentAssignment) GetRows() uint64 { - if m != nil { - return m.Rows - } - return 0 -} - -func (m *PartitionSegmentAssignment) GetBinarySize() uint64 { - if m != nil { - return m.BinarySize - } - return 0 -} - -func (m *PartitionSegmentAssignment) GetSegmentAssignment() *SegmentAssignment { - if m != nil { - return m.SegmentAssignment - } - return nil -} - -// SegmentAssignment is the assignment of a segment. -type SegmentAssignment struct { - SegmentId int64 `protobuf:"varint,1,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SegmentAssignment) Reset() { *m = SegmentAssignment{} } -func (m *SegmentAssignment) String() string { return proto.CompactTextString(m) } -func (*SegmentAssignment) ProtoMessage() {} -func (*SegmentAssignment) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{4} -} - -func (m *SegmentAssignment) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SegmentAssignment.Unmarshal(m, b) -} -func (m *SegmentAssignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SegmentAssignment.Marshal(b, m, deterministic) -} -func (m *SegmentAssignment) XXX_Merge(src proto.Message) { - xxx_messageInfo_SegmentAssignment.Merge(m, src) -} -func (m *SegmentAssignment) XXX_Size() int { - return xxx_messageInfo_SegmentAssignment.Size(m) -} -func (m *SegmentAssignment) XXX_DiscardUnknown() { - xxx_messageInfo_SegmentAssignment.DiscardUnknown(m) -} - -var xxx_messageInfo_SegmentAssignment proto.InternalMessageInfo - -func (m *SegmentAssignment) GetSegmentId() int64 { - if m != nil { - return m.SegmentId - } - return 0 -} - -// DeleteMessageHeader -type DeleteMessageHeader struct { - CollectionId int64 `protobuf:"varint,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteMessageHeader) Reset() { *m = DeleteMessageHeader{} } -func (m *DeleteMessageHeader) String() string { return proto.CompactTextString(m) } -func (*DeleteMessageHeader) ProtoMessage() {} -func (*DeleteMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{5} -} - -func (m *DeleteMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteMessageHeader.Unmarshal(m, b) -} -func (m *DeleteMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteMessageHeader.Marshal(b, m, deterministic) -} -func (m *DeleteMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteMessageHeader.Merge(m, src) -} -func (m *DeleteMessageHeader) XXX_Size() int { - return xxx_messageInfo_DeleteMessageHeader.Size(m) -} -func (m *DeleteMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteMessageHeader proto.InternalMessageInfo - -func (m *DeleteMessageHeader) GetCollectionId() int64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -// FlushMessageHeader just nothing. -type FlushMessageHeader struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FlushMessageHeader) Reset() { *m = FlushMessageHeader{} } -func (m *FlushMessageHeader) String() string { return proto.CompactTextString(m) } -func (*FlushMessageHeader) ProtoMessage() {} -func (*FlushMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{6} -} - -func (m *FlushMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FlushMessageHeader.Unmarshal(m, b) -} -func (m *FlushMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FlushMessageHeader.Marshal(b, m, deterministic) -} -func (m *FlushMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlushMessageHeader.Merge(m, src) -} -func (m *FlushMessageHeader) XXX_Size() int { - return xxx_messageInfo_FlushMessageHeader.Size(m) -} -func (m *FlushMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_FlushMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_FlushMessageHeader proto.InternalMessageInfo - -// CreateCollectionMessageHeader is the header of create collection message. -type CreateCollectionMessageHeader struct { - CollectionId int64 `protobuf:"varint,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateCollectionMessageHeader) Reset() { *m = CreateCollectionMessageHeader{} } -func (m *CreateCollectionMessageHeader) String() string { return proto.CompactTextString(m) } -func (*CreateCollectionMessageHeader) ProtoMessage() {} -func (*CreateCollectionMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{7} -} - -func (m *CreateCollectionMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateCollectionMessageHeader.Unmarshal(m, b) -} -func (m *CreateCollectionMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateCollectionMessageHeader.Marshal(b, m, deterministic) -} -func (m *CreateCollectionMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateCollectionMessageHeader.Merge(m, src) -} -func (m *CreateCollectionMessageHeader) XXX_Size() int { - return xxx_messageInfo_CreateCollectionMessageHeader.Size(m) -} -func (m *CreateCollectionMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_CreateCollectionMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateCollectionMessageHeader proto.InternalMessageInfo - -func (m *CreateCollectionMessageHeader) GetCollectionId() int64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -// DropCollectionMessageHeader is the header of drop collection message. -type DropCollectionMessageHeader struct { - CollectionId int64 `protobuf:"varint,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DropCollectionMessageHeader) Reset() { *m = DropCollectionMessageHeader{} } -func (m *DropCollectionMessageHeader) String() string { return proto.CompactTextString(m) } -func (*DropCollectionMessageHeader) ProtoMessage() {} -func (*DropCollectionMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{8} -} - -func (m *DropCollectionMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DropCollectionMessageHeader.Unmarshal(m, b) -} -func (m *DropCollectionMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DropCollectionMessageHeader.Marshal(b, m, deterministic) -} -func (m *DropCollectionMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_DropCollectionMessageHeader.Merge(m, src) -} -func (m *DropCollectionMessageHeader) XXX_Size() int { - return xxx_messageInfo_DropCollectionMessageHeader.Size(m) -} -func (m *DropCollectionMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_DropCollectionMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_DropCollectionMessageHeader proto.InternalMessageInfo - -func (m *DropCollectionMessageHeader) GetCollectionId() int64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -// CreatePartitionMessageHeader is the header of create partition message. -type CreatePartitionMessageHeader struct { - CollectionId int64 `protobuf:"varint,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - PartitionId int64 `protobuf:"varint,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreatePartitionMessageHeader) Reset() { *m = CreatePartitionMessageHeader{} } -func (m *CreatePartitionMessageHeader) String() string { return proto.CompactTextString(m) } -func (*CreatePartitionMessageHeader) ProtoMessage() {} -func (*CreatePartitionMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{9} -} - -func (m *CreatePartitionMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreatePartitionMessageHeader.Unmarshal(m, b) -} -func (m *CreatePartitionMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreatePartitionMessageHeader.Marshal(b, m, deterministic) -} -func (m *CreatePartitionMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreatePartitionMessageHeader.Merge(m, src) -} -func (m *CreatePartitionMessageHeader) XXX_Size() int { - return xxx_messageInfo_CreatePartitionMessageHeader.Size(m) -} -func (m *CreatePartitionMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_CreatePartitionMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_CreatePartitionMessageHeader proto.InternalMessageInfo - -func (m *CreatePartitionMessageHeader) GetCollectionId() int64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -func (m *CreatePartitionMessageHeader) GetPartitionId() int64 { - if m != nil { - return m.PartitionId - } - return 0 -} - -// DropPartitionMessageHeader is the header of drop partition message. -type DropPartitionMessageHeader struct { - CollectionId int64 `protobuf:"varint,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - PartitionId int64 `protobuf:"varint,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DropPartitionMessageHeader) Reset() { *m = DropPartitionMessageHeader{} } -func (m *DropPartitionMessageHeader) String() string { return proto.CompactTextString(m) } -func (*DropPartitionMessageHeader) ProtoMessage() {} -func (*DropPartitionMessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{10} -} - -func (m *DropPartitionMessageHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DropPartitionMessageHeader.Unmarshal(m, b) -} -func (m *DropPartitionMessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DropPartitionMessageHeader.Marshal(b, m, deterministic) -} -func (m *DropPartitionMessageHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_DropPartitionMessageHeader.Merge(m, src) -} -func (m *DropPartitionMessageHeader) XXX_Size() int { - return xxx_messageInfo_DropPartitionMessageHeader.Size(m) -} -func (m *DropPartitionMessageHeader) XXX_DiscardUnknown() { - xxx_messageInfo_DropPartitionMessageHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_DropPartitionMessageHeader proto.InternalMessageInfo - -func (m *DropPartitionMessageHeader) GetCollectionId() int64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -func (m *DropPartitionMessageHeader) GetPartitionId() int64 { - if m != nil { - return m.PartitionId - } - return 0 -} - -func init() { - proto.RegisterType((*FlushMessagePayload)(nil), "milvus.proto.message.FlushMessagePayload") - proto.RegisterType((*TimeTickMessageHeader)(nil), "milvus.proto.message.TimeTickMessageHeader") - proto.RegisterType((*InsertMessageHeader)(nil), "milvus.proto.message.InsertMessageHeader") - proto.RegisterType((*PartitionSegmentAssignment)(nil), "milvus.proto.message.PartitionSegmentAssignment") - proto.RegisterType((*SegmentAssignment)(nil), "milvus.proto.message.SegmentAssignment") - proto.RegisterType((*DeleteMessageHeader)(nil), "milvus.proto.message.DeleteMessageHeader") - proto.RegisterType((*FlushMessageHeader)(nil), "milvus.proto.message.FlushMessageHeader") - proto.RegisterType((*CreateCollectionMessageHeader)(nil), "milvus.proto.message.CreateCollectionMessageHeader") - proto.RegisterType((*DropCollectionMessageHeader)(nil), "milvus.proto.message.DropCollectionMessageHeader") - proto.RegisterType((*CreatePartitionMessageHeader)(nil), "milvus.proto.message.CreatePartitionMessageHeader") - proto.RegisterType((*DropPartitionMessageHeader)(nil), "milvus.proto.message.DropPartitionMessageHeader") -} - -func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } - -var fileDescriptor_33c57e4bae7b9afd = []byte{ - // 404 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x52, 0x4d, 0xab, 0xd3, 0x40, - 0x14, 0x25, 0x2f, 0x45, 0xf0, 0xe6, 0xbd, 0x45, 0xa7, 0x15, 0x4b, 0xb5, 0x58, 0xe3, 0xc2, 0x6c, - 0x4c, 0xa4, 0xee, 0x5c, 0x69, 0x5b, 0xc4, 0x2c, 0x84, 0x92, 0x16, 0x41, 0x37, 0x65, 0x92, 0x5c, - 0xd3, 0xa1, 0x49, 0x26, 0xcc, 0x4c, 0x94, 0xf6, 0x37, 0xf8, 0xd3, 0xfc, 0x51, 0x92, 0x8f, 0xa6, - 0x9f, 0x82, 0x56, 0xde, 0x2a, 0xf7, 0x9e, 0xb9, 0xdc, 0x7b, 0x4e, 0xce, 0x81, 0xbb, 0x04, 0xa5, - 0xa4, 0x11, 0xda, 0x99, 0xe0, 0x8a, 0x93, 0x6e, 0xc2, 0xe2, 0xef, 0xb9, 0xac, 0x3a, 0xbb, 0x7e, - 0x33, 0xbf, 0x40, 0xe7, 0x43, 0x9c, 0xcb, 0xd5, 0xa7, 0xaa, 0x9f, 0xd1, 0x4d, 0xcc, 0x69, 0x48, - 0x5e, 0xc0, 0x5d, 0xc0, 0xe3, 0x18, 0x03, 0xc5, 0x78, 0xba, 0x64, 0x61, 0x4f, 0x1b, 0x6a, 0x96, - 0xee, 0xdd, 0xee, 0x41, 0x37, 0x24, 0x03, 0x00, 0x89, 0x51, 0x82, 0xa9, 0x2a, 0x26, 0x6e, 0x86, - 0xba, 0xa5, 0x7b, 0x0f, 0x6b, 0xc4, 0x0d, 0xcd, 0xc7, 0xf0, 0x68, 0xc1, 0x12, 0x5c, 0xb0, 0x60, - 0x5d, 0x6f, 0xff, 0x88, 0x34, 0x44, 0x61, 0xfe, 0xd4, 0xa0, 0xe3, 0xa6, 0x12, 0x85, 0x3a, 0xc2, - 0xff, 0xee, 0xe8, 0x0c, 0x20, 0xa3, 0x42, 0xb1, 0xa2, 0x95, 0xe5, 0x51, 0x63, 0xf4, 0xda, 0xbe, - 0xa4, 0xcd, 0x9e, 0xed, 0xe6, 0xe6, 0x15, 0xa7, 0xf7, 0x52, 0xb2, 0x28, 0x2d, 0x2a, 0xef, 0x60, - 0x87, 0xf9, 0x4b, 0x83, 0xfe, 0x9f, 0x47, 0xc9, 0x73, 0xb8, 0x6d, 0x86, 0xf7, 0xa4, 0x8c, 0x06, - 0x73, 0x43, 0x42, 0xa0, 0x25, 0xf8, 0x8f, 0x82, 0x8d, 0x66, 0xb5, 0xbc, 0xb2, 0x26, 0xcf, 0xc0, - 0xf0, 0x59, 0x4a, 0xc5, 0x66, 0x29, 0xd9, 0x16, 0x7b, 0x7a, 0xf9, 0x04, 0x15, 0x34, 0x67, 0x5b, - 0x24, 0x9f, 0x81, 0xec, 0xfe, 0x1e, 0x6d, 0xae, 0xf5, 0x5a, 0x43, 0xcd, 0x32, 0x46, 0x2f, 0x2f, - 0x0b, 0x3a, 0xd7, 0xd1, 0x96, 0xa7, 0x90, 0x39, 0x82, 0xf6, 0xb9, 0x88, 0x63, 0xab, 0x2a, 0x09, - 0x07, 0x56, 0xbd, 0x85, 0xce, 0x14, 0x63, 0x54, 0xf8, 0xef, 0x86, 0x98, 0x5d, 0x20, 0x87, 0x09, - 0xaa, 0x3d, 0x9e, 0xc2, 0x60, 0x22, 0x90, 0x2a, 0x9c, 0x34, 0xb3, 0x57, 0xec, 0x1e, 0xc3, 0x93, - 0xa9, 0xe0, 0xd9, 0x7f, 0xed, 0xf8, 0x06, 0x4f, 0x2b, 0x26, 0x8d, 0xc7, 0x57, 0xa4, 0xee, 0x34, - 0x04, 0x37, 0x67, 0x21, 0x30, 0x43, 0xe8, 0x17, 0x5c, 0xef, 0xf7, 0xca, 0x78, 0xfc, 0xf5, 0x5d, - 0xc4, 0xd4, 0x2a, 0xf7, 0xed, 0x80, 0x27, 0x4e, 0x95, 0x92, 0x57, 0x8c, 0xd7, 0x95, 0x93, 0xad, - 0x23, 0x47, 0x2a, 0x81, 0x34, 0x61, 0x69, 0xe4, 0xe4, 0x8a, 0xc5, 0x4e, 0x1d, 0x9e, 0xdd, 0x37, - 0xf3, 0xfd, 0x07, 0x65, 0xaa, 0xde, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x2b, 0x90, 0xb0, - 0x21, 0x04, 0x00, 0x00, -} diff --git a/pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go b/pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go new file mode 100644 index 0000000000000..b3e2df6cd8605 --- /dev/null +++ b/pkg/streaming/walimpls/impls/pulsar/message_id_data.pb.go @@ -0,0 +1,177 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.6.1 +// source: message_id_data.proto + +package pulsar + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageIdData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LedgerId *uint64 `protobuf:"varint,1,req,name=ledgerId" json:"ledgerId,omitempty"` + EntryId *uint64 `protobuf:"varint,2,req,name=entryId" json:"entryId,omitempty"` + Partition *int32 `protobuf:"varint,3,opt,name=partition" json:"partition,omitempty"` + BatchIndex *int32 `protobuf:"varint,4,opt,name=batch_index,json=batchIndex" json:"batch_index,omitempty"` +} + +func (x *MessageIdData) Reset() { + *x = MessageIdData{} + if protoimpl.UnsafeEnabled { + mi := &file_message_id_data_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageIdData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageIdData) ProtoMessage() {} + +func (x *MessageIdData) ProtoReflect() protoreflect.Message { + mi := &file_message_id_data_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageIdData.ProtoReflect.Descriptor instead. +func (*MessageIdData) Descriptor() ([]byte, []int) { + return file_message_id_data_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageIdData) GetLedgerId() uint64 { + if x != nil && x.LedgerId != nil { + return *x.LedgerId + } + return 0 +} + +func (x *MessageIdData) GetEntryId() uint64 { + if x != nil && x.EntryId != nil { + return *x.EntryId + } + return 0 +} + +func (x *MessageIdData) GetPartition() int32 { + if x != nil && x.Partition != nil { + return *x.Partition + } + return 0 +} + +func (x *MessageIdData) GetBatchIndex() int32 { + if x != nil && x.BatchIndex != nil { + return *x.BatchIndex + } + return 0 +} + +var File_message_id_data_proto protoreflect.FileDescriptor + +var file_message_id_data_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, + 0x77, 0x61, 0x6c, 0x2e, 0x70, 0x75, 0x6c, 0x73, 0x61, 0x72, 0x22, 0x84, 0x01, 0x0a, 0x0d, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x02, 0x28, 0x04, 0x52, 0x08, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, + 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x02, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x77, + 0x61, 0x6c, 0x69, 0x6d, 0x70, 0x6c, 0x73, 0x2f, 0x69, 0x6d, 0x70, 0x6c, 0x73, 0x2f, 0x70, 0x75, + 0x6c, 0x73, 0x61, 0x72, +} + +var ( + file_message_id_data_proto_rawDescOnce sync.Once + file_message_id_data_proto_rawDescData = file_message_id_data_proto_rawDesc +) + +func file_message_id_data_proto_rawDescGZIP() []byte { + file_message_id_data_proto_rawDescOnce.Do(func() { + file_message_id_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_id_data_proto_rawDescData) + }) + return file_message_id_data_proto_rawDescData +} + +var file_message_id_data_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_message_id_data_proto_goTypes = []interface{}{ + (*MessageIdData)(nil), // 0: milvus.proto.streaming.wal.pulsar.MessageIdData +} +var file_message_id_data_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_message_id_data_proto_init() } +func file_message_id_data_proto_init() { + if File_message_id_data_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_id_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageIdData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_id_data_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_id_data_proto_goTypes, + DependencyIndexes: file_message_id_data_proto_depIdxs, + MessageInfos: file_message_id_data_proto_msgTypes, + }.Build() + File_message_id_data_proto = out.File + file_message_id_data_proto_rawDesc = nil + file_message_id_data_proto_goTypes = nil + file_message_id_data_proto_depIdxs = nil +} diff --git a/pkg/streaming/walimpls/impls/pulsar/message_id_data.proto b/pkg/streaming/walimpls/impls/pulsar/message_id_data.proto new file mode 100644 index 0000000000000..44c45c5410fff --- /dev/null +++ b/pkg/streaming/walimpls/impls/pulsar/message_id_data.proto @@ -0,0 +1,13 @@ +syntax = "proto2"; + +package milvus.proto.streaming.wal.pulsar; + +option go_package = "github.com/milvus-io/milvus/pkg/streaming/walimpls/impls/pulsar"; + + +message MessageIdData { + required uint64 ledgerId = 1; + required uint64 entryId = 2; + optional int32 partition = 3; + optional int32 batch_index = 4; +} \ No newline at end of file diff --git a/pkg/util/funcutil/placeholdergroup.go b/pkg/util/funcutil/placeholdergroup.go index 538a70fcbefcc..2fa66bdaeac88 100644 --- a/pkg/util/funcutil/placeholdergroup.go +++ b/pkg/util/funcutil/placeholdergroup.go @@ -6,7 +6,7 @@ import ( "math" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/pkg/util/funcutil/policy.go b/pkg/util/funcutil/policy.go index 1506ff9abb8ef..fc0482b35c579 100644 --- a/pkg/util/funcutil/policy.go +++ b/pkg/util/funcutil/policy.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" + "github.com/cockroachdb/errors" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" @@ -15,34 +15,39 @@ import ( "github.com/milvus-io/milvus/pkg/util" ) -func GetVersion(m proto.GeneratedMessage) (string, error) { - md, _ := descriptor.MessageDescriptorProto(m) - if md == nil { - log.Error("MessageDescriptorProto result is nil") - return "", fmt.Errorf("MessageDescriptorProto result is nil") +func GetVersion(m interface{}) (string, error) { + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetVersion failed", zap.Error(err)) + return "", err } - extObj, err := proto.GetExtension(md.Options, milvuspb.E_MilvusExtObj) - if err != nil { + if !proto.HasExtension(pbMsg.ProtoReflect().Descriptor().Options(), milvuspb.E_MilvusExtObj) { + err := errors.New("Extension not found") log.Error("GetExtension fail", zap.Error(err)) return "", err } + extObj := proto.GetExtension(pbMsg.ProtoReflect().Descriptor().Options(), milvuspb.E_MilvusExtObj) version := extObj.(*milvuspb.MilvusExt).Version log.Debug("GetVersion success", zap.String("version", version)) return version, nil } -func GetPrivilegeExtObj(m proto.GeneratedMessage) (commonpb.PrivilegeExt, error) { - _, md := descriptor.MessageDescriptorProto(m) - if md == nil { - log.RatedInfo(60, "MessageDescriptorProto result is nil") - return commonpb.PrivilegeExt{}, fmt.Errorf("MessageDescriptorProto result is nil") +func GetPrivilegeExtObj(m interface{}) (commonpb.PrivilegeExt, error) { + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetPrivilegeExtObj failed", zap.Error(err)) + return commonpb.PrivilegeExt{}, err } - extObj, err := proto.GetExtension(md.Options, commonpb.E_PrivilegeExtObj) - if err != nil { - log.RatedInfo(60, "GetExtension fail", zap.Error(err)) + if !proto.HasExtension(pbMsg.ProtoReflect().Descriptor().Options(), commonpb.E_PrivilegeExtObj) { + err := errors.New("Extension not found") + log.RatedWarn(60, "GetPrivilegeExtObj failed", zap.Error(err)) return commonpb.PrivilegeExt{}, err } + extObj := proto.GetExtension(pbMsg.ProtoReflect().Descriptor().Options(), commonpb.E_PrivilegeExtObj) + privilegeExt := extObj.(*commonpb.PrivilegeExt) log.RatedDebug(60, "GetPrivilegeExtObj success", zap.String("resource_type", privilegeExt.ObjectType.String()), zap.String("resource_privilege", privilegeExt.ObjectPrivilege.String())) return commonpb.PrivilegeExt{ @@ -54,13 +59,20 @@ func GetPrivilegeExtObj(m proto.GeneratedMessage) (commonpb.PrivilegeExt, error) } // GetObjectName get object name from the grpc message according to the field index. The field is a string. -func GetObjectName(m proto.GeneratedMessage, index int32) string { +func GetObjectName(m interface{}, index int32) string { if index <= 0 { return util.AnyWord } - msg := proto.MessageReflect(proto.MessageV1(m)) - msgDesc := msg.Descriptor() - value := msg.Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) + + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetObjectName fail", zap.Error(err)) + return util.AnyWord + } + + msgDesc := pbMsg.ProtoReflect().Descriptor() + value := pbMsg.ProtoReflect().Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) user, ok := value.Interface().(protoreflect.Message) if ok { userDesc := user.Descriptor() @@ -73,13 +85,20 @@ func GetObjectName(m proto.GeneratedMessage, index int32) string { } // GetObjectNames get object names from the grpc message according to the field index. The field is an array. -func GetObjectNames(m proto.GeneratedMessage, index int32) []string { +func GetObjectNames(m interface{}, index int32) []string { if index <= 0 { return []string{} } - msg := proto.MessageReflect(proto.MessageV1(m)) - msgDesc := msg.Descriptor() - value := msg.Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) + + pbMsg, ok := m.(proto.Message) + if !ok { + err := fmt.Errorf("MessageDescriptorProto result is nil") + log.RatedInfo(60, "GetObjectNames fail", zap.Error(err)) + return []string{} + } + + msgDesc := pbMsg.ProtoReflect().Descriptor() + value := pbMsg.ProtoReflect().Get(msgDesc.Fields().ByNumber(protoreflect.FieldNumber(index))) names, ok := value.Interface().(protoreflect.List) if !ok { return []string{} diff --git a/pkg/util/testutils/gen_data.go b/pkg/util/testutils/gen_data.go index 0eb692a2249b0..15b39933858ff 100644 --- a/pkg/util/testutils/gen_data.go +++ b/pkg/util/testutils/gen_data.go @@ -301,6 +301,48 @@ func GenerateFloat16VectorsWithInvalidData(numRows, dim int) []byte { return ret } +func GenerateSparseFloatVectorsData(numRows int) ([][]byte, int64) { + dim := 700 + avgNnz := 20 + var contents [][]byte + maxDim := 0 + + uniqueAndSort := func(indices []uint32) []uint32 { + seen := make(map[uint32]bool) + var result []uint32 + for _, value := range indices { + if _, ok := seen[value]; !ok { + seen[value] = true + result = append(result, value) + } + } + sort.Slice(result, func(i, j int) bool { + return result[i] < result[j] + }) + return result + } + + for i := 0; i < numRows; i++ { + nnz := rand.Intn(avgNnz*2) + 1 + indices := make([]uint32, 0, nnz) + for j := 0; j < nnz; j++ { + indices = append(indices, uint32(rand.Intn(dim))) + } + indices = uniqueAndSort(indices) + values := make([]float32, 0, len(indices)) + for j := 0; j < len(indices); j++ { + values = append(values, rand.Float32()) + } + if len(indices) > 0 && int(indices[len(indices)-1])+1 > maxDim { + maxDim = int(indices[len(indices)-1]) + 1 + } + rowBytes := typeutil.CreateSparseFloatRow(indices, values) + + contents = append(contents, rowBytes) + } + return contents, int64(maxDim) +} + func GenerateSparseFloatVectors(numRows int) *schemapb.SparseFloatArray { dim := 700 avgNnz := 20 diff --git a/pkg/util/typeutil/convension.go b/pkg/util/typeutil/convension.go index 95e138b5c50a8..4d0cbd87e0f5f 100644 --- a/pkg/util/typeutil/convension.go +++ b/pkg/util/typeutil/convension.go @@ -22,9 +22,9 @@ import ( "math" "reflect" - "github.com/golang/protobuf/proto" "github.com/x448/float16" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/log" diff --git a/pkg/util/typeutil/schema.go b/pkg/util/typeutil/schema.go index 6a03474ac692b..5d64c4f7f3c67 100644 --- a/pkg/util/typeutil/schema.go +++ b/pkg/util/typeutil/schema.go @@ -28,9 +28,9 @@ import ( "unsafe" "github.com/cockroachdb/errors" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" diff --git a/pkg/util/typeutil/schema_test.go b/pkg/util/typeutil/schema_test.go index a42e54d867bd1..48dc3c14915bc 100644 --- a/pkg/util/typeutil/schema_test.go +++ b/pkg/util/typeutil/schema_test.go @@ -23,11 +23,11 @@ import ( "reflect" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" @@ -1083,7 +1083,7 @@ func TestDeleteFieldData(t *testing.T) { assert.Equal(t, BFloat16Vector[0:2*Dim], result1[BFloat16VectorFieldID-common.StartOfUserFieldID].GetVectors().Data.(*schemapb.VectorField_Bfloat16Vector).Bfloat16Vector) tmpSparseFloatVector := proto.Clone(SparseFloatVector).(*schemapb.SparseFloatArray) tmpSparseFloatVector.Contents = [][]byte{SparseFloatVector.Contents[0]} - assert.EqualExportedValues(t, *tmpSparseFloatVector, *result1[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector()) + assert.Equal(t, tmpSparseFloatVector.Contents, result1[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector().Contents) AppendFieldData(result2, fieldDataArray2, 0) AppendFieldData(result2, fieldDataArray1, 0) @@ -1100,7 +1100,7 @@ func TestDeleteFieldData(t *testing.T) { assert.Equal(t, BFloat16Vector[2*Dim:4*Dim], result2[BFloat16VectorFieldID-common.StartOfUserFieldID].GetVectors().Data.(*schemapb.VectorField_Bfloat16Vector).Bfloat16Vector) tmpSparseFloatVector = proto.Clone(SparseFloatVector).(*schemapb.SparseFloatArray) tmpSparseFloatVector.Contents = [][]byte{SparseFloatVector.Contents[1]} - assert.EqualExportedValues(t, *tmpSparseFloatVector, *result2[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector()) + assert.EqualExportedValues(t, tmpSparseFloatVector, result2[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector()) } func TestEstimateEntitySize(t *testing.T) { diff --git a/scripts/generate_proto.sh b/scripts/generate_proto.sh index 5b92bef12e5c5..e0b6ed9ce409f 100755 --- a/scripts/generate_proto.sh +++ b/scripts/generate_proto.sh @@ -29,6 +29,8 @@ API_PROTO_DIR=$ROOT_DIR/cmake_build/thirdparty/milvus-proto/proto CPP_SRC_DIR=$ROOT_DIR/internal/core PROTOC_BIN=$ROOT_DIR/cmake_build/bin/protoc +INSTALL_PATH="$1" + PROGRAM=$(basename "$0") GOPATH=$(go env GOPATH) @@ -37,7 +39,10 @@ if [ -z $GOPATH ]; then exit 1 fi -export PATH=${GOPATH}/bin:$PATH +export PATH=${INSTALL_PATH}:${GOPATH}/bin:$PATH + +echo "using protoc-gen-go: $(which protoc-gen-go)" +echo "using protoc-gen-go-grpc: $(which protoc-gen-go-grpc)" # official go code ship with the crate, so we need to generate it manually. pushd ${PROTO_DIR} @@ -62,21 +67,24 @@ mkdir -p $ROOT_DIR/cmd/tools/migration/legacy/legacypb protoc_opt="${PROTOC_BIN} --proto_path=${API_PROTO_DIR} --proto_path=." -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./etcdpb etcd_meta.proto || { echo 'generate etcd_meta.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./indexcgopb index_cgo_msg.proto || { echo 'generate index_cgo_msg failed '; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./cgopb cgo_msg.proto || { echo 'generate cgo_msg failed '; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./rootcoordpb root_coord.proto || { echo 'generate root_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./internalpb internal.proto || { echo 'generate internal.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./proxypb proxy.proto|| { echo 'generate proxy.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./indexpb index_coord.proto|| { echo 'generate index_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./datapb data_coord.proto|| { echo 'generate data_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./querypb query_coord.proto|| { echo 'generate query_coord.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./planpb plan.proto|| { echo 'generate plan.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./segcorepb segcore.proto|| { echo 'generate segcore.proto failed'; exit 1; } -${protoc_opt} --go_out=plugins=grpc,paths=source_relative:./clusteringpb clustering.proto|| { echo 'generate clustering.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./etcdpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./etcdpb etcd_meta.proto || { echo 'generate etcd_meta.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./indexcgopb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./indexcgopb index_cgo_msg.proto || { echo 'generate index_cgo_msg failed '; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./cgopb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./cgopb cgo_msg.proto || { echo 'generate cgo_msg failed '; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./rootcoordpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./rootcoordpb root_coord.proto || { echo 'generate root_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./internalpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./internalpb internal.proto || { echo 'generate internal.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./proxypb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./proxypb proxy.proto|| { echo 'generate proxy.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./indexpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./indexpb index_coord.proto|| { echo 'generate index_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./datapb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./datapb data_coord.proto|| { echo 'generate data_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./querypb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./querypb query_coord.proto|| { echo 'generate query_coord.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./planpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./planpb plan.proto|| { echo 'generate plan.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./segcorepb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./segcorepb segcore.proto|| { echo 'generate segcore.proto failed'; exit 1; } +${protoc_opt} --go_out=paths=source_relative:./clusteringpb --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:./clusteringpb clustering.proto|| { echo 'generate clustering.proto failed'; exit 1; } + +${protoc_opt} --proto_path=$ROOT_DIR/pkg/eventlog/ --go_out=paths=source_relative:../../pkg/eventlog/ --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:../../pkg/eventlog/ event_log.proto || { echo 'generate event_log.proto failed'; exit 1; } +${protoc_opt} --proto_path=$ROOT_DIR/cmd/tools/migration/backend --go_out=paths=source_relative:../../cmd/tools/migration/backend/ --go-grpc_out=require_unimplemented_servers=false,paths=source_relative:../../cmd/tools/migration/backend backup_header.proto || { echo 'generate backup_header.proto failed'; exit 1; } ${protoc_opt} --proto_path=$ROOT_DIR/cmd/tools/migration/legacy/ \ - --go_out=plugins=grpc,paths=source_relative:../../cmd/tools/migration/legacy/legacypb legacy.proto || { echo 'generate legacy.proto failed'; exit 1; } + --go_out=paths=source_relative:../../cmd/tools/migration/legacy/legacypb legacy.proto || { echo 'generate legacy.proto failed'; exit 1; } ${protoc_opt} --cpp_out=$CPP_SRC_DIR/src/pb schema.proto|| { echo 'generate schema.proto failed'; exit 1; } ${protoc_opt} --cpp_out=$CPP_SRC_DIR/src/pb common.proto|| { echo 'generate common.proto failed'; exit 1; } diff --git a/tests/integration/alias/alias_test.go b/tests/integration/alias/alias_test.go index 85dfb1eda656e..a557007f5c9b0 100644 --- a/tests/integration/alias/alias_test.go +++ b/tests/integration/alias/alias_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/balance/balance_test.go b/tests/integration/balance/balance_test.go index b0df436e68431..01fa98af5a62f 100644 --- a/tests/integration/balance/balance_test.go +++ b/tests/integration/balance/balance_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/balance/channel_exclusive_balance_test.go b/tests/integration/balance/channel_exclusive_balance_test.go index 08799745d43b6..fd9e9aeec5176 100644 --- a/tests/integration/balance/channel_exclusive_balance_test.go +++ b/tests/integration/balance/channel_exclusive_balance_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/bloomfilter/bloom_filter_test.go b/tests/integration/bloomfilter/bloom_filter_test.go index 4ee4437afb3a3..c53b97a77a28c 100644 --- a/tests/integration/bloomfilter/bloom_filter_test.go +++ b/tests/integration/bloomfilter/bloom_filter_test.go @@ -23,10 +23,10 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/channel_balance/channel_balance_test.go b/tests/integration/channel_balance/channel_balance_test.go index d69da10db2e7b..edb86ffd03115 100644 --- a/tests/integration/channel_balance/channel_balance_test.go +++ b/tests/integration/channel_balance/channel_balance_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/compaction/clustering_compaction_test.go b/tests/integration/compaction/clustering_compaction_test.go index adae93d5acad0..c8c65eaac768b 100644 --- a/tests/integration/compaction/clustering_compaction_test.go +++ b/tests/integration/compaction/clustering_compaction_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/compaction/l0_compaction_test.go b/tests/integration/compaction/l0_compaction_test.go index 984e8eb3ce5e5..7b70433879b79 100644 --- a/tests/integration/compaction/l0_compaction_test.go +++ b/tests/integration/compaction/l0_compaction_test.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/compaction/l2_single_compaction_test.go b/tests/integration/compaction/l2_single_compaction_test.go index 21cbfe01bf7b4..90c9daf4e1def 100644 --- a/tests/integration/compaction/l2_single_compaction_test.go +++ b/tests/integration/compaction/l2_single_compaction_test.go @@ -23,10 +23,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/compaction/mix_compaction_test.go b/tests/integration/compaction/mix_compaction_test.go index b51636be5fd1e..c043d65247646 100644 --- a/tests/integration/compaction/mix_compaction_test.go +++ b/tests/integration/compaction/mix_compaction_test.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/coorddownsearch/search_after_coord_down_test.go b/tests/integration/coorddownsearch/search_after_coord_down_test.go index a922d15f423b5..0a0df039dc34e 100644 --- a/tests/integration/coorddownsearch/search_after_coord_down_test.go +++ b/tests/integration/coorddownsearch/search_after_coord_down_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/coordrecovery/coord_recovery_test.go b/tests/integration/coordrecovery/coord_recovery_test.go index b111eda94ff5c..2ca2a455fc33f 100644 --- a/tests/integration/coordrecovery/coord_recovery_test.go +++ b/tests/integration/coordrecovery/coord_recovery_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/datanode/compaction_test.go b/tests/integration/datanode/compaction_test.go index 051b189a388b1..8cd7e77c6a8c5 100644 --- a/tests/integration/datanode/compaction_test.go +++ b/tests/integration/datanode/compaction_test.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/datanode/datanode_test.go b/tests/integration/datanode/datanode_test.go index 0fd620ce2fe92..dc04750624026 100644 --- a/tests/integration/datanode/datanode_test.go +++ b/tests/integration/datanode/datanode_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/expression/expression_test.go b/tests/integration/expression/expression_test.go index 859a7a4e876fe..4278f7ddb09c0 100644 --- a/tests/integration/expression/expression_test.go +++ b/tests/integration/expression/expression_test.go @@ -22,9 +22,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/getvector/get_vector_test.go b/tests/integration/getvector/get_vector_test.go index d795567fd7992..7ee16d68aa1e6 100644 --- a/tests/integration/getvector/get_vector_test.go +++ b/tests/integration/getvector/get_vector_test.go @@ -22,8 +22,8 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/hellomilvus/hello_milvus_test.go b/tests/integration/hellomilvus/hello_milvus_test.go index bd6e2b04ab1c4..4361d23955fe4 100644 --- a/tests/integration/hellomilvus/hello_milvus_test.go +++ b/tests/integration/hellomilvus/hello_milvus_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/hybridsearch/hybridsearch_test.go b/tests/integration/hybridsearch/hybridsearch_test.go index 6d4ffbb2d9a3c..a0fa638c5a307 100644 --- a/tests/integration/hybridsearch/hybridsearch_test.go +++ b/tests/integration/hybridsearch/hybridsearch_test.go @@ -7,9 +7,9 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/binlog_test.go b/tests/integration/import/binlog_test.go index d1368e110d83d..29629bacdce6c 100644 --- a/tests/integration/import/binlog_test.go +++ b/tests/integration/import/binlog_test.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/dynamic_field_test.go b/tests/integration/import/dynamic_field_test.go index 2b6baa4137a7f..f714176af0060 100644 --- a/tests/integration/import/dynamic_field_test.go +++ b/tests/integration/import/dynamic_field_test.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/import_test.go b/tests/integration/import/import_test.go index e59eeffeba637..4e8c4f85f3082 100644 --- a/tests/integration/import/import_test.go +++ b/tests/integration/import/import_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/multi_vector_test.go b/tests/integration/import/multi_vector_test.go index aef5014954cf3..7738853a56bd3 100644 --- a/tests/integration/import/multi_vector_test.go +++ b/tests/integration/import/multi_vector_test.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/import/partition_key_test.go b/tests/integration/import/partition_key_test.go index b9cba86c84b50..68424f3c41f3e 100644 --- a/tests/integration/import/partition_key_test.go +++ b/tests/integration/import/partition_key_test.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/indexstat/get_index_statistics_test.go b/tests/integration/indexstat/get_index_statistics_test.go index 95d3b51c3cca4..eb740a70554e8 100644 --- a/tests/integration/indexstat/get_index_statistics_test.go +++ b/tests/integration/indexstat/get_index_statistics_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/insert/insert_test.go b/tests/integration/insert/insert_test.go index 7c9cc4c6d6945..bf08bb9520c77 100644 --- a/tests/integration/insert/insert_test.go +++ b/tests/integration/insert/insert_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/jsonexpr/json_expr_test.go b/tests/integration/jsonexpr/json_expr_test.go index fed41147da403..f194c877afb9f 100644 --- a/tests/integration/jsonexpr/json_expr_test.go +++ b/tests/integration/jsonexpr/json_expr_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/materialized_view/materialized_view_test.go b/tests/integration/materialized_view/materialized_view_test.go index 8322f266dd2c1..cf2c484a2a609 100644 --- a/tests/integration/materialized_view/materialized_view_test.go +++ b/tests/integration/materialized_view/materialized_view_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/meta_watcher.go b/tests/integration/meta_watcher.go index 8434f16e6333c..1fe255d8a041f 100644 --- a/tests/integration/meta_watcher.go +++ b/tests/integration/meta_watcher.go @@ -24,9 +24,9 @@ import ( "sort" "time" - "github.com/golang/protobuf/proto" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/querypb" diff --git a/tests/integration/meta_watcher_test.go b/tests/integration/meta_watcher_test.go index 5206984224243..5a44b817065dc 100644 --- a/tests/integration/meta_watcher_test.go +++ b/tests/integration/meta_watcher_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/partialsearch/partial_search_test.go b/tests/integration/partialsearch/partial_search_test.go index 790802e63037d..2040a3c8bd584 100644 --- a/tests/integration/partialsearch/partial_search_test.go +++ b/tests/integration/partialsearch/partial_search_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/partitionkey/partition_key_test.go b/tests/integration/partitionkey/partition_key_test.go index 010525a818769..f76f1af6db09d 100644 --- a/tests/integration/partitionkey/partition_key_test.go +++ b/tests/integration/partitionkey/partition_key_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/querynode/querynode_test.go b/tests/integration/querynode/querynode_test.go index 420076d9bf085..9e04d94bf8a2c 100644 --- a/tests/integration/querynode/querynode_test.go +++ b/tests/integration/querynode/querynode_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/rangesearch/range_search_test.go b/tests/integration/rangesearch/range_search_test.go index c264ba5bcc1ea..91d4006d24fd6 100644 --- a/tests/integration/rangesearch/range_search_test.go +++ b/tests/integration/rangesearch/range_search_test.go @@ -21,9 +21,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/refreshconfig/refresh_config_test.go b/tests/integration/refreshconfig/refresh_config_test.go index e6b35c471d1db..df22cf7b75933 100644 --- a/tests/integration/refreshconfig/refresh_config_test.go +++ b/tests/integration/refreshconfig/refresh_config_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/rg/resource_group_test.go b/tests/integration/rg/resource_group_test.go index 02bd486f54e14..e21dc48937377 100644 --- a/tests/integration/rg/resource_group_test.go +++ b/tests/integration/rg/resource_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/rgpb" diff --git a/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go b/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go index d071351b076be..44e0265230946 100644 --- a/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go +++ b/tests/integration/rollingupgrade/manual_rolling_upgrade_test.go @@ -22,10 +22,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/sealpolicies/seal_by_total_growing_test.go b/tests/integration/sealpolicies/seal_by_total_growing_test.go index b049f87a861d0..d5f8a92440190 100644 --- a/tests/integration/sealpolicies/seal_by_total_growing_test.go +++ b/tests/integration/sealpolicies/seal_by_total_growing_test.go @@ -20,9 +20,9 @@ import ( "context" "time" - "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/sparse/sparse_test.go b/tests/integration/sparse/sparse_test.go index 482d6c9fd33ae..dbed305eeb6fb 100644 --- a/tests/integration/sparse/sparse_test.go +++ b/tests/integration/sparse/sparse_test.go @@ -22,9 +22,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/target/target_test.go b/tests/integration/target/target_test.go index e6b739d69c615..097a977c00c51 100644 --- a/tests/integration/target/target_test.go +++ b/tests/integration/target/target_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/upsert/upsert_test.go b/tests/integration/upsert/upsert_test.go index 965f5ef07e183..048c4ac3d22a1 100644 --- a/tests/integration/upsert/upsert_test.go +++ b/tests/integration/upsert/upsert_test.go @@ -21,9 +21,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" diff --git a/tests/integration/util_collection.go b/tests/integration/util_collection.go index bd8fdc0db2fc8..a327c2de9c8d2 100644 --- a/tests/integration/util_collection.go +++ b/tests/integration/util_collection.go @@ -5,8 +5,8 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" "go.uber.org/zap" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/util_query.go b/tests/integration/util_query.go index e44c1ab162cab..f43b8a8789fab 100644 --- a/tests/integration/util_query.go +++ b/tests/integration/util_query.go @@ -25,7 +25,7 @@ import ( "strconv" "time" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" diff --git a/tests/integration/watchcompatibility/watch_test.go b/tests/integration/watchcompatibility/watch_test.go index 0a0fc3674ff96..9103634cccd03 100644 --- a/tests/integration/watchcompatibility/watch_test.go +++ b/tests/integration/watchcompatibility/watch_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb"