From 8aab6cbfac4a64286a69deec1e019f6bd9ab8609 Mon Sep 17 00:00:00 2001 From: "yihao.dai" Date: Mon, 22 Jul 2024 11:33:51 +0800 Subject: [PATCH] enhance: Organize the common modules of streamingNode and dataNode (#34773) 1. Move the common modules of streamingNode and dataNode to flushcommon 2. Add new GetVChannels interface for rootcoord issue: https://github.com/milvus-io/milvus/issues/33285 --------- Signed-off-by: bigsheeper --- internal/datacoord/mock_test.go | 4 + internal/datanode/channel/channel_manager.go | 2 +- .../datanode/channel/channel_manager_test.go | 6 +- internal/datanode/compaction/l0_compactor.go | 2 +- .../datanode/compaction/l0_compactor_test.go | 2 +- internal/datanode/compaction/load_stats.go | 4 +- .../datanode/compaction/mix_compactor_test.go | 2 +- .../datanode/compaction/segment_writer.go | 2 +- internal/datanode/data_node.go | 6 +- internal/datanode/data_node_test.go | 6 +- internal/datanode/importv2/scheduler_test.go | 2 +- internal/datanode/importv2/task_import.go | 4 +- internal/datanode/importv2/task_l0_import.go | 4 +- .../datanode/importv2/task_l0_import_test.go | 2 +- internal/datanode/importv2/util.go | 4 +- internal/datanode/services.go | 2 +- internal/datanode/services_test.go | 4 +- internal/datanode/util/testutils.go | 2 +- internal/datanode/util/util.go | 4 +- .../distributed/rootcoord/client/client.go | 12 + .../rootcoord/client/client_test.go | 8 + internal/distributed/rootcoord/service.go | 5 + .../metacache/actions.go | 0 .../metacache/actions_test.go | 0 .../metacache/bloom_filter_set.go | 0 .../metacache/bloom_filter_set_test.go | 0 .../metacache/meta_cache.go | 0 .../metacache/meta_cache_test.go | 0 .../metacache/mock_meta_cache.go | 0 .../metacache/segment.go | 0 .../metacache/segment_test.go | 0 .../metacache/storagev2_cache.go | 0 .../pipeline/data_sync_service.go | 6 +- .../pipeline/data_sync_service_test.go | 6 +- .../pipeline/flow_graph_dd_node.go | 0 .../pipeline/flow_graph_dd_node_test.go | 0 .../flow_graph_dmstream_input_node.go | 0 .../flow_graph_dmstream_input_node_test.go | 0 .../pipeline/flow_graph_manager.go | 0 .../pipeline/flow_graph_manager_test.go | 4 +- .../pipeline/flow_graph_message.go | 0 .../pipeline/flow_graph_message_test.go | 0 .../pipeline/flow_graph_node.go | 0 .../pipeline/flow_graph_time_tick_node.go | 4 +- .../pipeline/flow_graph_write_node.go | 4 +- .../pipeline/mock_fgmanager.go | 0 .../syncmgr/key_lock_dispatcher.go | 0 .../syncmgr/key_lock_dispatcher_test.go | 0 .../syncmgr/meta_writer.go | 2 +- .../syncmgr/meta_writer_test.go | 2 +- .../syncmgr/mock_meta_writer.go | 0 .../syncmgr/mock_serializer.go | 0 .../syncmgr/mock_sync_manager.go | 0 .../syncmgr/mock_task.go | 0 .../syncmgr/options.go | 2 +- .../syncmgr/serializer.go | 2 +- .../syncmgr/storage_serializer.go | 2 +- .../syncmgr/storage_serializer_test.go | 2 +- .../syncmgr/storage_v2_serializer.go | 2 +- .../syncmgr/storage_v2_serializer_test.go | 2 +- .../syncmgr/sync_manager.go | 2 +- .../syncmgr/sync_manager_test.go | 2 +- .../{datanode => flushcommon}/syncmgr/task.go | 2 +- .../syncmgr/task_test.go | 2 +- .../syncmgr/taskv2.go | 2 +- .../syncmgr/taskv2_test.go | 2 +- .../writebuffer/bf_write_buffer.go | 4 +- .../writebuffer/bf_write_buffer_test.go | 4 +- .../writebuffer/delta_buffer.go | 0 .../writebuffer/delta_buffer_test.go | 0 .../writebuffer/insert_buffer.go | 0 .../writebuffer/insert_buffer_test.go | 0 .../writebuffer/l0_write_buffer.go | 4 +- .../writebuffer/l0_write_buffer_test.go | 4 +- .../writebuffer/manager.go | 6 +- .../writebuffer/manager_test.go | 4 +- .../writebuffer/mock_manager.go} | 48 +-- .../writebuffer/mock_write_buffer.go | 0 .../writebuffer/options.go | 4 +- .../writebuffer/segment_buffer.go | 0 .../writebuffer/sync_policy.go | 2 +- .../writebuffer/sync_policy_test.go | 2 +- .../writebuffer/write_buffer.go | 4 +- .../writebuffer/write_buffer_test.go | 4 +- internal/mocks/mock_rootcoord.go | 257 ++++++++----- internal/mocks/mock_rootcoord_client.go | 352 +++++++++++------- internal/proto/root_coord.proto | 20 +- internal/proxy/rootcoord_mock_test.go | 4 + internal/rootcoord/meta_table.go | 17 +- internal/rootcoord/mock_test.go | 5 + internal/rootcoord/mocks/meta_table.go | 280 ++++++++------ internal/rootcoord/root_coord.go | 16 + .../streamingnode/server/resource/resource.go | 13 + .../server/walmanager/wal_lifetime.go | 2 + internal/util/mock/grpc_rootcoord_client.go | 4 + 95 files changed, 731 insertions(+), 470 deletions(-) rename internal/{datanode => flushcommon}/metacache/actions.go (100%) rename internal/{datanode => flushcommon}/metacache/actions_test.go (100%) rename internal/{datanode => flushcommon}/metacache/bloom_filter_set.go (100%) rename internal/{datanode => flushcommon}/metacache/bloom_filter_set_test.go (100%) rename internal/{datanode => flushcommon}/metacache/meta_cache.go (100%) rename internal/{datanode => flushcommon}/metacache/meta_cache_test.go (100%) rename internal/{datanode => flushcommon}/metacache/mock_meta_cache.go (100%) rename internal/{datanode => flushcommon}/metacache/segment.go (100%) rename internal/{datanode => flushcommon}/metacache/segment_test.go (100%) rename internal/{datanode => flushcommon}/metacache/storagev2_cache.go (100%) rename internal/{datanode => flushcommon}/pipeline/data_sync_service.go (98%) rename internal/{datanode => flushcommon}/pipeline/data_sync_service_test.go (98%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_dd_node.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_dd_node_test.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_dmstream_input_node.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_dmstream_input_node_test.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_manager.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_manager_test.go (97%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_message.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_message_test.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_node.go (100%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_time_tick_node.go (97%) rename internal/{datanode => flushcommon}/pipeline/flow_graph_write_node.go (96%) rename internal/{datanode => flushcommon}/pipeline/mock_fgmanager.go (100%) rename internal/{datanode => flushcommon}/syncmgr/key_lock_dispatcher.go (100%) rename internal/{datanode => flushcommon}/syncmgr/key_lock_dispatcher_test.go (100%) rename internal/{datanode => flushcommon}/syncmgr/meta_writer.go (99%) rename internal/{datanode => flushcommon}/syncmgr/meta_writer_test.go (98%) rename internal/{datanode => flushcommon}/syncmgr/mock_meta_writer.go (100%) rename internal/{datanode => flushcommon}/syncmgr/mock_serializer.go (100%) rename internal/{datanode => flushcommon}/syncmgr/mock_sync_manager.go (100%) rename internal/{datanode => flushcommon}/syncmgr/mock_task.go (100%) rename internal/{datanode => flushcommon}/syncmgr/options.go (97%) rename internal/{datanode => flushcommon}/syncmgr/serializer.go (98%) rename internal/{datanode => flushcommon}/syncmgr/storage_serializer.go (99%) rename internal/{datanode => flushcommon}/syncmgr/storage_serializer_test.go (99%) rename internal/{datanode => flushcommon}/syncmgr/storage_v2_serializer.go (99%) rename internal/{datanode => flushcommon}/syncmgr/storage_v2_serializer_test.go (99%) rename internal/{datanode => flushcommon}/syncmgr/sync_manager.go (98%) rename internal/{datanode => flushcommon}/syncmgr/sync_manager_test.go (99%) rename internal/{datanode => flushcommon}/syncmgr/task.go (99%) rename internal/{datanode => flushcommon}/syncmgr/task_test.go (99%) rename internal/{datanode => flushcommon}/syncmgr/taskv2.go (98%) rename internal/{datanode => flushcommon}/syncmgr/taskv2_test.go (99%) rename internal/{datanode => flushcommon}/writebuffer/bf_write_buffer.go (97%) rename internal/{datanode => flushcommon}/writebuffer/bf_write_buffer_test.go (99%) rename internal/{datanode => flushcommon}/writebuffer/delta_buffer.go (100%) rename internal/{datanode => flushcommon}/writebuffer/delta_buffer_test.go (100%) rename internal/{datanode => flushcommon}/writebuffer/insert_buffer.go (100%) rename internal/{datanode => flushcommon}/writebuffer/insert_buffer_test.go (100%) rename internal/{datanode => flushcommon}/writebuffer/l0_write_buffer.go (98%) rename internal/{datanode => flushcommon}/writebuffer/l0_write_buffer_test.go (98%) rename internal/{datanode => flushcommon}/writebuffer/manager.go (96%) rename internal/{datanode => flushcommon}/writebuffer/manager_test.go (98%) rename internal/{datanode/writebuffer/mock_mananger.go => flushcommon/writebuffer/mock_manager.go} (95%) rename internal/{datanode => flushcommon}/writebuffer/mock_write_buffer.go (100%) rename internal/{datanode => flushcommon}/writebuffer/options.go (94%) rename internal/{datanode => flushcommon}/writebuffer/segment_buffer.go (100%) rename internal/{datanode => flushcommon}/writebuffer/sync_policy.go (98%) rename internal/{datanode => flushcommon}/writebuffer/sync_policy_test.go (98%) rename internal/{datanode => flushcommon}/writebuffer/write_buffer.go (99%) rename internal/{datanode => flushcommon}/writebuffer/write_buffer_test.go (98%) diff --git a/internal/datacoord/mock_test.go b/internal/datacoord/mock_test.go index 14ff9921ee..a7a052fc01 100644 --- a/internal/datacoord/mock_test.go +++ b/internal/datacoord/mock_test.go @@ -539,6 +539,10 @@ func (m *mockRootCoordClient) ShowSegments(ctx context.Context, req *milvuspb.Sh panic("not implemented") // TODO: Implement } +func (m *mockRootCoordClient) GetVChannels(ctx context.Context, req *rootcoordpb.GetVChannelsRequest, opts ...grpc.CallOption) (*rootcoordpb.GetVChannelsResponse, error) { + panic("not implemented") // TODO: Implement +} + func (m *mockRootCoordClient) DescribeSegments(ctx context.Context, req *rootcoordpb.DescribeSegmentsRequest, opts ...grpc.CallOption) (*rootcoordpb.DescribeSegmentsResponse, error) { panic("implement me") } diff --git a/internal/datanode/channel/channel_manager.go b/internal/datanode/channel/channel_manager.go index b9da89119b..412a0eccf5 100644 --- a/internal/datanode/channel/channel_manager.go +++ b/internal/datanode/channel/channel_manager.go @@ -24,8 +24,8 @@ import ( "github.com/cockroachdb/errors" "go.uber.org/zap" - "github.com/milvus-io/milvus/internal/datanode/pipeline" "github.com/milvus-io/milvus/internal/datanode/util" + "github.com/milvus-io/milvus/internal/flushcommon/pipeline" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/util/lifetime" diff --git a/internal/datanode/channel/channel_manager_test.go b/internal/datanode/channel/channel_manager_test.go index 030f668796..a79fec7e12 100644 --- a/internal/datanode/channel/channel_manager_test.go +++ b/internal/datanode/channel/channel_manager_test.go @@ -27,10 +27,10 @@ import ( "github.com/milvus-io/milvus/internal/datanode/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/pipeline" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/pipeline" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/util/dependency" "github.com/milvus-io/milvus/internal/util/sessionutil" diff --git a/internal/datanode/compaction/l0_compactor.go b/internal/datanode/compaction/l0_compactor.go index e42239f050..f5ae0e5ce7 100644 --- a/internal/datanode/compaction/l0_compactor.go +++ b/internal/datanode/compaction/l0_compactor.go @@ -29,7 +29,7 @@ import ( "github.com/milvus-io/milvus/internal/allocator" "github.com/milvus-io/milvus/internal/datanode/io" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/metastore/kv/binlog" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/compaction/l0_compactor_test.go b/internal/datanode/compaction/l0_compactor_test.go index 28b5d4e55a..961cc6639e 100644 --- a/internal/datanode/compaction/l0_compactor_test.go +++ b/internal/datanode/compaction/l0_compactor_test.go @@ -29,7 +29,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datanode/allocator" "github.com/milvus-io/milvus/internal/datanode/io" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/compaction/load_stats.go b/internal/datanode/compaction/load_stats.go index 60ef9d47cc..a762a60135 100644 --- a/internal/datanode/compaction/load_stats.go +++ b/internal/datanode/compaction/load_stats.go @@ -24,8 +24,8 @@ import ( "go.uber.org/zap" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/datanode/compaction/mix_compactor_test.go b/internal/datanode/compaction/mix_compactor_test.go index 1368618d8a..f552d7b738 100644 --- a/internal/datanode/compaction/mix_compactor_test.go +++ b/internal/datanode/compaction/mix_compactor_test.go @@ -31,7 +31,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" "github.com/milvus-io/milvus/internal/datanode/io" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/etcdpb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/compaction/segment_writer.go b/internal/datanode/compaction/segment_writer.go index c4fb51c8c8..ec604470a2 100644 --- a/internal/datanode/compaction/segment_writer.go +++ b/internal/datanode/compaction/segment_writer.go @@ -11,7 +11,7 @@ import ( "go.uber.org/atomic" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/proto/etcdpb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/datanode/data_node.go b/internal/datanode/data_node.go index 474e1e2279..c6b634470d 100644 --- a/internal/datanode/data_node.go +++ b/internal/datanode/data_node.go @@ -39,10 +39,10 @@ import ( "github.com/milvus-io/milvus/internal/datanode/channel" "github.com/milvus-io/milvus/internal/datanode/compaction" "github.com/milvus-io/milvus/internal/datanode/importv2" - "github.com/milvus-io/milvus/internal/datanode/pipeline" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/pipeline" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/internal/types" diff --git a/internal/datanode/data_node_test.go b/internal/datanode/data_node_test.go index 8a090f9827..9cc78c2309 100644 --- a/internal/datanode/data_node_test.go +++ b/internal/datanode/data_node_test.go @@ -32,10 +32,10 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/pipeline" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/pipeline" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/internal/types" diff --git a/internal/datanode/importv2/scheduler_test.go b/internal/datanode/importv2/scheduler_test.go index 98c28d89c9..2b2b0bd712 100644 --- a/internal/datanode/importv2/scheduler_test.go +++ b/internal/datanode/importv2/scheduler_test.go @@ -32,7 +32,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/datanode/importv2/task_import.go b/internal/datanode/importv2/task_import.go index c7190bf78e..380c3246d8 100644 --- a/internal/datanode/importv2/task_import.go +++ b/internal/datanode/importv2/task_import.go @@ -28,8 +28,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/importv2/task_l0_import.go b/internal/datanode/importv2/task_l0_import.go index 9bad9bfa6f..08ba9b5c47 100644 --- a/internal/datanode/importv2/task_l0_import.go +++ b/internal/datanode/importv2/task_l0_import.go @@ -29,8 +29,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/internal/util/importutilv2/binlog" diff --git a/internal/datanode/importv2/task_l0_import_test.go b/internal/datanode/importv2/task_l0_import_test.go index 8a2c991fa5..01f8ac44e9 100644 --- a/internal/datanode/importv2/task_l0_import_test.go +++ b/internal/datanode/importv2/task_l0_import_test.go @@ -27,7 +27,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/datanode/importv2/util.go b/internal/datanode/importv2/util.go index 01392d4adf..c2679e3037 100644 --- a/internal/datanode/importv2/util.go +++ b/internal/datanode/importv2/util.go @@ -29,8 +29,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/querycoordv2/params" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/services.go b/internal/datanode/services.go index a160c849aa..add9b9793e 100644 --- a/internal/datanode/services.go +++ b/internal/datanode/services.go @@ -31,7 +31,7 @@ import ( "github.com/milvus-io/milvus/internal/datanode/compaction" "github.com/milvus-io/milvus/internal/datanode/importv2" "github.com/milvus-io/milvus/internal/datanode/io" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/metastore/kv/binlog" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/internalpb" diff --git a/internal/datanode/services_test.go b/internal/datanode/services_test.go index 881d915a8c..3fd1490e25 100644 --- a/internal/datanode/services_test.go +++ b/internal/datanode/services_test.go @@ -35,9 +35,9 @@ import ( "github.com/milvus-io/milvus/internal/datanode/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" "github.com/milvus-io/milvus/internal/datanode/compaction" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/pipeline" "github.com/milvus-io/milvus/internal/datanode/util" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/pipeline" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/util/testutils.go b/internal/datanode/util/testutils.go index bdb97c3571..8cff202a12 100644 --- a/internal/datanode/util/testutils.go +++ b/internal/datanode/util/testutils.go @@ -31,7 +31,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/etcdpb" "github.com/milvus-io/milvus/internal/proto/rootcoordpb" diff --git a/internal/datanode/util/util.go b/internal/datanode/util/util.go index e4925e537f..31f960a5a9 100644 --- a/internal/datanode/util/util.go +++ b/internal/datanode/util/util.go @@ -25,8 +25,8 @@ import ( "github.com/milvus-io/milvus/internal/datanode/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" "github.com/milvus-io/milvus/internal/datanode/compaction" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/internal/util/dependency" "github.com/milvus-io/milvus/internal/util/sessionutil" diff --git a/internal/distributed/rootcoord/client/client.go b/internal/distributed/rootcoord/client/client.go index 1379df5ce5..811d2e4dbf 100644 --- a/internal/distributed/rootcoord/client/client.go +++ b/internal/distributed/rootcoord/client/client.go @@ -346,6 +346,18 @@ func (c *Client) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentsRequ }) } +// GetVChannels returns all vchannels belonging to the pchannel. +func (c *Client) GetVChannels(ctx context.Context, in *rootcoordpb.GetVChannelsRequest, opts ...grpc.CallOption) (*rootcoordpb.GetVChannelsResponse, error) { + in = typeutil.Clone(in) + commonpbutil.UpdateMsgBase( + in.GetBase(), + commonpbutil.FillMsgBaseFromClient(paramtable.GetNodeID(), commonpbutil.WithTargetID(c.grpcClient.GetNodeID())), + ) + return wrapGrpcCall(ctx, c, func(client rootcoordpb.RootCoordClient) (*rootcoordpb.GetVChannelsResponse, error) { + return client.GetVChannels(ctx, in) + }) +} + // InvalidateCollectionMetaCache notifies RootCoord to release the collection cache in Proxies. func (c *Client) InvalidateCollectionMetaCache(ctx context.Context, in *proxypb.InvalidateCollMetaCacheRequest, opts ...grpc.CallOption) (*commonpb.Status, error) { in = typeutil.Clone(in) diff --git a/internal/distributed/rootcoord/client/client_test.go b/internal/distributed/rootcoord/client/client_test.go index 07c092e687..2302099645 100644 --- a/internal/distributed/rootcoord/client/client_test.go +++ b/internal/distributed/rootcoord/client/client_test.go @@ -136,6 +136,10 @@ func Test_NewClient(t *testing.T) { r, err := client.ShowSegments(ctx, nil) retCheck(retNotNil, r, err) } + { + r, err := client.GetVChannels(ctx, nil) + retCheck(retNotNil, r, err) + } { r, err := client.GetMetrics(ctx, nil) retCheck(retNotNil, r, err) @@ -350,6 +354,10 @@ func Test_NewClient(t *testing.T) { rTimeout, err := client.ShowSegments(shortCtx, nil) retCheck(rTimeout, err) } + { + rTimeout, err := client.GetVChannels(shortCtx, nil) + retCheck(rTimeout, err) + } { rTimeout, err := client.GetMetrics(shortCtx, nil) retCheck(rTimeout, err) diff --git a/internal/distributed/rootcoord/service.go b/internal/distributed/rootcoord/service.go index 42b326fab5..8521cbb3af 100644 --- a/internal/distributed/rootcoord/service.go +++ b/internal/distributed/rootcoord/service.go @@ -454,6 +454,11 @@ func (s *Server) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentsRequ return s.rootCoord.ShowSegments(ctx, in) } +// GetVChannels returns all vchannels belonging to the pchannel. +func (s *Server) GetVChannels(ctx context.Context, in *rootcoordpb.GetVChannelsRequest) (*rootcoordpb.GetVChannelsResponse, error) { + return s.rootCoord.GetVChannels(ctx, in) +} + // InvalidateCollectionMetaCache notifies RootCoord to release the collection cache in Proxies. func (s *Server) InvalidateCollectionMetaCache(ctx context.Context, in *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error) { return s.rootCoord.InvalidateCollectionMetaCache(ctx, in) diff --git a/internal/datanode/metacache/actions.go b/internal/flushcommon/metacache/actions.go similarity index 100% rename from internal/datanode/metacache/actions.go rename to internal/flushcommon/metacache/actions.go diff --git a/internal/datanode/metacache/actions_test.go b/internal/flushcommon/metacache/actions_test.go similarity index 100% rename from internal/datanode/metacache/actions_test.go rename to internal/flushcommon/metacache/actions_test.go diff --git a/internal/datanode/metacache/bloom_filter_set.go b/internal/flushcommon/metacache/bloom_filter_set.go similarity index 100% rename from internal/datanode/metacache/bloom_filter_set.go rename to internal/flushcommon/metacache/bloom_filter_set.go diff --git a/internal/datanode/metacache/bloom_filter_set_test.go b/internal/flushcommon/metacache/bloom_filter_set_test.go similarity index 100% rename from internal/datanode/metacache/bloom_filter_set_test.go rename to internal/flushcommon/metacache/bloom_filter_set_test.go diff --git a/internal/datanode/metacache/meta_cache.go b/internal/flushcommon/metacache/meta_cache.go similarity index 100% rename from internal/datanode/metacache/meta_cache.go rename to internal/flushcommon/metacache/meta_cache.go diff --git a/internal/datanode/metacache/meta_cache_test.go b/internal/flushcommon/metacache/meta_cache_test.go similarity index 100% rename from internal/datanode/metacache/meta_cache_test.go rename to internal/flushcommon/metacache/meta_cache_test.go diff --git a/internal/datanode/metacache/mock_meta_cache.go b/internal/flushcommon/metacache/mock_meta_cache.go similarity index 100% rename from internal/datanode/metacache/mock_meta_cache.go rename to internal/flushcommon/metacache/mock_meta_cache.go diff --git a/internal/datanode/metacache/segment.go b/internal/flushcommon/metacache/segment.go similarity index 100% rename from internal/datanode/metacache/segment.go rename to internal/flushcommon/metacache/segment.go diff --git a/internal/datanode/metacache/segment_test.go b/internal/flushcommon/metacache/segment_test.go similarity index 100% rename from internal/datanode/metacache/segment_test.go rename to internal/flushcommon/metacache/segment_test.go diff --git a/internal/datanode/metacache/storagev2_cache.go b/internal/flushcommon/metacache/storagev2_cache.go similarity index 100% rename from internal/datanode/metacache/storagev2_cache.go rename to internal/flushcommon/metacache/storagev2_cache.go diff --git a/internal/datanode/pipeline/data_sync_service.go b/internal/flushcommon/pipeline/data_sync_service.go similarity index 98% rename from internal/datanode/pipeline/data_sync_service.go rename to internal/flushcommon/pipeline/data_sync_service.go index 8098ddcc5e..0e12ad64ce 100644 --- a/internal/datanode/pipeline/data_sync_service.go +++ b/internal/flushcommon/pipeline/data_sync_service.go @@ -25,10 +25,10 @@ import ( "github.com/milvus-io/milvus/internal/datanode/broker" "github.com/milvus-io/milvus/internal/datanode/compaction" "github.com/milvus-io/milvus/internal/datanode/io" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/querycoordv2/params" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/pipeline/data_sync_service_test.go b/internal/flushcommon/pipeline/data_sync_service_test.go similarity index 98% rename from internal/datanode/pipeline/data_sync_service_test.go rename to internal/flushcommon/pipeline/data_sync_service_test.go index 0cbcb36b63..7cd66e6e95 100644 --- a/internal/datanode/pipeline/data_sync_service_test.go +++ b/internal/flushcommon/pipeline/data_sync_service_test.go @@ -33,10 +33,10 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datanode/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/pipeline/flow_graph_dd_node.go b/internal/flushcommon/pipeline/flow_graph_dd_node.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_dd_node.go rename to internal/flushcommon/pipeline/flow_graph_dd_node.go diff --git a/internal/datanode/pipeline/flow_graph_dd_node_test.go b/internal/flushcommon/pipeline/flow_graph_dd_node_test.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_dd_node_test.go rename to internal/flushcommon/pipeline/flow_graph_dd_node_test.go diff --git a/internal/datanode/pipeline/flow_graph_dmstream_input_node.go b/internal/flushcommon/pipeline/flow_graph_dmstream_input_node.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_dmstream_input_node.go rename to internal/flushcommon/pipeline/flow_graph_dmstream_input_node.go diff --git a/internal/datanode/pipeline/flow_graph_dmstream_input_node_test.go b/internal/flushcommon/pipeline/flow_graph_dmstream_input_node_test.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_dmstream_input_node_test.go rename to internal/flushcommon/pipeline/flow_graph_dmstream_input_node_test.go diff --git a/internal/datanode/pipeline/flow_graph_manager.go b/internal/flushcommon/pipeline/flow_graph_manager.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_manager.go rename to internal/flushcommon/pipeline/flow_graph_manager.go diff --git a/internal/datanode/pipeline/flow_graph_manager_test.go b/internal/flushcommon/pipeline/flow_graph_manager_test.go similarity index 97% rename from internal/datanode/pipeline/flow_graph_manager_test.go rename to internal/flushcommon/pipeline/flow_graph_manager_test.go index 5d4b67c126..457f09ebb5 100644 --- a/internal/datanode/pipeline/flow_graph_manager_test.go +++ b/internal/flushcommon/pipeline/flow_graph_manager_test.go @@ -30,9 +30,9 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datanode/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/util/sessionutil" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/datanode/pipeline/flow_graph_message.go b/internal/flushcommon/pipeline/flow_graph_message.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_message.go rename to internal/flushcommon/pipeline/flow_graph_message.go diff --git a/internal/datanode/pipeline/flow_graph_message_test.go b/internal/flushcommon/pipeline/flow_graph_message_test.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_message_test.go rename to internal/flushcommon/pipeline/flow_graph_message_test.go diff --git a/internal/datanode/pipeline/flow_graph_node.go b/internal/flushcommon/pipeline/flow_graph_node.go similarity index 100% rename from internal/datanode/pipeline/flow_graph_node.go rename to internal/flushcommon/pipeline/flow_graph_node.go diff --git a/internal/datanode/pipeline/flow_graph_time_tick_node.go b/internal/flushcommon/pipeline/flow_graph_time_tick_node.go similarity index 97% rename from internal/datanode/pipeline/flow_graph_time_tick_node.go rename to internal/flushcommon/pipeline/flow_graph_time_tick_node.go index 1e6fddd9bf..e1ac9ae708 100644 --- a/internal/datanode/pipeline/flow_graph_time_tick_node.go +++ b/internal/flushcommon/pipeline/flow_graph_time_tick_node.go @@ -25,9 +25,9 @@ import ( "go.uber.org/zap" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" - "github.com/milvus-io/milvus/internal/datanode/metacache" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/internal/util/flowgraph" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/util/paramtable" diff --git a/internal/datanode/pipeline/flow_graph_write_node.go b/internal/flushcommon/pipeline/flow_graph_write_node.go similarity index 96% rename from internal/datanode/pipeline/flow_graph_write_node.go rename to internal/flushcommon/pipeline/flow_graph_write_node.go index 3626df2b90..910a3ad341 100644 --- a/internal/datanode/pipeline/flow_graph_write_node.go +++ b/internal/flushcommon/pipeline/flow_graph_write_node.go @@ -11,9 +11,9 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" - "github.com/milvus-io/milvus/internal/datanode/metacache" "github.com/milvus-io/milvus/internal/datanode/util" - "github.com/milvus-io/milvus/internal/datanode/writebuffer" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/writebuffer" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/mq/msgstream" "github.com/milvus-io/milvus/pkg/util/paramtable" diff --git a/internal/datanode/pipeline/mock_fgmanager.go b/internal/flushcommon/pipeline/mock_fgmanager.go similarity index 100% rename from internal/datanode/pipeline/mock_fgmanager.go rename to internal/flushcommon/pipeline/mock_fgmanager.go diff --git a/internal/datanode/syncmgr/key_lock_dispatcher.go b/internal/flushcommon/syncmgr/key_lock_dispatcher.go similarity index 100% rename from internal/datanode/syncmgr/key_lock_dispatcher.go rename to internal/flushcommon/syncmgr/key_lock_dispatcher.go diff --git a/internal/datanode/syncmgr/key_lock_dispatcher_test.go b/internal/flushcommon/syncmgr/key_lock_dispatcher_test.go similarity index 100% rename from internal/datanode/syncmgr/key_lock_dispatcher_test.go rename to internal/flushcommon/syncmgr/key_lock_dispatcher_test.go diff --git a/internal/datanode/syncmgr/meta_writer.go b/internal/flushcommon/syncmgr/meta_writer.go similarity index 99% rename from internal/datanode/syncmgr/meta_writer.go rename to internal/flushcommon/syncmgr/meta_writer.go index f0f826bb1f..97933988dd 100644 --- a/internal/datanode/syncmgr/meta_writer.go +++ b/internal/flushcommon/syncmgr/meta_writer.go @@ -9,7 +9,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/util/commonpbutil" diff --git a/internal/datanode/syncmgr/meta_writer_test.go b/internal/flushcommon/syncmgr/meta_writer_test.go similarity index 98% rename from internal/datanode/syncmgr/meta_writer_test.go rename to internal/flushcommon/syncmgr/meta_writer_test.go index 07b88f1541..6266d13cee 100644 --- a/internal/datanode/syncmgr/meta_writer_test.go +++ b/internal/flushcommon/syncmgr/meta_writer_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/util/paramtable" "github.com/milvus-io/milvus/pkg/util/retry" diff --git a/internal/datanode/syncmgr/mock_meta_writer.go b/internal/flushcommon/syncmgr/mock_meta_writer.go similarity index 100% rename from internal/datanode/syncmgr/mock_meta_writer.go rename to internal/flushcommon/syncmgr/mock_meta_writer.go diff --git a/internal/datanode/syncmgr/mock_serializer.go b/internal/flushcommon/syncmgr/mock_serializer.go similarity index 100% rename from internal/datanode/syncmgr/mock_serializer.go rename to internal/flushcommon/syncmgr/mock_serializer.go diff --git a/internal/datanode/syncmgr/mock_sync_manager.go b/internal/flushcommon/syncmgr/mock_sync_manager.go similarity index 100% rename from internal/datanode/syncmgr/mock_sync_manager.go rename to internal/flushcommon/syncmgr/mock_sync_manager.go diff --git a/internal/datanode/syncmgr/mock_task.go b/internal/flushcommon/syncmgr/mock_task.go similarity index 100% rename from internal/datanode/syncmgr/mock_task.go rename to internal/flushcommon/syncmgr/mock_task.go diff --git a/internal/datanode/syncmgr/options.go b/internal/flushcommon/syncmgr/options.go similarity index 97% rename from internal/datanode/syncmgr/options.go rename to internal/flushcommon/syncmgr/options.go index 39da2da647..efed7fbbab 100644 --- a/internal/datanode/syncmgr/options.go +++ b/internal/flushcommon/syncmgr/options.go @@ -6,7 +6,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/util/retry" diff --git a/internal/datanode/syncmgr/serializer.go b/internal/flushcommon/syncmgr/serializer.go similarity index 98% rename from internal/datanode/syncmgr/serializer.go rename to internal/flushcommon/syncmgr/serializer.go index cd7be9d062..35e759fff1 100644 --- a/internal/datanode/syncmgr/serializer.go +++ b/internal/flushcommon/syncmgr/serializer.go @@ -22,7 +22,7 @@ import ( "github.com/samber/lo" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/util/typeutil" diff --git a/internal/datanode/syncmgr/storage_serializer.go b/internal/flushcommon/syncmgr/storage_serializer.go similarity index 99% rename from internal/datanode/syncmgr/storage_serializer.go rename to internal/flushcommon/syncmgr/storage_serializer.go index 475d4f3446..34c587523d 100644 --- a/internal/datanode/syncmgr/storage_serializer.go +++ b/internal/flushcommon/syncmgr/storage_serializer.go @@ -26,7 +26,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/etcdpb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/syncmgr/storage_serializer_test.go b/internal/flushcommon/syncmgr/storage_serializer_test.go similarity index 99% rename from internal/datanode/syncmgr/storage_serializer_test.go rename to internal/flushcommon/syncmgr/storage_serializer_test.go index 4d91beacec..534e91e054 100644 --- a/internal/datanode/syncmgr/storage_serializer_test.go +++ b/internal/flushcommon/syncmgr/storage_serializer_test.go @@ -31,7 +31,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/datanode/syncmgr/storage_v2_serializer.go b/internal/flushcommon/syncmgr/storage_v2_serializer.go similarity index 99% rename from internal/datanode/syncmgr/storage_v2_serializer.go rename to internal/flushcommon/syncmgr/storage_v2_serializer.go index 217ffe7f56..8147daad94 100644 --- a/internal/datanode/syncmgr/storage_v2_serializer.go +++ b/internal/flushcommon/syncmgr/storage_v2_serializer.go @@ -30,7 +30,7 @@ import ( "github.com/milvus-io/milvus-storage/go/storage/options" "github.com/milvus-io/milvus-storage/go/storage/schema" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/querycoordv2/params" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/syncmgr/storage_v2_serializer_test.go b/internal/flushcommon/syncmgr/storage_v2_serializer_test.go similarity index 99% rename from internal/datanode/syncmgr/storage_v2_serializer_test.go rename to internal/flushcommon/syncmgr/storage_v2_serializer_test.go index a6bef17fa1..27ccedb9ee 100644 --- a/internal/datanode/syncmgr/storage_v2_serializer_test.go +++ b/internal/flushcommon/syncmgr/storage_v2_serializer_test.go @@ -34,7 +34,7 @@ import ( "github.com/milvus-io/milvus-storage/go/storage/options" "github.com/milvus-io/milvus-storage/go/storage/schema" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/datanode/syncmgr/sync_manager.go b/internal/flushcommon/syncmgr/sync_manager.go similarity index 98% rename from internal/datanode/syncmgr/sync_manager.go rename to internal/flushcommon/syncmgr/sync_manager.go index 6baf573167..bbf56d46f1 100644 --- a/internal/datanode/syncmgr/sync_manager.go +++ b/internal/flushcommon/syncmgr/sync_manager.go @@ -10,7 +10,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/config" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/datanode/syncmgr/sync_manager_test.go b/internal/flushcommon/syncmgr/sync_manager_test.go similarity index 99% rename from internal/datanode/syncmgr/sync_manager_test.go rename to internal/flushcommon/syncmgr/sync_manager_test.go index adee14a7c2..083a29ec20 100644 --- a/internal/datanode/syncmgr/sync_manager_test.go +++ b/internal/flushcommon/syncmgr/sync_manager_test.go @@ -18,7 +18,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/syncmgr/task.go b/internal/flushcommon/syncmgr/task.go similarity index 99% rename from internal/datanode/syncmgr/task.go rename to internal/flushcommon/syncmgr/task.go index b6c07a781b..ed63b3586c 100644 --- a/internal/datanode/syncmgr/task.go +++ b/internal/flushcommon/syncmgr/task.go @@ -28,7 +28,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/datanode/syncmgr/task_test.go b/internal/flushcommon/syncmgr/task_test.go similarity index 99% rename from internal/datanode/syncmgr/task_test.go rename to internal/flushcommon/syncmgr/task_test.go index 3720415f00..ffb87252b9 100644 --- a/internal/datanode/syncmgr/task_test.go +++ b/internal/flushcommon/syncmgr/task_test.go @@ -33,7 +33,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/syncmgr/taskv2.go b/internal/flushcommon/syncmgr/taskv2.go similarity index 98% rename from internal/datanode/syncmgr/taskv2.go rename to internal/flushcommon/syncmgr/taskv2.go index c73bc71bab..820ded3a0c 100644 --- a/internal/datanode/syncmgr/taskv2.go +++ b/internal/flushcommon/syncmgr/taskv2.go @@ -29,7 +29,7 @@ import ( milvus_storage "github.com/milvus-io/milvus-storage/go/storage" "github.com/milvus-io/milvus-storage/go/storage/options" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/log" diff --git a/internal/datanode/syncmgr/taskv2_test.go b/internal/flushcommon/syncmgr/taskv2_test.go similarity index 99% rename from internal/datanode/syncmgr/taskv2_test.go rename to internal/flushcommon/syncmgr/taskv2_test.go index 340cd83cc7..7ee82e259b 100644 --- a/internal/datanode/syncmgr/taskv2_test.go +++ b/internal/flushcommon/syncmgr/taskv2_test.go @@ -38,7 +38,7 @@ import ( "github.com/milvus-io/milvus-storage/go/storage/schema" "github.com/milvus-io/milvus/internal/allocator" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/internal/util/typeutil" diff --git a/internal/datanode/writebuffer/bf_write_buffer.go b/internal/flushcommon/writebuffer/bf_write_buffer.go similarity index 97% rename from internal/datanode/writebuffer/bf_write_buffer.go rename to internal/flushcommon/writebuffer/bf_write_buffer.go index 808b403860..b8ecf6ffa8 100644 --- a/internal/datanode/writebuffer/bf_write_buffer.go +++ b/internal/flushcommon/writebuffer/bf_write_buffer.go @@ -3,8 +3,8 @@ package writebuffer import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/mq/msgstream" diff --git a/internal/datanode/writebuffer/bf_write_buffer_test.go b/internal/flushcommon/writebuffer/bf_write_buffer_test.go similarity index 99% rename from internal/datanode/writebuffer/bf_write_buffer_test.go rename to internal/flushcommon/writebuffer/bf_write_buffer_test.go index df425832dd..77d6c38ed4 100644 --- a/internal/datanode/writebuffer/bf_write_buffer_test.go +++ b/internal/flushcommon/writebuffer/bf_write_buffer_test.go @@ -17,8 +17,8 @@ import ( "github.com/milvus-io/milvus-storage/go/storage/options" "github.com/milvus-io/milvus-storage/go/storage/schema" "github.com/milvus-io/milvus/internal/datanode/broker" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/querycoordv2/params" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/writebuffer/delta_buffer.go b/internal/flushcommon/writebuffer/delta_buffer.go similarity index 100% rename from internal/datanode/writebuffer/delta_buffer.go rename to internal/flushcommon/writebuffer/delta_buffer.go diff --git a/internal/datanode/writebuffer/delta_buffer_test.go b/internal/flushcommon/writebuffer/delta_buffer_test.go similarity index 100% rename from internal/datanode/writebuffer/delta_buffer_test.go rename to internal/flushcommon/writebuffer/delta_buffer_test.go diff --git a/internal/datanode/writebuffer/insert_buffer.go b/internal/flushcommon/writebuffer/insert_buffer.go similarity index 100% rename from internal/datanode/writebuffer/insert_buffer.go rename to internal/flushcommon/writebuffer/insert_buffer.go diff --git a/internal/datanode/writebuffer/insert_buffer_test.go b/internal/flushcommon/writebuffer/insert_buffer_test.go similarity index 100% rename from internal/datanode/writebuffer/insert_buffer_test.go rename to internal/flushcommon/writebuffer/insert_buffer_test.go diff --git a/internal/datanode/writebuffer/l0_write_buffer.go b/internal/flushcommon/writebuffer/l0_write_buffer.go similarity index 98% rename from internal/datanode/writebuffer/l0_write_buffer.go rename to internal/flushcommon/writebuffer/l0_write_buffer.go index a0a48ef4e8..12f3dc9841 100644 --- a/internal/datanode/writebuffer/l0_write_buffer.go +++ b/internal/flushcommon/writebuffer/l0_write_buffer.go @@ -10,8 +10,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/internal/allocator" "github.com/milvus-io/milvus/internal/datanode/io" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/datanode/writebuffer/l0_write_buffer_test.go b/internal/flushcommon/writebuffer/l0_write_buffer_test.go similarity index 98% rename from internal/datanode/writebuffer/l0_write_buffer_test.go rename to internal/flushcommon/writebuffer/l0_write_buffer_test.go index 0cd644cf1d..2cd16a2559 100644 --- a/internal/datanode/writebuffer/l0_write_buffer_test.go +++ b/internal/flushcommon/writebuffer/l0_write_buffer_test.go @@ -14,8 +14,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/common" diff --git a/internal/datanode/writebuffer/manager.go b/internal/flushcommon/writebuffer/manager.go similarity index 96% rename from internal/datanode/writebuffer/manager.go rename to internal/flushcommon/writebuffer/manager.go index 0ba29669fb..ff76da80d9 100644 --- a/internal/datanode/writebuffer/manager.go +++ b/internal/flushcommon/writebuffer/manager.go @@ -8,8 +8,8 @@ import ( "go.uber.org/zap" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/mq/msgstream" "github.com/milvus-io/milvus/pkg/util/hardware" @@ -19,6 +19,8 @@ import ( ) // BufferManager is the interface for WriteBuffer management. +// +//go:generate mockery --name=BufferManager --structname=MockBufferManager --output=./ --filename=mock_manager.go --with-expecter --inpackage type BufferManager interface { // Register adds a WriteBuffer with provided schema & options. Register(channel string, metacache metacache.MetaCache, storageV2Cache *metacache.StorageV2Cache, opts ...WriteBufferOption) error diff --git a/internal/datanode/writebuffer/manager_test.go b/internal/flushcommon/writebuffer/manager_test.go similarity index 98% rename from internal/datanode/writebuffer/manager_test.go rename to internal/flushcommon/writebuffer/manager_test.go index 55748cb7ef..a1004b479f 100644 --- a/internal/datanode/writebuffer/manager_test.go +++ b/internal/flushcommon/writebuffer/manager_test.go @@ -13,8 +13,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/datanode/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/hardware" "github.com/milvus-io/milvus/pkg/util/merr" diff --git a/internal/datanode/writebuffer/mock_mananger.go b/internal/flushcommon/writebuffer/mock_manager.go similarity index 95% rename from internal/datanode/writebuffer/mock_mananger.go rename to internal/flushcommon/writebuffer/mock_manager.go index 0410fb8f1c..bfa6307be5 100644 --- a/internal/datanode/writebuffer/mock_mananger.go +++ b/internal/flushcommon/writebuffer/mock_manager.go @@ -1,11 +1,11 @@ -// Code generated by mockery v2.32.4. DO NOT EDIT. +// Code generated by mockery v2.30.1. DO NOT EDIT. package writebuffer import ( context "context" - metacache "github.com/milvus-io/milvus/internal/datanode/metacache" + metacache "github.com/milvus-io/milvus/internal/flushcommon/metacache" mock "github.com/stretchr/testify/mock" msgpb "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" @@ -46,11 +46,11 @@ type MockBufferManager_BufferData_Call struct { } // BufferData is a helper method to define mock.On call -// - channel string -// - insertMsgs []*msgstream.InsertMsg -// - deleteMsgs []*msgstream.DeleteMsg -// - startPos *msgpb.MsgPosition -// - endPos *msgpb.MsgPosition +// - channel string +// - insertMsgs []*msgstream.InsertMsg +// - deleteMsgs []*msgstream.DeleteMsg +// - startPos *msgpb.MsgPosition +// - endPos *msgpb.MsgPosition func (_e *MockBufferManager_Expecter) BufferData(channel interface{}, insertMsgs interface{}, deleteMsgs interface{}, startPos interface{}, endPos interface{}) *MockBufferManager_BufferData_Call { return &MockBufferManager_BufferData_Call{Call: _e.mock.On("BufferData", channel, insertMsgs, deleteMsgs, startPos, endPos)} } @@ -83,7 +83,7 @@ type MockBufferManager_DropChannel_Call struct { } // DropChannel is a helper method to define mock.On call -// - channel string +// - channel string func (_e *MockBufferManager_Expecter) DropChannel(channel interface{}) *MockBufferManager_DropChannel_Call { return &MockBufferManager_DropChannel_Call{Call: _e.mock.On("DropChannel", channel)} } @@ -116,8 +116,8 @@ type MockBufferManager_DropPartitions_Call struct { } // DropPartitions is a helper method to define mock.On call -// - channel string -// - partitionIDs []int64 +// - channel string +// - partitionIDs []int64 func (_e *MockBufferManager_Expecter) DropPartitions(channel interface{}, partitionIDs interface{}) *MockBufferManager_DropPartitions_Call { return &MockBufferManager_DropPartitions_Call{Call: _e.mock.On("DropPartitions", channel, partitionIDs)} } @@ -159,9 +159,9 @@ type MockBufferManager_FlushChannel_Call struct { } // FlushChannel is a helper method to define mock.On call -// - ctx context.Context -// - channel string -// - flushTs uint64 +// - ctx context.Context +// - channel string +// - flushTs uint64 func (_e *MockBufferManager_Expecter) FlushChannel(ctx interface{}, channel interface{}, flushTs interface{}) *MockBufferManager_FlushChannel_Call { return &MockBufferManager_FlushChannel_Call{Call: _e.mock.On("FlushChannel", ctx, channel, flushTs)} } @@ -222,7 +222,7 @@ type MockBufferManager_GetCheckpoint_Call struct { } // GetCheckpoint is a helper method to define mock.On call -// - channel string +// - channel string func (_e *MockBufferManager_Expecter) GetCheckpoint(channel interface{}) *MockBufferManager_GetCheckpoint_Call { return &MockBufferManager_GetCheckpoint_Call{Call: _e.mock.On("GetCheckpoint", channel)} } @@ -255,8 +255,8 @@ type MockBufferManager_NotifyCheckpointUpdated_Call struct { } // NotifyCheckpointUpdated is a helper method to define mock.On call -// - channel string -// - ts uint64 +// - channel string +// - ts uint64 func (_e *MockBufferManager_Expecter) NotifyCheckpointUpdated(channel interface{}, ts interface{}) *MockBufferManager_NotifyCheckpointUpdated_Call { return &MockBufferManager_NotifyCheckpointUpdated_Call{Call: _e.mock.On("NotifyCheckpointUpdated", channel, ts)} } @@ -305,10 +305,10 @@ type MockBufferManager_Register_Call struct { } // Register is a helper method to define mock.On call -// - channel string -// - _a1 metacache.MetaCache -// - storageV2Cache *metacache.StorageV2Cache -// - opts ...WriteBufferOption +// - channel string +// - _a1 metacache.MetaCache +// - storageV2Cache *metacache.StorageV2Cache +// - opts ...WriteBufferOption func (_e *MockBufferManager_Expecter) Register(channel interface{}, _a1 interface{}, storageV2Cache interface{}, opts ...interface{}) *MockBufferManager_Register_Call { return &MockBufferManager_Register_Call{Call: _e.mock.On("Register", append([]interface{}{channel, _a1, storageV2Cache}, opts...)...)} @@ -348,7 +348,7 @@ type MockBufferManager_RemoveChannel_Call struct { } // RemoveChannel is a helper method to define mock.On call -// - channel string +// - channel string func (_e *MockBufferManager_Expecter) RemoveChannel(channel interface{}) *MockBufferManager_RemoveChannel_Call { return &MockBufferManager_RemoveChannel_Call{Call: _e.mock.On("RemoveChannel", channel)} } @@ -390,9 +390,9 @@ type MockBufferManager_SealSegments_Call struct { } // SealSegments is a helper method to define mock.On call -// - ctx context.Context -// - channel string -// - segmentIDs []int64 +// - ctx context.Context +// - channel string +// - segmentIDs []int64 func (_e *MockBufferManager_Expecter) SealSegments(ctx interface{}, channel interface{}, segmentIDs interface{}) *MockBufferManager_SealSegments_Call { return &MockBufferManager_SealSegments_Call{Call: _e.mock.On("SealSegments", ctx, channel, segmentIDs)} } diff --git a/internal/datanode/writebuffer/mock_write_buffer.go b/internal/flushcommon/writebuffer/mock_write_buffer.go similarity index 100% rename from internal/datanode/writebuffer/mock_write_buffer.go rename to internal/flushcommon/writebuffer/mock_write_buffer.go diff --git a/internal/datanode/writebuffer/options.go b/internal/flushcommon/writebuffer/options.go similarity index 94% rename from internal/datanode/writebuffer/options.go rename to internal/flushcommon/writebuffer/options.go index 12f4b6c740..7278dd1df7 100644 --- a/internal/datanode/writebuffer/options.go +++ b/internal/flushcommon/writebuffer/options.go @@ -4,8 +4,8 @@ import ( "time" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/pkg/util/paramtable" ) diff --git a/internal/datanode/writebuffer/segment_buffer.go b/internal/flushcommon/writebuffer/segment_buffer.go similarity index 100% rename from internal/datanode/writebuffer/segment_buffer.go rename to internal/flushcommon/writebuffer/segment_buffer.go diff --git a/internal/datanode/writebuffer/sync_policy.go b/internal/flushcommon/writebuffer/sync_policy.go similarity index 98% rename from internal/datanode/writebuffer/sync_policy.go rename to internal/flushcommon/writebuffer/sync_policy.go index 78ab384ce7..2ca3e55a16 100644 --- a/internal/datanode/writebuffer/sync_policy.go +++ b/internal/flushcommon/writebuffer/sync_policy.go @@ -9,7 +9,7 @@ import ( "go.uber.org/atomic" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/pkg/util/tsoutil" "github.com/milvus-io/milvus/pkg/util/typeutil" ) diff --git a/internal/datanode/writebuffer/sync_policy_test.go b/internal/flushcommon/writebuffer/sync_policy_test.go similarity index 98% rename from internal/datanode/writebuffer/sync_policy_test.go rename to internal/flushcommon/writebuffer/sync_policy_test.go index 670ebf655b..d9edc5d741 100644 --- a/internal/datanode/writebuffer/sync_policy_test.go +++ b/internal/flushcommon/writebuffer/sync_policy_test.go @@ -10,7 +10,7 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" - "github.com/milvus-io/milvus/internal/datanode/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/paramtable" "github.com/milvus-io/milvus/pkg/util/tsoutil" diff --git a/internal/datanode/writebuffer/write_buffer.go b/internal/flushcommon/writebuffer/write_buffer.go similarity index 99% rename from internal/datanode/writebuffer/write_buffer.go rename to internal/flushcommon/writebuffer/write_buffer.go index 7f28c288c2..7788465af5 100644 --- a/internal/datanode/writebuffer/write_buffer.go +++ b/internal/flushcommon/writebuffer/write_buffer.go @@ -13,8 +13,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/querycoordv2/params" "github.com/milvus-io/milvus/internal/storage" diff --git a/internal/datanode/writebuffer/write_buffer_test.go b/internal/flushcommon/writebuffer/write_buffer_test.go similarity index 98% rename from internal/datanode/writebuffer/write_buffer_test.go rename to internal/flushcommon/writebuffer/write_buffer_test.go index 27fbf90407..09e5084161 100644 --- a/internal/datanode/writebuffer/write_buffer_test.go +++ b/internal/flushcommon/writebuffer/write_buffer_test.go @@ -11,8 +11,8 @@ import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/allocator" - "github.com/milvus-io/milvus/internal/datanode/metacache" - "github.com/milvus-io/milvus/internal/datanode/syncmgr" + "github.com/milvus-io/milvus/internal/flushcommon/metacache" + "github.com/milvus-io/milvus/internal/flushcommon/syncmgr" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/conc" diff --git a/internal/mocks/mock_rootcoord.go b/internal/mocks/mock_rootcoord.go index d41d2cbd9a..91274cd486 100644 --- a/internal/mocks/mock_rootcoord.go +++ b/internal/mocks/mock_rootcoord.go @@ -68,8 +68,8 @@ type RootCoord_AllocID_Call struct { } // AllocID is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *rootcoordpb.AllocIDRequest +// - _a0 context.Context +// - _a1 *rootcoordpb.AllocIDRequest func (_e *RootCoord_Expecter) AllocID(_a0 interface{}, _a1 interface{}) *RootCoord_AllocID_Call { return &RootCoord_AllocID_Call{Call: _e.mock.On("AllocID", _a0, _a1)} } @@ -123,8 +123,8 @@ type RootCoord_AllocTimestamp_Call struct { } // AllocTimestamp is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *rootcoordpb.AllocTimestampRequest +// - _a0 context.Context +// - _a1 *rootcoordpb.AllocTimestampRequest func (_e *RootCoord_Expecter) AllocTimestamp(_a0 interface{}, _a1 interface{}) *RootCoord_AllocTimestamp_Call { return &RootCoord_AllocTimestamp_Call{Call: _e.mock.On("AllocTimestamp", _a0, _a1)} } @@ -178,8 +178,8 @@ type RootCoord_AlterAlias_Call struct { } // AlterAlias is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.AlterAliasRequest +// - _a0 context.Context +// - _a1 *milvuspb.AlterAliasRequest func (_e *RootCoord_Expecter) AlterAlias(_a0 interface{}, _a1 interface{}) *RootCoord_AlterAlias_Call { return &RootCoord_AlterAlias_Call{Call: _e.mock.On("AlterAlias", _a0, _a1)} } @@ -233,8 +233,8 @@ type RootCoord_AlterCollection_Call struct { } // AlterCollection is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.AlterCollectionRequest +// - _a0 context.Context +// - _a1 *milvuspb.AlterCollectionRequest func (_e *RootCoord_Expecter) AlterCollection(_a0 interface{}, _a1 interface{}) *RootCoord_AlterCollection_Call { return &RootCoord_AlterCollection_Call{Call: _e.mock.On("AlterCollection", _a0, _a1)} } @@ -288,8 +288,8 @@ type RootCoord_AlterDatabase_Call struct { } // AlterDatabase is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *rootcoordpb.AlterDatabaseRequest +// - _a0 context.Context +// - _a1 *rootcoordpb.AlterDatabaseRequest func (_e *RootCoord_Expecter) AlterDatabase(_a0 interface{}, _a1 interface{}) *RootCoord_AlterDatabase_Call { return &RootCoord_AlterDatabase_Call{Call: _e.mock.On("AlterDatabase", _a0, _a1)} } @@ -343,8 +343,8 @@ type RootCoord_CheckHealth_Call struct { } // CheckHealth is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.CheckHealthRequest +// - _a0 context.Context +// - _a1 *milvuspb.CheckHealthRequest func (_e *RootCoord_Expecter) CheckHealth(_a0 interface{}, _a1 interface{}) *RootCoord_CheckHealth_Call { return &RootCoord_CheckHealth_Call{Call: _e.mock.On("CheckHealth", _a0, _a1)} } @@ -398,8 +398,8 @@ type RootCoord_CreateAlias_Call struct { } // CreateAlias is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.CreateAliasRequest +// - _a0 context.Context +// - _a1 *milvuspb.CreateAliasRequest func (_e *RootCoord_Expecter) CreateAlias(_a0 interface{}, _a1 interface{}) *RootCoord_CreateAlias_Call { return &RootCoord_CreateAlias_Call{Call: _e.mock.On("CreateAlias", _a0, _a1)} } @@ -453,8 +453,8 @@ type RootCoord_CreateCollection_Call struct { } // CreateCollection is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.CreateCollectionRequest +// - _a0 context.Context +// - _a1 *milvuspb.CreateCollectionRequest func (_e *RootCoord_Expecter) CreateCollection(_a0 interface{}, _a1 interface{}) *RootCoord_CreateCollection_Call { return &RootCoord_CreateCollection_Call{Call: _e.mock.On("CreateCollection", _a0, _a1)} } @@ -508,8 +508,8 @@ type RootCoord_CreateCredential_Call struct { } // CreateCredential is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *internalpb.CredentialInfo +// - _a0 context.Context +// - _a1 *internalpb.CredentialInfo func (_e *RootCoord_Expecter) CreateCredential(_a0 interface{}, _a1 interface{}) *RootCoord_CreateCredential_Call { return &RootCoord_CreateCredential_Call{Call: _e.mock.On("CreateCredential", _a0, _a1)} } @@ -563,8 +563,8 @@ type RootCoord_CreateDatabase_Call struct { } // CreateDatabase is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.CreateDatabaseRequest +// - _a0 context.Context +// - _a1 *milvuspb.CreateDatabaseRequest func (_e *RootCoord_Expecter) CreateDatabase(_a0 interface{}, _a1 interface{}) *RootCoord_CreateDatabase_Call { return &RootCoord_CreateDatabase_Call{Call: _e.mock.On("CreateDatabase", _a0, _a1)} } @@ -618,8 +618,8 @@ type RootCoord_CreatePartition_Call struct { } // CreatePartition is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.CreatePartitionRequest +// - _a0 context.Context +// - _a1 *milvuspb.CreatePartitionRequest func (_e *RootCoord_Expecter) CreatePartition(_a0 interface{}, _a1 interface{}) *RootCoord_CreatePartition_Call { return &RootCoord_CreatePartition_Call{Call: _e.mock.On("CreatePartition", _a0, _a1)} } @@ -673,8 +673,8 @@ type RootCoord_CreateRole_Call struct { } // CreateRole is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.CreateRoleRequest +// - _a0 context.Context +// - _a1 *milvuspb.CreateRoleRequest func (_e *RootCoord_Expecter) CreateRole(_a0 interface{}, _a1 interface{}) *RootCoord_CreateRole_Call { return &RootCoord_CreateRole_Call{Call: _e.mock.On("CreateRole", _a0, _a1)} } @@ -728,8 +728,8 @@ type RootCoord_DeleteCredential_Call struct { } // DeleteCredential is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DeleteCredentialRequest +// - _a0 context.Context +// - _a1 *milvuspb.DeleteCredentialRequest func (_e *RootCoord_Expecter) DeleteCredential(_a0 interface{}, _a1 interface{}) *RootCoord_DeleteCredential_Call { return &RootCoord_DeleteCredential_Call{Call: _e.mock.On("DeleteCredential", _a0, _a1)} } @@ -783,8 +783,8 @@ type RootCoord_DescribeAlias_Call struct { } // DescribeAlias is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DescribeAliasRequest +// - _a0 context.Context +// - _a1 *milvuspb.DescribeAliasRequest func (_e *RootCoord_Expecter) DescribeAlias(_a0 interface{}, _a1 interface{}) *RootCoord_DescribeAlias_Call { return &RootCoord_DescribeAlias_Call{Call: _e.mock.On("DescribeAlias", _a0, _a1)} } @@ -838,8 +838,8 @@ type RootCoord_DescribeCollection_Call struct { } // DescribeCollection is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DescribeCollectionRequest +// - _a0 context.Context +// - _a1 *milvuspb.DescribeCollectionRequest func (_e *RootCoord_Expecter) DescribeCollection(_a0 interface{}, _a1 interface{}) *RootCoord_DescribeCollection_Call { return &RootCoord_DescribeCollection_Call{Call: _e.mock.On("DescribeCollection", _a0, _a1)} } @@ -893,8 +893,8 @@ type RootCoord_DescribeCollectionInternal_Call struct { } // DescribeCollectionInternal is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DescribeCollectionRequest +// - _a0 context.Context +// - _a1 *milvuspb.DescribeCollectionRequest func (_e *RootCoord_Expecter) DescribeCollectionInternal(_a0 interface{}, _a1 interface{}) *RootCoord_DescribeCollectionInternal_Call { return &RootCoord_DescribeCollectionInternal_Call{Call: _e.mock.On("DescribeCollectionInternal", _a0, _a1)} } @@ -948,8 +948,8 @@ type RootCoord_DescribeDatabase_Call struct { } // DescribeDatabase is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *rootcoordpb.DescribeDatabaseRequest +// - _a0 context.Context +// - _a1 *rootcoordpb.DescribeDatabaseRequest func (_e *RootCoord_Expecter) DescribeDatabase(_a0 interface{}, _a1 interface{}) *RootCoord_DescribeDatabase_Call { return &RootCoord_DescribeDatabase_Call{Call: _e.mock.On("DescribeDatabase", _a0, _a1)} } @@ -1003,8 +1003,8 @@ type RootCoord_DropAlias_Call struct { } // DropAlias is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DropAliasRequest +// - _a0 context.Context +// - _a1 *milvuspb.DropAliasRequest func (_e *RootCoord_Expecter) DropAlias(_a0 interface{}, _a1 interface{}) *RootCoord_DropAlias_Call { return &RootCoord_DropAlias_Call{Call: _e.mock.On("DropAlias", _a0, _a1)} } @@ -1058,8 +1058,8 @@ type RootCoord_DropCollection_Call struct { } // DropCollection is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DropCollectionRequest +// - _a0 context.Context +// - _a1 *milvuspb.DropCollectionRequest func (_e *RootCoord_Expecter) DropCollection(_a0 interface{}, _a1 interface{}) *RootCoord_DropCollection_Call { return &RootCoord_DropCollection_Call{Call: _e.mock.On("DropCollection", _a0, _a1)} } @@ -1113,8 +1113,8 @@ type RootCoord_DropDatabase_Call struct { } // DropDatabase is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DropDatabaseRequest +// - _a0 context.Context +// - _a1 *milvuspb.DropDatabaseRequest func (_e *RootCoord_Expecter) DropDatabase(_a0 interface{}, _a1 interface{}) *RootCoord_DropDatabase_Call { return &RootCoord_DropDatabase_Call{Call: _e.mock.On("DropDatabase", _a0, _a1)} } @@ -1168,8 +1168,8 @@ type RootCoord_DropPartition_Call struct { } // DropPartition is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DropPartitionRequest +// - _a0 context.Context +// - _a1 *milvuspb.DropPartitionRequest func (_e *RootCoord_Expecter) DropPartition(_a0 interface{}, _a1 interface{}) *RootCoord_DropPartition_Call { return &RootCoord_DropPartition_Call{Call: _e.mock.On("DropPartition", _a0, _a1)} } @@ -1223,8 +1223,8 @@ type RootCoord_DropRole_Call struct { } // DropRole is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.DropRoleRequest +// - _a0 context.Context +// - _a1 *milvuspb.DropRoleRequest func (_e *RootCoord_Expecter) DropRole(_a0 interface{}, _a1 interface{}) *RootCoord_DropRole_Call { return &RootCoord_DropRole_Call{Call: _e.mock.On("DropRole", _a0, _a1)} } @@ -1278,8 +1278,8 @@ type RootCoord_GetComponentStates_Call struct { } // GetComponentStates is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.GetComponentStatesRequest +// - _a0 context.Context +// - _a1 *milvuspb.GetComponentStatesRequest func (_e *RootCoord_Expecter) GetComponentStates(_a0 interface{}, _a1 interface{}) *RootCoord_GetComponentStates_Call { return &RootCoord_GetComponentStates_Call{Call: _e.mock.On("GetComponentStates", _a0, _a1)} } @@ -1333,8 +1333,8 @@ type RootCoord_GetCredential_Call struct { } // GetCredential is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *rootcoordpb.GetCredentialRequest +// - _a0 context.Context +// - _a1 *rootcoordpb.GetCredentialRequest func (_e *RootCoord_Expecter) GetCredential(_a0 interface{}, _a1 interface{}) *RootCoord_GetCredential_Call { return &RootCoord_GetCredential_Call{Call: _e.mock.On("GetCredential", _a0, _a1)} } @@ -1388,8 +1388,8 @@ type RootCoord_GetMetrics_Call struct { } // GetMetrics is a helper method to define mock.On call -// - ctx context.Context -// - req *milvuspb.GetMetricsRequest +// - ctx context.Context +// - req *milvuspb.GetMetricsRequest func (_e *RootCoord_Expecter) GetMetrics(ctx interface{}, req interface{}) *RootCoord_GetMetrics_Call { return &RootCoord_GetMetrics_Call{Call: _e.mock.On("GetMetrics", ctx, req)} } @@ -1443,8 +1443,8 @@ type RootCoord_GetStatisticsChannel_Call struct { } // GetStatisticsChannel is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *internalpb.GetStatisticsChannelRequest +// - _a0 context.Context +// - _a1 *internalpb.GetStatisticsChannelRequest func (_e *RootCoord_Expecter) GetStatisticsChannel(_a0 interface{}, _a1 interface{}) *RootCoord_GetStatisticsChannel_Call { return &RootCoord_GetStatisticsChannel_Call{Call: _e.mock.On("GetStatisticsChannel", _a0, _a1)} } @@ -1498,8 +1498,8 @@ type RootCoord_GetTimeTickChannel_Call struct { } // GetTimeTickChannel is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *internalpb.GetTimeTickChannelRequest +// - _a0 context.Context +// - _a1 *internalpb.GetTimeTickChannelRequest func (_e *RootCoord_Expecter) GetTimeTickChannel(_a0 interface{}, _a1 interface{}) *RootCoord_GetTimeTickChannel_Call { return &RootCoord_GetTimeTickChannel_Call{Call: _e.mock.On("GetTimeTickChannel", _a0, _a1)} } @@ -1521,6 +1521,61 @@ func (_c *RootCoord_GetTimeTickChannel_Call) RunAndReturn(run func(context.Conte return _c } +// GetVChannels provides a mock function with given fields: _a0, _a1 +func (_m *RootCoord) GetVChannels(_a0 context.Context, _a1 *rootcoordpb.GetVChannelsRequest) (*rootcoordpb.GetVChannelsResponse, error) { + ret := _m.Called(_a0, _a1) + + var r0 *rootcoordpb.GetVChannelsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *rootcoordpb.GetVChannelsRequest) (*rootcoordpb.GetVChannelsResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *rootcoordpb.GetVChannelsRequest) *rootcoordpb.GetVChannelsResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*rootcoordpb.GetVChannelsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *rootcoordpb.GetVChannelsRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RootCoord_GetVChannels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVChannels' +type RootCoord_GetVChannels_Call struct { + *mock.Call +} + +// GetVChannels is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *rootcoordpb.GetVChannelsRequest +func (_e *RootCoord_Expecter) GetVChannels(_a0 interface{}, _a1 interface{}) *RootCoord_GetVChannels_Call { + return &RootCoord_GetVChannels_Call{Call: _e.mock.On("GetVChannels", _a0, _a1)} +} + +func (_c *RootCoord_GetVChannels_Call) Run(run func(_a0 context.Context, _a1 *rootcoordpb.GetVChannelsRequest)) *RootCoord_GetVChannels_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*rootcoordpb.GetVChannelsRequest)) + }) + return _c +} + +func (_c *RootCoord_GetVChannels_Call) Return(_a0 *rootcoordpb.GetVChannelsResponse, _a1 error) *RootCoord_GetVChannels_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RootCoord_GetVChannels_Call) RunAndReturn(run func(context.Context, *rootcoordpb.GetVChannelsRequest) (*rootcoordpb.GetVChannelsResponse, error)) *RootCoord_GetVChannels_Call { + _c.Call.Return(run) + return _c +} + // HasCollection provides a mock function with given fields: _a0, _a1 func (_m *RootCoord) HasCollection(_a0 context.Context, _a1 *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error) { ret := _m.Called(_a0, _a1) @@ -1553,8 +1608,8 @@ type RootCoord_HasCollection_Call struct { } // HasCollection is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.HasCollectionRequest +// - _a0 context.Context +// - _a1 *milvuspb.HasCollectionRequest func (_e *RootCoord_Expecter) HasCollection(_a0 interface{}, _a1 interface{}) *RootCoord_HasCollection_Call { return &RootCoord_HasCollection_Call{Call: _e.mock.On("HasCollection", _a0, _a1)} } @@ -1608,8 +1663,8 @@ type RootCoord_HasPartition_Call struct { } // HasPartition is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.HasPartitionRequest +// - _a0 context.Context +// - _a1 *milvuspb.HasPartitionRequest func (_e *RootCoord_Expecter) HasPartition(_a0 interface{}, _a1 interface{}) *RootCoord_HasPartition_Call { return &RootCoord_HasPartition_Call{Call: _e.mock.On("HasPartition", _a0, _a1)} } @@ -1704,8 +1759,8 @@ type RootCoord_InvalidateCollectionMetaCache_Call struct { } // InvalidateCollectionMetaCache is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *proxypb.InvalidateCollMetaCacheRequest +// - _a0 context.Context +// - _a1 *proxypb.InvalidateCollMetaCacheRequest func (_e *RootCoord_Expecter) InvalidateCollectionMetaCache(_a0 interface{}, _a1 interface{}) *RootCoord_InvalidateCollectionMetaCache_Call { return &RootCoord_InvalidateCollectionMetaCache_Call{Call: _e.mock.On("InvalidateCollectionMetaCache", _a0, _a1)} } @@ -1759,8 +1814,8 @@ type RootCoord_ListAliases_Call struct { } // ListAliases is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.ListAliasesRequest +// - _a0 context.Context +// - _a1 *milvuspb.ListAliasesRequest func (_e *RootCoord_Expecter) ListAliases(_a0 interface{}, _a1 interface{}) *RootCoord_ListAliases_Call { return &RootCoord_ListAliases_Call{Call: _e.mock.On("ListAliases", _a0, _a1)} } @@ -1814,8 +1869,8 @@ type RootCoord_ListCredUsers_Call struct { } // ListCredUsers is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.ListCredUsersRequest +// - _a0 context.Context +// - _a1 *milvuspb.ListCredUsersRequest func (_e *RootCoord_Expecter) ListCredUsers(_a0 interface{}, _a1 interface{}) *RootCoord_ListCredUsers_Call { return &RootCoord_ListCredUsers_Call{Call: _e.mock.On("ListCredUsers", _a0, _a1)} } @@ -1869,8 +1924,8 @@ type RootCoord_ListDatabases_Call struct { } // ListDatabases is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.ListDatabasesRequest +// - _a0 context.Context +// - _a1 *milvuspb.ListDatabasesRequest func (_e *RootCoord_Expecter) ListDatabases(_a0 interface{}, _a1 interface{}) *RootCoord_ListDatabases_Call { return &RootCoord_ListDatabases_Call{Call: _e.mock.On("ListDatabases", _a0, _a1)} } @@ -1924,8 +1979,8 @@ type RootCoord_ListPolicy_Call struct { } // ListPolicy is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *internalpb.ListPolicyRequest +// - _a0 context.Context +// - _a1 *internalpb.ListPolicyRequest func (_e *RootCoord_Expecter) ListPolicy(_a0 interface{}, _a1 interface{}) *RootCoord_ListPolicy_Call { return &RootCoord_ListPolicy_Call{Call: _e.mock.On("ListPolicy", _a0, _a1)} } @@ -1979,8 +2034,8 @@ type RootCoord_OperatePrivilege_Call struct { } // OperatePrivilege is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.OperatePrivilegeRequest +// - _a0 context.Context +// - _a1 *milvuspb.OperatePrivilegeRequest func (_e *RootCoord_Expecter) OperatePrivilege(_a0 interface{}, _a1 interface{}) *RootCoord_OperatePrivilege_Call { return &RootCoord_OperatePrivilege_Call{Call: _e.mock.On("OperatePrivilege", _a0, _a1)} } @@ -2034,8 +2089,8 @@ type RootCoord_OperateUserRole_Call struct { } // OperateUserRole is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.OperateUserRoleRequest +// - _a0 context.Context +// - _a1 *milvuspb.OperateUserRoleRequest func (_e *RootCoord_Expecter) OperateUserRole(_a0 interface{}, _a1 interface{}) *RootCoord_OperateUserRole_Call { return &RootCoord_OperateUserRole_Call{Call: _e.mock.On("OperateUserRole", _a0, _a1)} } @@ -2130,8 +2185,8 @@ type RootCoord_RenameCollection_Call struct { } // RenameCollection is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.RenameCollectionRequest +// - _a0 context.Context +// - _a1 *milvuspb.RenameCollectionRequest func (_e *RootCoord_Expecter) RenameCollection(_a0 interface{}, _a1 interface{}) *RootCoord_RenameCollection_Call { return &RootCoord_RenameCollection_Call{Call: _e.mock.On("RenameCollection", _a0, _a1)} } @@ -2185,8 +2240,8 @@ type RootCoord_SelectGrant_Call struct { } // SelectGrant is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.SelectGrantRequest +// - _a0 context.Context +// - _a1 *milvuspb.SelectGrantRequest func (_e *RootCoord_Expecter) SelectGrant(_a0 interface{}, _a1 interface{}) *RootCoord_SelectGrant_Call { return &RootCoord_SelectGrant_Call{Call: _e.mock.On("SelectGrant", _a0, _a1)} } @@ -2240,8 +2295,8 @@ type RootCoord_SelectRole_Call struct { } // SelectRole is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.SelectRoleRequest +// - _a0 context.Context +// - _a1 *milvuspb.SelectRoleRequest func (_e *RootCoord_Expecter) SelectRole(_a0 interface{}, _a1 interface{}) *RootCoord_SelectRole_Call { return &RootCoord_SelectRole_Call{Call: _e.mock.On("SelectRole", _a0, _a1)} } @@ -2295,8 +2350,8 @@ type RootCoord_SelectUser_Call struct { } // SelectUser is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.SelectUserRequest +// - _a0 context.Context +// - _a1 *milvuspb.SelectUserRequest func (_e *RootCoord_Expecter) SelectUser(_a0 interface{}, _a1 interface{}) *RootCoord_SelectUser_Call { return &RootCoord_SelectUser_Call{Call: _e.mock.On("SelectUser", _a0, _a1)} } @@ -2329,7 +2384,7 @@ type RootCoord_SetAddress_Call struct { } // SetAddress is a helper method to define mock.On call -// - address string +// - address string func (_e *RootCoord_Expecter) SetAddress(address interface{}) *RootCoord_SetAddress_Call { return &RootCoord_SetAddress_Call{Call: _e.mock.On("SetAddress", address)} } @@ -2371,7 +2426,7 @@ type RootCoord_SetDataCoordClient_Call struct { } // SetDataCoordClient is a helper method to define mock.On call -// - dataCoord types.DataCoordClient +// - dataCoord types.DataCoordClient func (_e *RootCoord_Expecter) SetDataCoordClient(dataCoord interface{}) *RootCoord_SetDataCoordClient_Call { return &RootCoord_SetDataCoordClient_Call{Call: _e.mock.On("SetDataCoordClient", dataCoord)} } @@ -2404,7 +2459,7 @@ type RootCoord_SetEtcdClient_Call struct { } // SetEtcdClient is a helper method to define mock.On call -// - etcdClient *clientv3.Client +// - etcdClient *clientv3.Client func (_e *RootCoord_Expecter) SetEtcdClient(etcdClient interface{}) *RootCoord_SetEtcdClient_Call { return &RootCoord_SetEtcdClient_Call{Call: _e.mock.On("SetEtcdClient", etcdClient)} } @@ -2437,7 +2492,7 @@ type RootCoord_SetProxyCreator_Call struct { } // SetProxyCreator is a helper method to define mock.On call -// - _a0 func(context.Context , string , int64)(types.ProxyClient , error) +// - _a0 func(context.Context , string , int64)(types.ProxyClient , error) func (_e *RootCoord_Expecter) SetProxyCreator(_a0 interface{}) *RootCoord_SetProxyCreator_Call { return &RootCoord_SetProxyCreator_Call{Call: _e.mock.On("SetProxyCreator", _a0)} } @@ -2479,7 +2534,7 @@ type RootCoord_SetQueryCoordClient_Call struct { } // SetQueryCoordClient is a helper method to define mock.On call -// - queryCoord types.QueryCoordClient +// - queryCoord types.QueryCoordClient func (_e *RootCoord_Expecter) SetQueryCoordClient(queryCoord interface{}) *RootCoord_SetQueryCoordClient_Call { return &RootCoord_SetQueryCoordClient_Call{Call: _e.mock.On("SetQueryCoordClient", queryCoord)} } @@ -2512,7 +2567,7 @@ type RootCoord_SetTiKVClient_Call struct { } // SetTiKVClient is a helper method to define mock.On call -// - client *txnkv.Client +// - client *txnkv.Client func (_e *RootCoord_Expecter) SetTiKVClient(client interface{}) *RootCoord_SetTiKVClient_Call { return &RootCoord_SetTiKVClient_Call{Call: _e.mock.On("SetTiKVClient", client)} } @@ -2566,8 +2621,8 @@ type RootCoord_ShowCollections_Call struct { } // ShowCollections is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.ShowCollectionsRequest +// - _a0 context.Context +// - _a1 *milvuspb.ShowCollectionsRequest func (_e *RootCoord_Expecter) ShowCollections(_a0 interface{}, _a1 interface{}) *RootCoord_ShowCollections_Call { return &RootCoord_ShowCollections_Call{Call: _e.mock.On("ShowCollections", _a0, _a1)} } @@ -2621,8 +2676,8 @@ type RootCoord_ShowConfigurations_Call struct { } // ShowConfigurations is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *internalpb.ShowConfigurationsRequest +// - _a0 context.Context +// - _a1 *internalpb.ShowConfigurationsRequest func (_e *RootCoord_Expecter) ShowConfigurations(_a0 interface{}, _a1 interface{}) *RootCoord_ShowConfigurations_Call { return &RootCoord_ShowConfigurations_Call{Call: _e.mock.On("ShowConfigurations", _a0, _a1)} } @@ -2676,8 +2731,8 @@ type RootCoord_ShowPartitions_Call struct { } // ShowPartitions is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.ShowPartitionsRequest +// - _a0 context.Context +// - _a1 *milvuspb.ShowPartitionsRequest func (_e *RootCoord_Expecter) ShowPartitions(_a0 interface{}, _a1 interface{}) *RootCoord_ShowPartitions_Call { return &RootCoord_ShowPartitions_Call{Call: _e.mock.On("ShowPartitions", _a0, _a1)} } @@ -2731,8 +2786,8 @@ type RootCoord_ShowPartitionsInternal_Call struct { } // ShowPartitionsInternal is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.ShowPartitionsRequest +// - _a0 context.Context +// - _a1 *milvuspb.ShowPartitionsRequest func (_e *RootCoord_Expecter) ShowPartitionsInternal(_a0 interface{}, _a1 interface{}) *RootCoord_ShowPartitionsInternal_Call { return &RootCoord_ShowPartitionsInternal_Call{Call: _e.mock.On("ShowPartitionsInternal", _a0, _a1)} } @@ -2786,8 +2841,8 @@ type RootCoord_ShowSegments_Call struct { } // ShowSegments is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *milvuspb.ShowSegmentsRequest +// - _a0 context.Context +// - _a1 *milvuspb.ShowSegmentsRequest func (_e *RootCoord_Expecter) ShowSegments(_a0 interface{}, _a1 interface{}) *RootCoord_ShowSegments_Call { return &RootCoord_ShowSegments_Call{Call: _e.mock.On("ShowSegments", _a0, _a1)} } @@ -2923,8 +2978,8 @@ type RootCoord_UpdateChannelTimeTick_Call struct { } // UpdateChannelTimeTick is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *internalpb.ChannelTimeTickMsg +// - _a0 context.Context +// - _a1 *internalpb.ChannelTimeTickMsg func (_e *RootCoord_Expecter) UpdateChannelTimeTick(_a0 interface{}, _a1 interface{}) *RootCoord_UpdateChannelTimeTick_Call { return &RootCoord_UpdateChannelTimeTick_Call{Call: _e.mock.On("UpdateChannelTimeTick", _a0, _a1)} } @@ -2978,8 +3033,8 @@ type RootCoord_UpdateCredential_Call struct { } // UpdateCredential is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *internalpb.CredentialInfo +// - _a0 context.Context +// - _a1 *internalpb.CredentialInfo func (_e *RootCoord_Expecter) UpdateCredential(_a0 interface{}, _a1 interface{}) *RootCoord_UpdateCredential_Call { return &RootCoord_UpdateCredential_Call{Call: _e.mock.On("UpdateCredential", _a0, _a1)} } @@ -3012,7 +3067,7 @@ type RootCoord_UpdateStateCode_Call struct { } // UpdateStateCode is a helper method to define mock.On call -// - _a0 commonpb.StateCode +// - _a0 commonpb.StateCode func (_e *RootCoord_Expecter) UpdateStateCode(_a0 interface{}) *RootCoord_UpdateStateCode_Call { return &RootCoord_UpdateStateCode_Call{Call: _e.mock.On("UpdateStateCode", _a0)} } diff --git a/internal/mocks/mock_rootcoord_client.go b/internal/mocks/mock_rootcoord_client.go index 4a1ba8099b..2c7f596b56 100644 --- a/internal/mocks/mock_rootcoord_client.go +++ b/internal/mocks/mock_rootcoord_client.go @@ -72,9 +72,9 @@ type MockRootCoordClient_AllocID_Call struct { } // AllocID is a helper method to define mock.On call -// - ctx context.Context -// - in *rootcoordpb.AllocIDRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *rootcoordpb.AllocIDRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) AllocID(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_AllocID_Call { return &MockRootCoordClient_AllocID_Call{Call: _e.mock.On("AllocID", append([]interface{}{ctx, in}, opts...)...)} @@ -142,9 +142,9 @@ type MockRootCoordClient_AllocTimestamp_Call struct { } // AllocTimestamp is a helper method to define mock.On call -// - ctx context.Context -// - in *rootcoordpb.AllocTimestampRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *rootcoordpb.AllocTimestampRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) AllocTimestamp(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_AllocTimestamp_Call { return &MockRootCoordClient_AllocTimestamp_Call{Call: _e.mock.On("AllocTimestamp", append([]interface{}{ctx, in}, opts...)...)} @@ -212,9 +212,9 @@ type MockRootCoordClient_AlterAlias_Call struct { } // AlterAlias is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.AlterAliasRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.AlterAliasRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) AlterAlias(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_AlterAlias_Call { return &MockRootCoordClient_AlterAlias_Call{Call: _e.mock.On("AlterAlias", append([]interface{}{ctx, in}, opts...)...)} @@ -282,9 +282,9 @@ type MockRootCoordClient_AlterCollection_Call struct { } // AlterCollection is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.AlterCollectionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.AlterCollectionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) AlterCollection(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_AlterCollection_Call { return &MockRootCoordClient_AlterCollection_Call{Call: _e.mock.On("AlterCollection", append([]interface{}{ctx, in}, opts...)...)} @@ -352,9 +352,9 @@ type MockRootCoordClient_AlterDatabase_Call struct { } // AlterDatabase is a helper method to define mock.On call -// - ctx context.Context -// - in *rootcoordpb.AlterDatabaseRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *rootcoordpb.AlterDatabaseRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) AlterDatabase(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_AlterDatabase_Call { return &MockRootCoordClient_AlterDatabase_Call{Call: _e.mock.On("AlterDatabase", append([]interface{}{ctx, in}, opts...)...)} @@ -422,9 +422,9 @@ type MockRootCoordClient_CheckHealth_Call struct { } // CheckHealth is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.CheckHealthRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.CheckHealthRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) CheckHealth(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_CheckHealth_Call { return &MockRootCoordClient_CheckHealth_Call{Call: _e.mock.On("CheckHealth", append([]interface{}{ctx, in}, opts...)...)} @@ -533,9 +533,9 @@ type MockRootCoordClient_CreateAlias_Call struct { } // CreateAlias is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.CreateAliasRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.CreateAliasRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) CreateAlias(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_CreateAlias_Call { return &MockRootCoordClient_CreateAlias_Call{Call: _e.mock.On("CreateAlias", append([]interface{}{ctx, in}, opts...)...)} @@ -603,9 +603,9 @@ type MockRootCoordClient_CreateCollection_Call struct { } // CreateCollection is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.CreateCollectionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.CreateCollectionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) CreateCollection(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_CreateCollection_Call { return &MockRootCoordClient_CreateCollection_Call{Call: _e.mock.On("CreateCollection", append([]interface{}{ctx, in}, opts...)...)} @@ -673,9 +673,9 @@ type MockRootCoordClient_CreateCredential_Call struct { } // CreateCredential is a helper method to define mock.On call -// - ctx context.Context -// - in *internalpb.CredentialInfo -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *internalpb.CredentialInfo +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) CreateCredential(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_CreateCredential_Call { return &MockRootCoordClient_CreateCredential_Call{Call: _e.mock.On("CreateCredential", append([]interface{}{ctx, in}, opts...)...)} @@ -743,9 +743,9 @@ type MockRootCoordClient_CreateDatabase_Call struct { } // CreateDatabase is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.CreateDatabaseRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.CreateDatabaseRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) CreateDatabase(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_CreateDatabase_Call { return &MockRootCoordClient_CreateDatabase_Call{Call: _e.mock.On("CreateDatabase", append([]interface{}{ctx, in}, opts...)...)} @@ -813,9 +813,9 @@ type MockRootCoordClient_CreatePartition_Call struct { } // CreatePartition is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.CreatePartitionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.CreatePartitionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) CreatePartition(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_CreatePartition_Call { return &MockRootCoordClient_CreatePartition_Call{Call: _e.mock.On("CreatePartition", append([]interface{}{ctx, in}, opts...)...)} @@ -883,9 +883,9 @@ type MockRootCoordClient_CreateRole_Call struct { } // CreateRole is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.CreateRoleRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.CreateRoleRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) CreateRole(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_CreateRole_Call { return &MockRootCoordClient_CreateRole_Call{Call: _e.mock.On("CreateRole", append([]interface{}{ctx, in}, opts...)...)} @@ -953,9 +953,9 @@ type MockRootCoordClient_DeleteCredential_Call struct { } // DeleteCredential is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DeleteCredentialRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DeleteCredentialRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DeleteCredential(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DeleteCredential_Call { return &MockRootCoordClient_DeleteCredential_Call{Call: _e.mock.On("DeleteCredential", append([]interface{}{ctx, in}, opts...)...)} @@ -1023,9 +1023,9 @@ type MockRootCoordClient_DescribeAlias_Call struct { } // DescribeAlias is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DescribeAliasRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DescribeAliasRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DescribeAlias(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DescribeAlias_Call { return &MockRootCoordClient_DescribeAlias_Call{Call: _e.mock.On("DescribeAlias", append([]interface{}{ctx, in}, opts...)...)} @@ -1093,9 +1093,9 @@ type MockRootCoordClient_DescribeCollection_Call struct { } // DescribeCollection is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DescribeCollectionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DescribeCollectionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DescribeCollection(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DescribeCollection_Call { return &MockRootCoordClient_DescribeCollection_Call{Call: _e.mock.On("DescribeCollection", append([]interface{}{ctx, in}, opts...)...)} @@ -1163,9 +1163,9 @@ type MockRootCoordClient_DescribeCollectionInternal_Call struct { } // DescribeCollectionInternal is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DescribeCollectionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DescribeCollectionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DescribeCollectionInternal(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DescribeCollectionInternal_Call { return &MockRootCoordClient_DescribeCollectionInternal_Call{Call: _e.mock.On("DescribeCollectionInternal", append([]interface{}{ctx, in}, opts...)...)} @@ -1233,9 +1233,9 @@ type MockRootCoordClient_DescribeDatabase_Call struct { } // DescribeDatabase is a helper method to define mock.On call -// - ctx context.Context -// - in *rootcoordpb.DescribeDatabaseRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *rootcoordpb.DescribeDatabaseRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DescribeDatabase(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DescribeDatabase_Call { return &MockRootCoordClient_DescribeDatabase_Call{Call: _e.mock.On("DescribeDatabase", append([]interface{}{ctx, in}, opts...)...)} @@ -1303,9 +1303,9 @@ type MockRootCoordClient_DropAlias_Call struct { } // DropAlias is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DropAliasRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DropAliasRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DropAlias(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DropAlias_Call { return &MockRootCoordClient_DropAlias_Call{Call: _e.mock.On("DropAlias", append([]interface{}{ctx, in}, opts...)...)} @@ -1373,9 +1373,9 @@ type MockRootCoordClient_DropCollection_Call struct { } // DropCollection is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DropCollectionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DropCollectionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DropCollection(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DropCollection_Call { return &MockRootCoordClient_DropCollection_Call{Call: _e.mock.On("DropCollection", append([]interface{}{ctx, in}, opts...)...)} @@ -1443,9 +1443,9 @@ type MockRootCoordClient_DropDatabase_Call struct { } // DropDatabase is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DropDatabaseRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DropDatabaseRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DropDatabase(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DropDatabase_Call { return &MockRootCoordClient_DropDatabase_Call{Call: _e.mock.On("DropDatabase", append([]interface{}{ctx, in}, opts...)...)} @@ -1513,9 +1513,9 @@ type MockRootCoordClient_DropPartition_Call struct { } // DropPartition is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DropPartitionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DropPartitionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DropPartition(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DropPartition_Call { return &MockRootCoordClient_DropPartition_Call{Call: _e.mock.On("DropPartition", append([]interface{}{ctx, in}, opts...)...)} @@ -1583,9 +1583,9 @@ type MockRootCoordClient_DropRole_Call struct { } // DropRole is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.DropRoleRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.DropRoleRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) DropRole(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_DropRole_Call { return &MockRootCoordClient_DropRole_Call{Call: _e.mock.On("DropRole", append([]interface{}{ctx, in}, opts...)...)} @@ -1653,9 +1653,9 @@ type MockRootCoordClient_GetComponentStates_Call struct { } // GetComponentStates is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.GetComponentStatesRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.GetComponentStatesRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) GetComponentStates(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_GetComponentStates_Call { return &MockRootCoordClient_GetComponentStates_Call{Call: _e.mock.On("GetComponentStates", append([]interface{}{ctx, in}, opts...)...)} @@ -1723,9 +1723,9 @@ type MockRootCoordClient_GetCredential_Call struct { } // GetCredential is a helper method to define mock.On call -// - ctx context.Context -// - in *rootcoordpb.GetCredentialRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *rootcoordpb.GetCredentialRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) GetCredential(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_GetCredential_Call { return &MockRootCoordClient_GetCredential_Call{Call: _e.mock.On("GetCredential", append([]interface{}{ctx, in}, opts...)...)} @@ -1793,9 +1793,9 @@ type MockRootCoordClient_GetMetrics_Call struct { } // GetMetrics is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.GetMetricsRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.GetMetricsRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) GetMetrics(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_GetMetrics_Call { return &MockRootCoordClient_GetMetrics_Call{Call: _e.mock.On("GetMetrics", append([]interface{}{ctx, in}, opts...)...)} @@ -1863,9 +1863,9 @@ type MockRootCoordClient_GetStatisticsChannel_Call struct { } // GetStatisticsChannel is a helper method to define mock.On call -// - ctx context.Context -// - in *internalpb.GetStatisticsChannelRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *internalpb.GetStatisticsChannelRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) GetStatisticsChannel(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_GetStatisticsChannel_Call { return &MockRootCoordClient_GetStatisticsChannel_Call{Call: _e.mock.On("GetStatisticsChannel", append([]interface{}{ctx, in}, opts...)...)} @@ -1933,9 +1933,9 @@ type MockRootCoordClient_GetTimeTickChannel_Call struct { } // GetTimeTickChannel is a helper method to define mock.On call -// - ctx context.Context -// - in *internalpb.GetTimeTickChannelRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *internalpb.GetTimeTickChannelRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) GetTimeTickChannel(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_GetTimeTickChannel_Call { return &MockRootCoordClient_GetTimeTickChannel_Call{Call: _e.mock.On("GetTimeTickChannel", append([]interface{}{ctx, in}, opts...)...)} @@ -1964,6 +1964,76 @@ func (_c *MockRootCoordClient_GetTimeTickChannel_Call) RunAndReturn(run func(con return _c } +// GetVChannels provides a mock function with given fields: ctx, in, opts +func (_m *MockRootCoordClient) GetVChannels(ctx context.Context, in *rootcoordpb.GetVChannelsRequest, opts ...grpc.CallOption) (*rootcoordpb.GetVChannelsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *rootcoordpb.GetVChannelsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *rootcoordpb.GetVChannelsRequest, ...grpc.CallOption) (*rootcoordpb.GetVChannelsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *rootcoordpb.GetVChannelsRequest, ...grpc.CallOption) *rootcoordpb.GetVChannelsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*rootcoordpb.GetVChannelsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *rootcoordpb.GetVChannelsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockRootCoordClient_GetVChannels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVChannels' +type MockRootCoordClient_GetVChannels_Call struct { + *mock.Call +} + +// GetVChannels is a helper method to define mock.On call +// - ctx context.Context +// - in *rootcoordpb.GetVChannelsRequest +// - opts ...grpc.CallOption +func (_e *MockRootCoordClient_Expecter) GetVChannels(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_GetVChannels_Call { + return &MockRootCoordClient_GetVChannels_Call{Call: _e.mock.On("GetVChannels", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockRootCoordClient_GetVChannels_Call) Run(run func(ctx context.Context, in *rootcoordpb.GetVChannelsRequest, opts ...grpc.CallOption)) *MockRootCoordClient_GetVChannels_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*rootcoordpb.GetVChannelsRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockRootCoordClient_GetVChannels_Call) Return(_a0 *rootcoordpb.GetVChannelsResponse, _a1 error) *MockRootCoordClient_GetVChannels_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockRootCoordClient_GetVChannels_Call) RunAndReturn(run func(context.Context, *rootcoordpb.GetVChannelsRequest, ...grpc.CallOption) (*rootcoordpb.GetVChannelsResponse, error)) *MockRootCoordClient_GetVChannels_Call { + _c.Call.Return(run) + return _c +} + // HasCollection provides a mock function with given fields: ctx, in, opts func (_m *MockRootCoordClient) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequest, opts ...grpc.CallOption) (*milvuspb.BoolResponse, error) { _va := make([]interface{}, len(opts)) @@ -2003,9 +2073,9 @@ type MockRootCoordClient_HasCollection_Call struct { } // HasCollection is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.HasCollectionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.HasCollectionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) HasCollection(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_HasCollection_Call { return &MockRootCoordClient_HasCollection_Call{Call: _e.mock.On("HasCollection", append([]interface{}{ctx, in}, opts...)...)} @@ -2073,9 +2143,9 @@ type MockRootCoordClient_HasPartition_Call struct { } // HasPartition is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.HasPartitionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.HasPartitionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) HasPartition(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_HasPartition_Call { return &MockRootCoordClient_HasPartition_Call{Call: _e.mock.On("HasPartition", append([]interface{}{ctx, in}, opts...)...)} @@ -2143,9 +2213,9 @@ type MockRootCoordClient_InvalidateCollectionMetaCache_Call struct { } // InvalidateCollectionMetaCache is a helper method to define mock.On call -// - ctx context.Context -// - in *proxypb.InvalidateCollMetaCacheRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *proxypb.InvalidateCollMetaCacheRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) InvalidateCollectionMetaCache(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_InvalidateCollectionMetaCache_Call { return &MockRootCoordClient_InvalidateCollectionMetaCache_Call{Call: _e.mock.On("InvalidateCollectionMetaCache", append([]interface{}{ctx, in}, opts...)...)} @@ -2213,9 +2283,9 @@ type MockRootCoordClient_ListAliases_Call struct { } // ListAliases is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.ListAliasesRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.ListAliasesRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ListAliases(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ListAliases_Call { return &MockRootCoordClient_ListAliases_Call{Call: _e.mock.On("ListAliases", append([]interface{}{ctx, in}, opts...)...)} @@ -2283,9 +2353,9 @@ type MockRootCoordClient_ListCredUsers_Call struct { } // ListCredUsers is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.ListCredUsersRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.ListCredUsersRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ListCredUsers(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ListCredUsers_Call { return &MockRootCoordClient_ListCredUsers_Call{Call: _e.mock.On("ListCredUsers", append([]interface{}{ctx, in}, opts...)...)} @@ -2353,9 +2423,9 @@ type MockRootCoordClient_ListDatabases_Call struct { } // ListDatabases is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.ListDatabasesRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.ListDatabasesRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ListDatabases(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ListDatabases_Call { return &MockRootCoordClient_ListDatabases_Call{Call: _e.mock.On("ListDatabases", append([]interface{}{ctx, in}, opts...)...)} @@ -2423,9 +2493,9 @@ type MockRootCoordClient_ListPolicy_Call struct { } // ListPolicy is a helper method to define mock.On call -// - ctx context.Context -// - in *internalpb.ListPolicyRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *internalpb.ListPolicyRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ListPolicy(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ListPolicy_Call { return &MockRootCoordClient_ListPolicy_Call{Call: _e.mock.On("ListPolicy", append([]interface{}{ctx, in}, opts...)...)} @@ -2493,9 +2563,9 @@ type MockRootCoordClient_OperatePrivilege_Call struct { } // OperatePrivilege is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.OperatePrivilegeRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.OperatePrivilegeRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) OperatePrivilege(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_OperatePrivilege_Call { return &MockRootCoordClient_OperatePrivilege_Call{Call: _e.mock.On("OperatePrivilege", append([]interface{}{ctx, in}, opts...)...)} @@ -2563,9 +2633,9 @@ type MockRootCoordClient_OperateUserRole_Call struct { } // OperateUserRole is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.OperateUserRoleRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.OperateUserRoleRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) OperateUserRole(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_OperateUserRole_Call { return &MockRootCoordClient_OperateUserRole_Call{Call: _e.mock.On("OperateUserRole", append([]interface{}{ctx, in}, opts...)...)} @@ -2633,9 +2703,9 @@ type MockRootCoordClient_RenameCollection_Call struct { } // RenameCollection is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.RenameCollectionRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.RenameCollectionRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) RenameCollection(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_RenameCollection_Call { return &MockRootCoordClient_RenameCollection_Call{Call: _e.mock.On("RenameCollection", append([]interface{}{ctx, in}, opts...)...)} @@ -2703,9 +2773,9 @@ type MockRootCoordClient_SelectGrant_Call struct { } // SelectGrant is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.SelectGrantRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.SelectGrantRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) SelectGrant(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_SelectGrant_Call { return &MockRootCoordClient_SelectGrant_Call{Call: _e.mock.On("SelectGrant", append([]interface{}{ctx, in}, opts...)...)} @@ -2773,9 +2843,9 @@ type MockRootCoordClient_SelectRole_Call struct { } // SelectRole is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.SelectRoleRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.SelectRoleRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) SelectRole(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_SelectRole_Call { return &MockRootCoordClient_SelectRole_Call{Call: _e.mock.On("SelectRole", append([]interface{}{ctx, in}, opts...)...)} @@ -2843,9 +2913,9 @@ type MockRootCoordClient_SelectUser_Call struct { } // SelectUser is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.SelectUserRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.SelectUserRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) SelectUser(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_SelectUser_Call { return &MockRootCoordClient_SelectUser_Call{Call: _e.mock.On("SelectUser", append([]interface{}{ctx, in}, opts...)...)} @@ -2913,9 +2983,9 @@ type MockRootCoordClient_ShowCollections_Call struct { } // ShowCollections is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.ShowCollectionsRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.ShowCollectionsRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ShowCollections(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ShowCollections_Call { return &MockRootCoordClient_ShowCollections_Call{Call: _e.mock.On("ShowCollections", append([]interface{}{ctx, in}, opts...)...)} @@ -2983,9 +3053,9 @@ type MockRootCoordClient_ShowConfigurations_Call struct { } // ShowConfigurations is a helper method to define mock.On call -// - ctx context.Context -// - in *internalpb.ShowConfigurationsRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *internalpb.ShowConfigurationsRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ShowConfigurations(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ShowConfigurations_Call { return &MockRootCoordClient_ShowConfigurations_Call{Call: _e.mock.On("ShowConfigurations", append([]interface{}{ctx, in}, opts...)...)} @@ -3053,9 +3123,9 @@ type MockRootCoordClient_ShowPartitions_Call struct { } // ShowPartitions is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.ShowPartitionsRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.ShowPartitionsRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ShowPartitions(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ShowPartitions_Call { return &MockRootCoordClient_ShowPartitions_Call{Call: _e.mock.On("ShowPartitions", append([]interface{}{ctx, in}, opts...)...)} @@ -3123,9 +3193,9 @@ type MockRootCoordClient_ShowPartitionsInternal_Call struct { } // ShowPartitionsInternal is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.ShowPartitionsRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.ShowPartitionsRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ShowPartitionsInternal(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ShowPartitionsInternal_Call { return &MockRootCoordClient_ShowPartitionsInternal_Call{Call: _e.mock.On("ShowPartitionsInternal", append([]interface{}{ctx, in}, opts...)...)} @@ -3193,9 +3263,9 @@ type MockRootCoordClient_ShowSegments_Call struct { } // ShowSegments is a helper method to define mock.On call -// - ctx context.Context -// - in *milvuspb.ShowSegmentsRequest -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *milvuspb.ShowSegmentsRequest +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) ShowSegments(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_ShowSegments_Call { return &MockRootCoordClient_ShowSegments_Call{Call: _e.mock.On("ShowSegments", append([]interface{}{ctx, in}, opts...)...)} @@ -3263,9 +3333,9 @@ type MockRootCoordClient_UpdateChannelTimeTick_Call struct { } // UpdateChannelTimeTick is a helper method to define mock.On call -// - ctx context.Context -// - in *internalpb.ChannelTimeTickMsg -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *internalpb.ChannelTimeTickMsg +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) UpdateChannelTimeTick(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_UpdateChannelTimeTick_Call { return &MockRootCoordClient_UpdateChannelTimeTick_Call{Call: _e.mock.On("UpdateChannelTimeTick", append([]interface{}{ctx, in}, opts...)...)} @@ -3333,9 +3403,9 @@ type MockRootCoordClient_UpdateCredential_Call struct { } // UpdateCredential is a helper method to define mock.On call -// - ctx context.Context -// - in *internalpb.CredentialInfo -// - opts ...grpc.CallOption +// - ctx context.Context +// - in *internalpb.CredentialInfo +// - opts ...grpc.CallOption func (_e *MockRootCoordClient_Expecter) UpdateCredential(ctx interface{}, in interface{}, opts ...interface{}) *MockRootCoordClient_UpdateCredential_Call { return &MockRootCoordClient_UpdateCredential_Call{Call: _e.mock.On("UpdateCredential", append([]interface{}{ctx, in}, opts...)...)} diff --git a/internal/proto/root_coord.proto b/internal/proto/root_coord.proto index fb65591f4e..66bafc33bf 100644 --- a/internal/proto/root_coord.proto +++ b/internal/proto/root_coord.proto @@ -95,21 +95,13 @@ service RootCoord { */ rpc ShowPartitions(milvus.ShowPartitionsRequest) returns (milvus.ShowPartitionsResponse) {} rpc ShowPartitionsInternal(milvus.ShowPartitionsRequest) returns (milvus.ShowPartitionsResponse) {} - -// rpc DescribeSegment(milvus.DescribeSegmentRequest) returns (milvus.DescribeSegmentResponse) {} rpc ShowSegments(milvus.ShowSegmentsRequest) returns (milvus.ShowSegmentsResponse) {} -// rpc DescribeSegments(DescribeSegmentsRequest) returns (DescribeSegmentsResponse) {} - -// rpc CreateIndex(milvus.CreateIndexRequest) returns (common.Status) {} -// rpc DescribeIndex(milvus.DescribeIndexRequest) returns (milvus.DescribeIndexResponse) {} -// rpc DropIndex(milvus.DropIndexRequest) returns (common.Status) {} -// rpc GetIndexState(milvus.GetIndexStateRequest) returns (milvus.GetIndexStateResponse) {} + rpc GetVChannels(GetVChannelsRequest) returns (GetVChannelsResponse) {} rpc AllocTimestamp(AllocTimestampRequest) returns (AllocTimestampResponse) {} rpc AllocID(AllocIDRequest) returns (AllocIDResponse) {} rpc UpdateChannelTimeTick(internal.ChannelTimeTickMsg) returns (common.Status) {} rpc InvalidateCollectionMetaCache(proxy.InvalidateCollMetaCacheRequest) returns (common.Status) {} -// rpc SegmentFlushCompleted(data.SegmentFlushCompletedMsg) returns (common.Status) {} rpc ShowConfigurations(internal.ShowConfigurationsRequest) returns (internal.ShowConfigurationsResponse){} // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy @@ -227,3 +219,13 @@ message AlterDatabaseRequest { string db_id = 3; repeated common.KeyValuePair properties = 4; } + +message GetVChannelsRequest { + common.MsgBase base = 1; + string pchannel = 2; +} + +message GetVChannelsResponse { + common.Status status = 1; + repeated string vchannels = 2; +} diff --git a/internal/proxy/rootcoord_mock_test.go b/internal/proxy/rootcoord_mock_test.go index 97f466f2e9..6941e2fbdf 100644 --- a/internal/proxy/rootcoord_mock_test.go +++ b/internal/proxy/rootcoord_mock_test.go @@ -890,6 +890,10 @@ func (coord *RootCoordMock) ShowSegments(ctx context.Context, req *milvuspb.Show }, nil } +func (coord *RootCoordMock) GetVChannels(ctx context.Context, in *rootcoordpb.GetVChannelsRequest, opts ...grpc.CallOption) (*rootcoordpb.GetVChannelsResponse, error) { + panic("implement me") +} + func (coord *RootCoordMock) DescribeSegments(ctx context.Context, req *rootcoordpb.DescribeSegmentsRequest, opts ...grpc.CallOption) (*rootcoordpb.DescribeSegmentsResponse, error) { panic("implement me") } diff --git a/internal/rootcoord/meta_table.go b/internal/rootcoord/meta_table.go index b824cb0658..d19f05dd22 100644 --- a/internal/rootcoord/meta_table.go +++ b/internal/rootcoord/meta_table.go @@ -22,6 +22,7 @@ import ( "sync" "github.com/cockroachdb/errors" + "github.com/samber/lo" "go.uber.org/zap" "golang.org/x/exp/maps" @@ -42,7 +43,7 @@ import ( "github.com/milvus-io/milvus/pkg/util/typeutil" ) -//go:generate mockery --name=IMetaTable --outpkg=mockrootcoord --filename=meta_table.go --with-expecter +//go:generate mockery --name=IMetaTable --structname=MockIMetaTable --output=./ --filename=mock_meta_table.go --with-expecter --inpackage type IMetaTable interface { GetDatabaseByID(ctx context.Context, dbID int64, ts Timestamp) (*model.Database, error) GetDatabaseByName(ctx context.Context, dbName string, ts Timestamp) (*model.Database, error) @@ -61,6 +62,7 @@ type IMetaTable interface { ListAllAvailCollections(ctx context.Context) map[int64][]int64 ListCollectionPhysicalChannels() map[typeutil.UniqueID][]string GetCollectionVirtualChannels(colID int64) []string + GetVChannelsByPchannel(pchannel string) []string AddPartition(ctx context.Context, partition *model.Partition) error ChangePartitionState(ctx context.Context, collectionID UniqueID, partitionID UniqueID, state pb.PartitionState, ts Timestamp) error RemovePartition(ctx context.Context, dbID int64, collectionID UniqueID, partitionID UniqueID, ts Timestamp) error @@ -833,6 +835,19 @@ func (mt *MetaTable) GetCollectionVirtualChannels(colID int64) []string { return nil } +// GetVChannelsByPchannel returns vchannels by the given pchannel. +func (mt *MetaTable) GetVChannelsByPchannel(pchannel string) []string { + mt.ddLock.RLock() + defer mt.ddLock.RUnlock() + res := make([]string, 0) + for _, collInfo := range mt.collID2Meta { + if idx := lo.IndexOf(collInfo.PhysicalChannelNames, pchannel); idx > 0 { + res = append(res, collInfo.VirtualChannelNames[idx]) + } + } + return res +} + func (mt *MetaTable) AddPartition(ctx context.Context, partition *model.Partition) error { mt.ddLock.Lock() defer mt.ddLock.Unlock() diff --git a/internal/rootcoord/mock_test.go b/internal/rootcoord/mock_test.go index e0eb4db1d8..f1581abf42 100644 --- a/internal/rootcoord/mock_test.go +++ b/internal/rootcoord/mock_test.go @@ -56,6 +56,7 @@ const ( TestRootCoordID = 200 ) +// TODO: remove mockMetaTable, use mockery instead type mockMetaTable struct { IMetaTable ListDatabasesFunc func(ctx context.Context, ts Timestamp) ([]*model.Database, error) @@ -190,6 +191,10 @@ func (m mockMetaTable) GetCollectionVirtualChannels(colID int64) []string { return m.GetCollectionVirtualChannelsFunc(colID) } +func (m mockMetaTable) GetVChannelsByPchannel(pchannel string) []string { + panic("unimplemented") +} + func (m mockMetaTable) AddCredential(credInfo *internalpb.CredentialInfo) error { return m.AddCredentialFunc(credInfo) } diff --git a/internal/rootcoord/mocks/meta_table.go b/internal/rootcoord/mocks/meta_table.go index f67bc65c8f..73619b9664 100644 --- a/internal/rootcoord/mocks/meta_table.go +++ b/internal/rootcoord/mocks/meta_table.go @@ -48,8 +48,8 @@ type IMetaTable_AddCollection_Call struct { } // AddCollection is a helper method to define mock.On call -// - ctx context.Context -// - coll *model.Collection +// - ctx context.Context +// - coll *model.Collection func (_e *IMetaTable_Expecter) AddCollection(ctx interface{}, coll interface{}) *IMetaTable_AddCollection_Call { return &IMetaTable_AddCollection_Call{Call: _e.mock.On("AddCollection", ctx, coll)} } @@ -91,7 +91,7 @@ type IMetaTable_AddCredential_Call struct { } // AddCredential is a helper method to define mock.On call -// - credInfo *internalpb.CredentialInfo +// - credInfo *internalpb.CredentialInfo func (_e *IMetaTable_Expecter) AddCredential(credInfo interface{}) *IMetaTable_AddCredential_Call { return &IMetaTable_AddCredential_Call{Call: _e.mock.On("AddCredential", credInfo)} } @@ -133,8 +133,8 @@ type IMetaTable_AddPartition_Call struct { } // AddPartition is a helper method to define mock.On call -// - ctx context.Context -// - partition *model.Partition +// - ctx context.Context +// - partition *model.Partition func (_e *IMetaTable_Expecter) AddPartition(ctx interface{}, partition interface{}) *IMetaTable_AddPartition_Call { return &IMetaTable_AddPartition_Call{Call: _e.mock.On("AddPartition", ctx, partition)} } @@ -176,11 +176,11 @@ type IMetaTable_AlterAlias_Call struct { } // AlterAlias is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - alias string -// - collectionName string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - alias string +// - collectionName string +// - ts uint64 func (_e *IMetaTable_Expecter) AlterAlias(ctx interface{}, dbName interface{}, alias interface{}, collectionName interface{}, ts interface{}) *IMetaTable_AlterAlias_Call { return &IMetaTable_AlterAlias_Call{Call: _e.mock.On("AlterAlias", ctx, dbName, alias, collectionName, ts)} } @@ -222,10 +222,10 @@ type IMetaTable_AlterCollection_Call struct { } // AlterCollection is a helper method to define mock.On call -// - ctx context.Context -// - oldColl *model.Collection -// - newColl *model.Collection -// - ts uint64 +// - ctx context.Context +// - oldColl *model.Collection +// - newColl *model.Collection +// - ts uint64 func (_e *IMetaTable_Expecter) AlterCollection(ctx interface{}, oldColl interface{}, newColl interface{}, ts interface{}) *IMetaTable_AlterCollection_Call { return &IMetaTable_AlterCollection_Call{Call: _e.mock.On("AlterCollection", ctx, oldColl, newColl, ts)} } @@ -267,7 +267,7 @@ type IMetaTable_AlterCredential_Call struct { } // AlterCredential is a helper method to define mock.On call -// - credInfo *internalpb.CredentialInfo +// - credInfo *internalpb.CredentialInfo func (_e *IMetaTable_Expecter) AlterCredential(credInfo interface{}) *IMetaTable_AlterCredential_Call { return &IMetaTable_AlterCredential_Call{Call: _e.mock.On("AlterCredential", credInfo)} } @@ -309,10 +309,10 @@ type IMetaTable_AlterDatabase_Call struct { } // AlterDatabase is a helper method to define mock.On call -// - ctx context.Context -// - oldDB *model.Database -// - newDB *model.Database -// - ts uint64 +// - ctx context.Context +// - oldDB *model.Database +// - newDB *model.Database +// - ts uint64 func (_e *IMetaTable_Expecter) AlterDatabase(ctx interface{}, oldDB interface{}, newDB interface{}, ts interface{}) *IMetaTable_AlterDatabase_Call { return &IMetaTable_AlterDatabase_Call{Call: _e.mock.On("AlterDatabase", ctx, oldDB, newDB, ts)} } @@ -354,10 +354,10 @@ type IMetaTable_ChangeCollectionState_Call struct { } // ChangeCollectionState is a helper method to define mock.On call -// - ctx context.Context -// - collectionID int64 -// - state etcdpb.CollectionState -// - ts uint64 +// - ctx context.Context +// - collectionID int64 +// - state etcdpb.CollectionState +// - ts uint64 func (_e *IMetaTable_Expecter) ChangeCollectionState(ctx interface{}, collectionID interface{}, state interface{}, ts interface{}) *IMetaTable_ChangeCollectionState_Call { return &IMetaTable_ChangeCollectionState_Call{Call: _e.mock.On("ChangeCollectionState", ctx, collectionID, state, ts)} } @@ -399,11 +399,11 @@ type IMetaTable_ChangePartitionState_Call struct { } // ChangePartitionState is a helper method to define mock.On call -// - ctx context.Context -// - collectionID int64 -// - partitionID int64 -// - state etcdpb.PartitionState -// - ts uint64 +// - ctx context.Context +// - collectionID int64 +// - partitionID int64 +// - state etcdpb.PartitionState +// - ts uint64 func (_e *IMetaTable_Expecter) ChangePartitionState(ctx interface{}, collectionID interface{}, partitionID interface{}, state interface{}, ts interface{}) *IMetaTable_ChangePartitionState_Call { return &IMetaTable_ChangePartitionState_Call{Call: _e.mock.On("ChangePartitionState", ctx, collectionID, partitionID, state, ts)} } @@ -445,11 +445,11 @@ type IMetaTable_CreateAlias_Call struct { } // CreateAlias is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - alias string -// - collectionName string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - alias string +// - collectionName string +// - ts uint64 func (_e *IMetaTable_Expecter) CreateAlias(ctx interface{}, dbName interface{}, alias interface{}, collectionName interface{}, ts interface{}) *IMetaTable_CreateAlias_Call { return &IMetaTable_CreateAlias_Call{Call: _e.mock.On("CreateAlias", ctx, dbName, alias, collectionName, ts)} } @@ -491,9 +491,9 @@ type IMetaTable_CreateDatabase_Call struct { } // CreateDatabase is a helper method to define mock.On call -// - ctx context.Context -// - db *model.Database -// - ts uint64 +// - ctx context.Context +// - db *model.Database +// - ts uint64 func (_e *IMetaTable_Expecter) CreateDatabase(ctx interface{}, db interface{}, ts interface{}) *IMetaTable_CreateDatabase_Call { return &IMetaTable_CreateDatabase_Call{Call: _e.mock.On("CreateDatabase", ctx, db, ts)} } @@ -535,8 +535,8 @@ type IMetaTable_CreateRole_Call struct { } // CreateRole is a helper method to define mock.On call -// - tenant string -// - entity *milvuspb.RoleEntity +// - tenant string +// - entity *milvuspb.RoleEntity func (_e *IMetaTable_Expecter) CreateRole(tenant interface{}, entity interface{}) *IMetaTable_CreateRole_Call { return &IMetaTable_CreateRole_Call{Call: _e.mock.On("CreateRole", tenant, entity)} } @@ -578,7 +578,7 @@ type IMetaTable_DeleteCredential_Call struct { } // DeleteCredential is a helper method to define mock.On call -// - username string +// - username string func (_e *IMetaTable_Expecter) DeleteCredential(username interface{}) *IMetaTable_DeleteCredential_Call { return &IMetaTable_DeleteCredential_Call{Call: _e.mock.On("DeleteCredential", username)} } @@ -630,10 +630,10 @@ type IMetaTable_DescribeAlias_Call struct { } // DescribeAlias is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - alias string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - alias string +// - ts uint64 func (_e *IMetaTable_Expecter) DescribeAlias(ctx interface{}, dbName interface{}, alias interface{}, ts interface{}) *IMetaTable_DescribeAlias_Call { return &IMetaTable_DescribeAlias_Call{Call: _e.mock.On("DescribeAlias", ctx, dbName, alias, ts)} } @@ -675,10 +675,10 @@ type IMetaTable_DropAlias_Call struct { } // DropAlias is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - alias string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - alias string +// - ts uint64 func (_e *IMetaTable_Expecter) DropAlias(ctx interface{}, dbName interface{}, alias interface{}, ts interface{}) *IMetaTable_DropAlias_Call { return &IMetaTable_DropAlias_Call{Call: _e.mock.On("DropAlias", ctx, dbName, alias, ts)} } @@ -720,9 +720,9 @@ type IMetaTable_DropDatabase_Call struct { } // DropDatabase is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - ts uint64 func (_e *IMetaTable_Expecter) DropDatabase(ctx interface{}, dbName interface{}, ts interface{}) *IMetaTable_DropDatabase_Call { return &IMetaTable_DropDatabase_Call{Call: _e.mock.On("DropDatabase", ctx, dbName, ts)} } @@ -764,8 +764,8 @@ type IMetaTable_DropGrant_Call struct { } // DropGrant is a helper method to define mock.On call -// - tenant string -// - role *milvuspb.RoleEntity +// - tenant string +// - role *milvuspb.RoleEntity func (_e *IMetaTable_Expecter) DropGrant(tenant interface{}, role interface{}) *IMetaTable_DropGrant_Call { return &IMetaTable_DropGrant_Call{Call: _e.mock.On("DropGrant", tenant, role)} } @@ -807,8 +807,8 @@ type IMetaTable_DropRole_Call struct { } // DropRole is a helper method to define mock.On call -// - tenant string -// - roleName string +// - tenant string +// - roleName string func (_e *IMetaTable_Expecter) DropRole(tenant interface{}, roleName interface{}) *IMetaTable_DropRole_Call { return &IMetaTable_DropRole_Call{Call: _e.mock.On("DropRole", tenant, roleName)} } @@ -862,11 +862,11 @@ type IMetaTable_GetCollectionByID_Call struct { } // GetCollectionByID is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - collectionID int64 -// - ts uint64 -// - allowUnavailable bool +// - ctx context.Context +// - dbName string +// - collectionID int64 +// - ts uint64 +// - allowUnavailable bool func (_e *IMetaTable_Expecter) GetCollectionByID(ctx interface{}, dbName interface{}, collectionID interface{}, ts interface{}, allowUnavailable interface{}) *IMetaTable_GetCollectionByID_Call { return &IMetaTable_GetCollectionByID_Call{Call: _e.mock.On("GetCollectionByID", ctx, dbName, collectionID, ts, allowUnavailable)} } @@ -920,8 +920,8 @@ type IMetaTable_GetCollectionByIDWithMaxTs_Call struct { } // GetCollectionByIDWithMaxTs is a helper method to define mock.On call -// - ctx context.Context -// - collectionID int64 +// - ctx context.Context +// - collectionID int64 func (_e *IMetaTable_Expecter) GetCollectionByIDWithMaxTs(ctx interface{}, collectionID interface{}) *IMetaTable_GetCollectionByIDWithMaxTs_Call { return &IMetaTable_GetCollectionByIDWithMaxTs_Call{Call: _e.mock.On("GetCollectionByIDWithMaxTs", ctx, collectionID)} } @@ -975,10 +975,10 @@ type IMetaTable_GetCollectionByName_Call struct { } // GetCollectionByName is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - collectionName string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - collectionName string +// - ts uint64 func (_e *IMetaTable_Expecter) GetCollectionByName(ctx interface{}, dbName interface{}, collectionName interface{}, ts interface{}) *IMetaTable_GetCollectionByName_Call { return &IMetaTable_GetCollectionByName_Call{Call: _e.mock.On("GetCollectionByName", ctx, dbName, collectionName, ts)} } @@ -1022,7 +1022,7 @@ type IMetaTable_GetCollectionVirtualChannels_Call struct { } // GetCollectionVirtualChannels is a helper method to define mock.On call -// - colID int64 +// - colID int64 func (_e *IMetaTable_Expecter) GetCollectionVirtualChannels(colID interface{}) *IMetaTable_GetCollectionVirtualChannels_Call { return &IMetaTable_GetCollectionVirtualChannels_Call{Call: _e.mock.On("GetCollectionVirtualChannels", colID)} } @@ -1076,7 +1076,7 @@ type IMetaTable_GetCredential_Call struct { } // GetCredential is a helper method to define mock.On call -// - username string +// - username string func (_e *IMetaTable_Expecter) GetCredential(username interface{}) *IMetaTable_GetCredential_Call { return &IMetaTable_GetCredential_Call{Call: _e.mock.On("GetCredential", username)} } @@ -1130,9 +1130,9 @@ type IMetaTable_GetDatabaseByID_Call struct { } // GetDatabaseByID is a helper method to define mock.On call -// - ctx context.Context -// - dbID int64 -// - ts uint64 +// - ctx context.Context +// - dbID int64 +// - ts uint64 func (_e *IMetaTable_Expecter) GetDatabaseByID(ctx interface{}, dbID interface{}, ts interface{}) *IMetaTable_GetDatabaseByID_Call { return &IMetaTable_GetDatabaseByID_Call{Call: _e.mock.On("GetDatabaseByID", ctx, dbID, ts)} } @@ -1186,9 +1186,9 @@ type IMetaTable_GetDatabaseByName_Call struct { } // GetDatabaseByName is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - ts uint64 func (_e *IMetaTable_Expecter) GetDatabaseByName(ctx interface{}, dbName interface{}, ts interface{}) *IMetaTable_GetDatabaseByName_Call { return &IMetaTable_GetDatabaseByName_Call{Call: _e.mock.On("GetDatabaseByName", ctx, dbName, ts)} } @@ -1210,6 +1210,50 @@ func (_c *IMetaTable_GetDatabaseByName_Call) RunAndReturn(run func(context.Conte return _c } +// GetVChannelsByPchannel provides a mock function with given fields: pchannel +func (_m *IMetaTable) GetVChannelsByPchannel(pchannel string) []string { + ret := _m.Called(pchannel) + + var r0 []string + if rf, ok := ret.Get(0).(func(string) []string); ok { + r0 = rf(pchannel) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// IMetaTable_GetVChannelsByPchannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVChannelsByPchannel' +type IMetaTable_GetVChannelsByPchannel_Call struct { + *mock.Call +} + +// GetVChannelsByPchannel is a helper method to define mock.On call +// - pchannel string +func (_e *IMetaTable_Expecter) GetVChannelsByPchannel(pchannel interface{}) *IMetaTable_GetVChannelsByPchannel_Call { + return &IMetaTable_GetVChannelsByPchannel_Call{Call: _e.mock.On("GetVChannelsByPchannel", pchannel)} +} + +func (_c *IMetaTable_GetVChannelsByPchannel_Call) Run(run func(pchannel string)) *IMetaTable_GetVChannelsByPchannel_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *IMetaTable_GetVChannelsByPchannel_Call) Return(_a0 []string) *IMetaTable_GetVChannelsByPchannel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *IMetaTable_GetVChannelsByPchannel_Call) RunAndReturn(run func(string) []string) *IMetaTable_GetVChannelsByPchannel_Call { + _c.Call.Return(run) + return _c +} + // IsAlias provides a mock function with given fields: db, name func (_m *IMetaTable) IsAlias(db string, name string) bool { ret := _m.Called(db, name) @@ -1230,8 +1274,8 @@ type IMetaTable_IsAlias_Call struct { } // IsAlias is a helper method to define mock.On call -// - db string -// - name string +// - db string +// - name string func (_e *IMetaTable_Expecter) IsAlias(db interface{}, name interface{}) *IMetaTable_IsAlias_Call { return &IMetaTable_IsAlias_Call{Call: _e.mock.On("IsAlias", db, name)} } @@ -1285,10 +1329,10 @@ type IMetaTable_ListAliases_Call struct { } // ListAliases is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - collectionName string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - collectionName string +// - ts uint64 func (_e *IMetaTable_Expecter) ListAliases(ctx interface{}, dbName interface{}, collectionName interface{}, ts interface{}) *IMetaTable_ListAliases_Call { return &IMetaTable_ListAliases_Call{Call: _e.mock.On("ListAliases", ctx, dbName, collectionName, ts)} } @@ -1332,7 +1376,7 @@ type IMetaTable_ListAliasesByID_Call struct { } // ListAliasesByID is a helper method to define mock.On call -// - collID int64 +// - collID int64 func (_e *IMetaTable_Expecter) ListAliasesByID(collID interface{}) *IMetaTable_ListAliasesByID_Call { return &IMetaTable_ListAliasesByID_Call{Call: _e.mock.On("ListAliasesByID", collID)} } @@ -1376,7 +1420,7 @@ type IMetaTable_ListAllAvailCollections_Call struct { } // ListAllAvailCollections is a helper method to define mock.On call -// - ctx context.Context +// - ctx context.Context func (_e *IMetaTable_Expecter) ListAllAvailCollections(ctx interface{}) *IMetaTable_ListAllAvailCollections_Call { return &IMetaTable_ListAllAvailCollections_Call{Call: _e.mock.On("ListAllAvailCollections", ctx)} } @@ -1473,10 +1517,10 @@ type IMetaTable_ListCollections_Call struct { } // ListCollections is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - ts uint64 -// - onlyAvail bool +// - ctx context.Context +// - dbName string +// - ts uint64 +// - onlyAvail bool func (_e *IMetaTable_Expecter) ListCollections(ctx interface{}, dbName interface{}, ts interface{}, onlyAvail interface{}) *IMetaTable_ListCollections_Call { return &IMetaTable_ListCollections_Call{Call: _e.mock.On("ListCollections", ctx, dbName, ts, onlyAvail)} } @@ -1583,8 +1627,8 @@ type IMetaTable_ListDatabases_Call struct { } // ListDatabases is a helper method to define mock.On call -// - ctx context.Context -// - ts uint64 +// - ctx context.Context +// - ts uint64 func (_e *IMetaTable_Expecter) ListDatabases(ctx interface{}, ts interface{}) *IMetaTable_ListDatabases_Call { return &IMetaTable_ListDatabases_Call{Call: _e.mock.On("ListDatabases", ctx, ts)} } @@ -1638,7 +1682,7 @@ type IMetaTable_ListPolicy_Call struct { } // ListPolicy is a helper method to define mock.On call -// - tenant string +// - tenant string func (_e *IMetaTable_Expecter) ListPolicy(tenant interface{}) *IMetaTable_ListPolicy_Call { return &IMetaTable_ListPolicy_Call{Call: _e.mock.On("ListPolicy", tenant)} } @@ -1692,7 +1736,7 @@ type IMetaTable_ListUserRole_Call struct { } // ListUserRole is a helper method to define mock.On call -// - tenant string +// - tenant string func (_e *IMetaTable_Expecter) ListUserRole(tenant interface{}) *IMetaTable_ListUserRole_Call { return &IMetaTable_ListUserRole_Call{Call: _e.mock.On("ListUserRole", tenant)} } @@ -1734,9 +1778,9 @@ type IMetaTable_OperatePrivilege_Call struct { } // OperatePrivilege is a helper method to define mock.On call -// - tenant string -// - entity *milvuspb.GrantEntity -// - operateType milvuspb.OperatePrivilegeType +// - tenant string +// - entity *milvuspb.GrantEntity +// - operateType milvuspb.OperatePrivilegeType func (_e *IMetaTable_Expecter) OperatePrivilege(tenant interface{}, entity interface{}, operateType interface{}) *IMetaTable_OperatePrivilege_Call { return &IMetaTable_OperatePrivilege_Call{Call: _e.mock.On("OperatePrivilege", tenant, entity, operateType)} } @@ -1778,10 +1822,10 @@ type IMetaTable_OperateUserRole_Call struct { } // OperateUserRole is a helper method to define mock.On call -// - tenant string -// - userEntity *milvuspb.UserEntity -// - roleEntity *milvuspb.RoleEntity -// - operateType milvuspb.OperateUserRoleType +// - tenant string +// - userEntity *milvuspb.UserEntity +// - roleEntity *milvuspb.RoleEntity +// - operateType milvuspb.OperateUserRoleType func (_e *IMetaTable_Expecter) OperateUserRole(tenant interface{}, userEntity interface{}, roleEntity interface{}, operateType interface{}) *IMetaTable_OperateUserRole_Call { return &IMetaTable_OperateUserRole_Call{Call: _e.mock.On("OperateUserRole", tenant, userEntity, roleEntity, operateType)} } @@ -1823,9 +1867,9 @@ type IMetaTable_RemoveCollection_Call struct { } // RemoveCollection is a helper method to define mock.On call -// - ctx context.Context -// - collectionID int64 -// - ts uint64 +// - ctx context.Context +// - collectionID int64 +// - ts uint64 func (_e *IMetaTable_Expecter) RemoveCollection(ctx interface{}, collectionID interface{}, ts interface{}) *IMetaTable_RemoveCollection_Call { return &IMetaTable_RemoveCollection_Call{Call: _e.mock.On("RemoveCollection", ctx, collectionID, ts)} } @@ -1867,11 +1911,11 @@ type IMetaTable_RemovePartition_Call struct { } // RemovePartition is a helper method to define mock.On call -// - ctx context.Context -// - dbID int64 -// - collectionID int64 -// - partitionID int64 -// - ts uint64 +// - ctx context.Context +// - dbID int64 +// - collectionID int64 +// - partitionID int64 +// - ts uint64 func (_e *IMetaTable_Expecter) RemovePartition(ctx interface{}, dbID interface{}, collectionID interface{}, partitionID interface{}, ts interface{}) *IMetaTable_RemovePartition_Call { return &IMetaTable_RemovePartition_Call{Call: _e.mock.On("RemovePartition", ctx, dbID, collectionID, partitionID, ts)} } @@ -1913,12 +1957,12 @@ type IMetaTable_RenameCollection_Call struct { } // RenameCollection is a helper method to define mock.On call -// - ctx context.Context -// - dbName string -// - oldName string -// - newDBName string -// - newName string -// - ts uint64 +// - ctx context.Context +// - dbName string +// - oldName string +// - newDBName string +// - newName string +// - ts uint64 func (_e *IMetaTable_Expecter) RenameCollection(ctx interface{}, dbName interface{}, oldName interface{}, newDBName interface{}, newName interface{}, ts interface{}) *IMetaTable_RenameCollection_Call { return &IMetaTable_RenameCollection_Call{Call: _e.mock.On("RenameCollection", ctx, dbName, oldName, newDBName, newName, ts)} } @@ -1972,8 +2016,8 @@ type IMetaTable_SelectGrant_Call struct { } // SelectGrant is a helper method to define mock.On call -// - tenant string -// - entity *milvuspb.GrantEntity +// - tenant string +// - entity *milvuspb.GrantEntity func (_e *IMetaTable_Expecter) SelectGrant(tenant interface{}, entity interface{}) *IMetaTable_SelectGrant_Call { return &IMetaTable_SelectGrant_Call{Call: _e.mock.On("SelectGrant", tenant, entity)} } @@ -2027,9 +2071,9 @@ type IMetaTable_SelectRole_Call struct { } // SelectRole is a helper method to define mock.On call -// - tenant string -// - entity *milvuspb.RoleEntity -// - includeUserInfo bool +// - tenant string +// - entity *milvuspb.RoleEntity +// - includeUserInfo bool func (_e *IMetaTable_Expecter) SelectRole(tenant interface{}, entity interface{}, includeUserInfo interface{}) *IMetaTable_SelectRole_Call { return &IMetaTable_SelectRole_Call{Call: _e.mock.On("SelectRole", tenant, entity, includeUserInfo)} } @@ -2083,9 +2127,9 @@ type IMetaTable_SelectUser_Call struct { } // SelectUser is a helper method to define mock.On call -// - tenant string -// - entity *milvuspb.UserEntity -// - includeRoleInfo bool +// - tenant string +// - entity *milvuspb.UserEntity +// - includeRoleInfo bool func (_e *IMetaTable_Expecter) SelectUser(tenant interface{}, entity interface{}, includeRoleInfo interface{}) *IMetaTable_SelectUser_Call { return &IMetaTable_SelectUser_Call{Call: _e.mock.On("SelectUser", tenant, entity, includeRoleInfo)} } diff --git a/internal/rootcoord/root_coord.go b/internal/rootcoord/root_coord.go index 8198a2a3d5..891396b2eb 100644 --- a/internal/rootcoord/root_coord.go +++ b/internal/rootcoord/root_coord.go @@ -1568,6 +1568,22 @@ func (c *Core) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentsReques return &milvuspb.ShowSegmentsResponse{Status: merr.Success()}, nil } +// GetVChannels returns all vchannels belonging to the pchannel. +func (c *Core) GetVChannels(ctx context.Context, in *rootcoordpb.GetVChannelsRequest) (*rootcoordpb.GetVChannelsResponse, error) { + if err := merr.CheckHealthy(c.GetStateCode()); err != nil { + return &rootcoordpb.GetVChannelsResponse{ + Status: merr.Status(err), + }, nil + } + + resp := &rootcoordpb.GetVChannelsResponse{ + Status: merr.Success(), + } + vchannels := c.meta.GetVChannelsByPchannel(in.GetPchannel()) + resp.Vchannels = vchannels + return resp, nil +} + // AllocTimestamp alloc timestamp func (c *Core) AllocTimestamp(ctx context.Context, in *rootcoordpb.AllocTimestampRequest) (*rootcoordpb.AllocTimestampResponse, error) { if err := merr.CheckHealthy(c.GetStateCode()); err != nil { diff --git a/internal/streamingnode/server/resource/resource.go b/internal/streamingnode/server/resource/resource.go index 0b964312d4..ed72fbeaba 100644 --- a/internal/streamingnode/server/resource/resource.go +++ b/internal/streamingnode/server/resource/resource.go @@ -28,6 +28,13 @@ func OptRootCoordClient(rootCoordClient types.RootCoordClient) optResourceInit { } } +// OptDataCoordClient provides the data coordinator client to the resource. +func OptDataCoordClient(dataCoordClient types.DataCoordClient) optResourceInit { + return func(r *resourceImpl) { + r.dataCoordClient = dataCoordClient + } +} + // Init initializes the singleton of resources. // Should be call when streaming node startup. func Init(opts ...optResourceInit) { @@ -55,6 +62,7 @@ type resourceImpl struct { idAllocator idalloc.Allocator etcdClient *clientv3.Client rootCoordClient types.RootCoordClient + dataCoordClient types.DataCoordClient } // TSOAllocator returns the timestamp allocator to allocate timestamp. @@ -77,6 +85,11 @@ func (r *resourceImpl) RootCoordClient() types.RootCoordClient { return r.rootCoordClient } +// DataCoordClient returns the data coordinator client. +func (r *resourceImpl) DataCoordClient() types.DataCoordClient { + return r.dataCoordClient +} + // assertNotNil panics if the resource is nil. func assertNotNil(v interface{}) { iv := reflect.ValueOf(v) diff --git a/internal/streamingnode/server/walmanager/wal_lifetime.go b/internal/streamingnode/server/walmanager/wal_lifetime.go index ee1a6f145c..96aa7b0301 100644 --- a/internal/streamingnode/server/walmanager/wal_lifetime.go +++ b/internal/streamingnode/server/walmanager/wal_lifetime.go @@ -129,6 +129,7 @@ func (w *walLifetime) doLifetimeChanged(expectedState expectedWALState) { // term must be increasing or available -> unavailable, close current term wal is always applied. term := currentState.Term() if oldWAL := currentState.GetWAL(); oldWAL != nil { + // TODO: flusher.Close() oldWAL.Close() logger.Info("close current term wal done") // Push term to current state unavailable and open a new wal. @@ -148,6 +149,7 @@ func (w *walLifetime) doLifetimeChanged(expectedState expectedWALState) { l, err := w.opener.Open(expectedState.Context(), &wal.OpenOption{ Channel: expectedState.GetPChannelInfo(), }) + // TODO: flusher.Open() if err != nil { logger.Warn("open new wal fail", zap.Error(err)) // Open new wal at expected term failed, push expected term to current state unavailable. diff --git a/internal/util/mock/grpc_rootcoord_client.go b/internal/util/mock/grpc_rootcoord_client.go index 097303b651..fe0c8f630a 100644 --- a/internal/util/mock/grpc_rootcoord_client.go +++ b/internal/util/mock/grpc_rootcoord_client.go @@ -186,6 +186,10 @@ func (m *GrpcRootCoordClient) ShowSegments(ctx context.Context, in *milvuspb.Sho return &milvuspb.ShowSegmentsResponse{}, m.Err } +func (m *GrpcRootCoordClient) GetVChannels(ctx context.Context, in *rootcoordpb.GetVChannelsRequest, opts ...grpc.CallOption) (*rootcoordpb.GetVChannelsResponse, error) { + return &rootcoordpb.GetVChannelsResponse{}, m.Err +} + func (m *GrpcRootCoordClient) DescribeSegments(ctx context.Context, in *rootcoordpb.DescribeSegmentsRequest, opts ...grpc.CallOption) (*rootcoordpb.DescribeSegmentsResponse, error) { return &rootcoordpb.DescribeSegmentsResponse{}, m.Err }