grpc_querynode_client.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // Licensed to the LF AI & Data foundation under one
  2. // or more contributor license agreements. See the NOTICE file
  3. // distributed with this work for additional information
  4. // regarding copyright ownership. The ASF licenses this file
  5. // to you under the Apache License, Version 2.0 (the
  6. // "License"); you may not use this file except in compliance
  7. // with the License. You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. package mock
  17. import (
  18. "context"
  19. "google.golang.org/grpc"
  20. "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
  21. "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
  22. "github.com/milvus-io/milvus/internal/proto/internalpb"
  23. "github.com/milvus-io/milvus/internal/proto/querypb"
  24. "github.com/milvus-io/milvus/internal/util/streamrpc"
  25. )
  26. var _ querypb.QueryNodeClient = &GrpcQueryNodeClient{}
  27. type GrpcQueryNodeClient struct {
  28. Err error
  29. }
  30. func (m *GrpcQueryNodeClient) GetStatistics(ctx context.Context, in *querypb.GetStatisticsRequest, opts ...grpc.CallOption) (*internalpb.GetStatisticsResponse, error) {
  31. return &internalpb.GetStatisticsResponse{}, m.Err
  32. }
  33. func (m *GrpcQueryNodeClient) GetComponentStates(ctx context.Context, in *milvuspb.GetComponentStatesRequest, opts ...grpc.CallOption) (*milvuspb.ComponentStates, error) {
  34. return &milvuspb.ComponentStates{}, m.Err
  35. }
  36. func (m *GrpcQueryNodeClient) GetTimeTickChannel(ctx context.Context, in *internalpb.GetTimeTickChannelRequest, opts ...grpc.CallOption) (*milvuspb.StringResponse, error) {
  37. return &milvuspb.StringResponse{}, m.Err
  38. }
  39. func (m *GrpcQueryNodeClient) GetStatisticsChannel(ctx context.Context, in *internalpb.GetStatisticsChannelRequest, opts ...grpc.CallOption) (*milvuspb.StringResponse, error) {
  40. return &milvuspb.StringResponse{}, m.Err
  41. }
  42. func (m *GrpcQueryNodeClient) WatchDmChannels(ctx context.Context, in *querypb.WatchDmChannelsRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  43. return &commonpb.Status{}, m.Err
  44. }
  45. func (m *GrpcQueryNodeClient) LoadSegments(ctx context.Context, in *querypb.LoadSegmentsRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  46. return &commonpb.Status{}, m.Err
  47. }
  48. func (m *GrpcQueryNodeClient) ReleaseCollection(ctx context.Context, in *querypb.ReleaseCollectionRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  49. return &commonpb.Status{}, m.Err
  50. }
  51. func (m *GrpcQueryNodeClient) LoadPartitions(ctx context.Context, req *querypb.LoadPartitionsRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  52. return &commonpb.Status{}, m.Err
  53. }
  54. func (m *GrpcQueryNodeClient) ReleasePartitions(ctx context.Context, in *querypb.ReleasePartitionsRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  55. return &commonpb.Status{}, m.Err
  56. }
  57. func (m *GrpcQueryNodeClient) ReleaseSegments(ctx context.Context, in *querypb.ReleaseSegmentsRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  58. return &commonpb.Status{}, m.Err
  59. }
  60. func (m *GrpcQueryNodeClient) GetSegmentInfo(ctx context.Context, in *querypb.GetSegmentInfoRequest, opts ...grpc.CallOption) (*querypb.GetSegmentInfoResponse, error) {
  61. return &querypb.GetSegmentInfoResponse{}, m.Err
  62. }
  63. func (m *GrpcQueryNodeClient) Search(ctx context.Context, in *querypb.SearchRequest, opts ...grpc.CallOption) (*internalpb.SearchResults, error) {
  64. return &internalpb.SearchResults{}, m.Err
  65. }
  66. func (m *GrpcQueryNodeClient) SearchSegments(ctx context.Context, in *querypb.SearchRequest, opts ...grpc.CallOption) (*internalpb.SearchResults, error) {
  67. return &internalpb.SearchResults{}, m.Err
  68. }
  69. func (m *GrpcQueryNodeClient) Query(ctx context.Context, in *querypb.QueryRequest, opts ...grpc.CallOption) (*internalpb.RetrieveResults, error) {
  70. return &internalpb.RetrieveResults{}, m.Err
  71. }
  72. func (m *GrpcQueryNodeClient) QueryStream(ctx context.Context, in *querypb.QueryRequest, opts ...grpc.CallOption) (querypb.QueryNode_QueryStreamClient, error) {
  73. return &streamrpc.LocalQueryClient{}, m.Err
  74. }
  75. func (m *GrpcQueryNodeClient) QuerySegments(ctx context.Context, in *querypb.QueryRequest, opts ...grpc.CallOption) (*internalpb.RetrieveResults, error) {
  76. return &internalpb.RetrieveResults{}, m.Err
  77. }
  78. func (m *GrpcQueryNodeClient) QueryStreamSegments(ctx context.Context, in *querypb.QueryRequest, opts ...grpc.CallOption) (querypb.QueryNode_QueryStreamSegmentsClient, error) {
  79. return &streamrpc.LocalQueryClient{}, m.Err
  80. }
  81. func (m *GrpcQueryNodeClient) SyncReplicaSegments(ctx context.Context, in *querypb.SyncReplicaSegmentsRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  82. return &commonpb.Status{}, m.Err
  83. }
  84. func (m *GrpcQueryNodeClient) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest, opts ...grpc.CallOption) (*milvuspb.GetMetricsResponse, error) {
  85. return &milvuspb.GetMetricsResponse{}, m.Err
  86. }
  87. func (m *GrpcQueryNodeClient) ShowConfigurations(ctx context.Context, in *internalpb.ShowConfigurationsRequest, opts ...grpc.CallOption) (*internalpb.ShowConfigurationsResponse, error) {
  88. return &internalpb.ShowConfigurationsResponse{}, m.Err
  89. }
  90. func (m *GrpcQueryNodeClient) GetDataDistribution(ctx context.Context, in *querypb.GetDataDistributionRequest, opts ...grpc.CallOption) (*querypb.GetDataDistributionResponse, error) {
  91. return &querypb.GetDataDistributionResponse{}, m.Err
  92. }
  93. func (m *GrpcQueryNodeClient) SyncDistribution(ctx context.Context, in *querypb.SyncDistributionRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  94. return &commonpb.Status{}, m.Err
  95. }
  96. func (m *GrpcQueryNodeClient) UnsubDmChannel(ctx context.Context, req *querypb.UnsubDmChannelRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  97. return &commonpb.Status{}, m.Err
  98. }
  99. func (m *GrpcQueryNodeClient) Delete(ctx context.Context, in *querypb.DeleteRequest, opts ...grpc.CallOption) (*commonpb.Status, error) {
  100. return &commonpb.Status{}, m.Err
  101. }
  102. func (m *GrpcQueryNodeClient) Close() error {
  103. return m.Err
  104. }