milvus/internal/datacoord/mock_cluster.go
2024-05-07 15:49:30 +08:00

612 lines
18 KiB
Go

// Code generated by mockery v2.32.4. DO NOT EDIT.
package datacoord
import (
context "context"
datapb "github.com/milvus-io/milvus/internal/proto/datapb"
mock "github.com/stretchr/testify/mock"
)
// MockCluster is an autogenerated mock type for the Cluster type
type MockCluster struct {
mock.Mock
}
type MockCluster_Expecter struct {
mock *mock.Mock
}
func (_m *MockCluster) EXPECT() *MockCluster_Expecter {
return &MockCluster_Expecter{mock: &_m.Mock}
}
// Close provides a mock function with given fields:
func (_m *MockCluster) Close() {
_m.Called()
}
// MockCluster_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type MockCluster_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
func (_e *MockCluster_Expecter) Close() *MockCluster_Close_Call {
return &MockCluster_Close_Call{Call: _e.mock.On("Close")}
}
func (_c *MockCluster_Close_Call) Run(run func()) *MockCluster_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockCluster_Close_Call) Return() *MockCluster_Close_Call {
_c.Call.Return()
return _c
}
func (_c *MockCluster_Close_Call) RunAndReturn(run func()) *MockCluster_Close_Call {
_c.Call.Return(run)
return _c
}
// DropImport provides a mock function with given fields: nodeID, in
func (_m *MockCluster) DropImport(nodeID int64, in *datapb.DropImportRequest) error {
ret := _m.Called(nodeID, in)
var r0 error
if rf, ok := ret.Get(0).(func(int64, *datapb.DropImportRequest) error); ok {
r0 = rf(nodeID, in)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_DropImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropImport'
type MockCluster_DropImport_Call struct {
*mock.Call
}
// DropImport is a helper method to define mock.On call
// - nodeID int64
// - in *datapb.DropImportRequest
func (_e *MockCluster_Expecter) DropImport(nodeID interface{}, in interface{}) *MockCluster_DropImport_Call {
return &MockCluster_DropImport_Call{Call: _e.mock.On("DropImport", nodeID, in)}
}
func (_c *MockCluster_DropImport_Call) Run(run func(nodeID int64, in *datapb.DropImportRequest)) *MockCluster_DropImport_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64), args[1].(*datapb.DropImportRequest))
})
return _c
}
func (_c *MockCluster_DropImport_Call) Return(_a0 error) *MockCluster_DropImport_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_DropImport_Call) RunAndReturn(run func(int64, *datapb.DropImportRequest) error) *MockCluster_DropImport_Call {
_c.Call.Return(run)
return _c
}
// Flush provides a mock function with given fields: ctx, nodeID, channel, segments
func (_m *MockCluster) Flush(ctx context.Context, nodeID int64, channel string, segments []*datapb.SegmentInfo) error {
ret := _m.Called(ctx, nodeID, channel, segments)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64, string, []*datapb.SegmentInfo) error); ok {
r0 = rf(ctx, nodeID, channel, segments)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush'
type MockCluster_Flush_Call struct {
*mock.Call
}
// Flush is a helper method to define mock.On call
// - ctx context.Context
// - nodeID int64
// - channel string
// - segments []*datapb.SegmentInfo
func (_e *MockCluster_Expecter) Flush(ctx interface{}, nodeID interface{}, channel interface{}, segments interface{}) *MockCluster_Flush_Call {
return &MockCluster_Flush_Call{Call: _e.mock.On("Flush", ctx, nodeID, channel, segments)}
}
func (_c *MockCluster_Flush_Call) Run(run func(ctx context.Context, nodeID int64, channel string, segments []*datapb.SegmentInfo)) *MockCluster_Flush_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(int64), args[2].(string), args[3].([]*datapb.SegmentInfo))
})
return _c
}
func (_c *MockCluster_Flush_Call) Return(_a0 error) *MockCluster_Flush_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_Flush_Call) RunAndReturn(run func(context.Context, int64, string, []*datapb.SegmentInfo) error) *MockCluster_Flush_Call {
_c.Call.Return(run)
return _c
}
// FlushChannels provides a mock function with given fields: ctx, nodeID, flushTs, channels
func (_m *MockCluster) FlushChannels(ctx context.Context, nodeID int64, flushTs uint64, channels []string) error {
ret := _m.Called(ctx, nodeID, flushTs, channels)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64, uint64, []string) error); ok {
r0 = rf(ctx, nodeID, flushTs, channels)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_FlushChannels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FlushChannels'
type MockCluster_FlushChannels_Call struct {
*mock.Call
}
// FlushChannels is a helper method to define mock.On call
// - ctx context.Context
// - nodeID int64
// - flushTs uint64
// - channels []string
func (_e *MockCluster_Expecter) FlushChannels(ctx interface{}, nodeID interface{}, flushTs interface{}, channels interface{}) *MockCluster_FlushChannels_Call {
return &MockCluster_FlushChannels_Call{Call: _e.mock.On("FlushChannels", ctx, nodeID, flushTs, channels)}
}
func (_c *MockCluster_FlushChannels_Call) Run(run func(ctx context.Context, nodeID int64, flushTs uint64, channels []string)) *MockCluster_FlushChannels_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(int64), args[2].(uint64), args[3].([]string))
})
return _c
}
func (_c *MockCluster_FlushChannels_Call) Return(_a0 error) *MockCluster_FlushChannels_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_FlushChannels_Call) RunAndReturn(run func(context.Context, int64, uint64, []string) error) *MockCluster_FlushChannels_Call {
_c.Call.Return(run)
return _c
}
// GetSessions provides a mock function with given fields:
func (_m *MockCluster) GetSessions() []*Session {
ret := _m.Called()
var r0 []*Session
if rf, ok := ret.Get(0).(func() []*Session); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*Session)
}
}
return r0
}
// MockCluster_GetSessions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSessions'
type MockCluster_GetSessions_Call struct {
*mock.Call
}
// GetSessions is a helper method to define mock.On call
func (_e *MockCluster_Expecter) GetSessions() *MockCluster_GetSessions_Call {
return &MockCluster_GetSessions_Call{Call: _e.mock.On("GetSessions")}
}
func (_c *MockCluster_GetSessions_Call) Run(run func()) *MockCluster_GetSessions_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockCluster_GetSessions_Call) Return(_a0 []*Session) *MockCluster_GetSessions_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_GetSessions_Call) RunAndReturn(run func() []*Session) *MockCluster_GetSessions_Call {
_c.Call.Return(run)
return _c
}
// ImportV2 provides a mock function with given fields: nodeID, in
func (_m *MockCluster) ImportV2(nodeID int64, in *datapb.ImportRequest) error {
ret := _m.Called(nodeID, in)
var r0 error
if rf, ok := ret.Get(0).(func(int64, *datapb.ImportRequest) error); ok {
r0 = rf(nodeID, in)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_ImportV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImportV2'
type MockCluster_ImportV2_Call struct {
*mock.Call
}
// ImportV2 is a helper method to define mock.On call
// - nodeID int64
// - in *datapb.ImportRequest
func (_e *MockCluster_Expecter) ImportV2(nodeID interface{}, in interface{}) *MockCluster_ImportV2_Call {
return &MockCluster_ImportV2_Call{Call: _e.mock.On("ImportV2", nodeID, in)}
}
func (_c *MockCluster_ImportV2_Call) Run(run func(nodeID int64, in *datapb.ImportRequest)) *MockCluster_ImportV2_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64), args[1].(*datapb.ImportRequest))
})
return _c
}
func (_c *MockCluster_ImportV2_Call) Return(_a0 error) *MockCluster_ImportV2_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_ImportV2_Call) RunAndReturn(run func(int64, *datapb.ImportRequest) error) *MockCluster_ImportV2_Call {
_c.Call.Return(run)
return _c
}
// PreImport provides a mock function with given fields: nodeID, in
func (_m *MockCluster) PreImport(nodeID int64, in *datapb.PreImportRequest) error {
ret := _m.Called(nodeID, in)
var r0 error
if rf, ok := ret.Get(0).(func(int64, *datapb.PreImportRequest) error); ok {
r0 = rf(nodeID, in)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_PreImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PreImport'
type MockCluster_PreImport_Call struct {
*mock.Call
}
// PreImport is a helper method to define mock.On call
// - nodeID int64
// - in *datapb.PreImportRequest
func (_e *MockCluster_Expecter) PreImport(nodeID interface{}, in interface{}) *MockCluster_PreImport_Call {
return &MockCluster_PreImport_Call{Call: _e.mock.On("PreImport", nodeID, in)}
}
func (_c *MockCluster_PreImport_Call) Run(run func(nodeID int64, in *datapb.PreImportRequest)) *MockCluster_PreImport_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64), args[1].(*datapb.PreImportRequest))
})
return _c
}
func (_c *MockCluster_PreImport_Call) Return(_a0 error) *MockCluster_PreImport_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_PreImport_Call) RunAndReturn(run func(int64, *datapb.PreImportRequest) error) *MockCluster_PreImport_Call {
_c.Call.Return(run)
return _c
}
// QueryImport provides a mock function with given fields: nodeID, in
func (_m *MockCluster) QueryImport(nodeID int64, in *datapb.QueryImportRequest) (*datapb.QueryImportResponse, error) {
ret := _m.Called(nodeID, in)
var r0 *datapb.QueryImportResponse
var r1 error
if rf, ok := ret.Get(0).(func(int64, *datapb.QueryImportRequest) (*datapb.QueryImportResponse, error)); ok {
return rf(nodeID, in)
}
if rf, ok := ret.Get(0).(func(int64, *datapb.QueryImportRequest) *datapb.QueryImportResponse); ok {
r0 = rf(nodeID, in)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*datapb.QueryImportResponse)
}
}
if rf, ok := ret.Get(1).(func(int64, *datapb.QueryImportRequest) error); ok {
r1 = rf(nodeID, in)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockCluster_QueryImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryImport'
type MockCluster_QueryImport_Call struct {
*mock.Call
}
// QueryImport is a helper method to define mock.On call
// - nodeID int64
// - in *datapb.QueryImportRequest
func (_e *MockCluster_Expecter) QueryImport(nodeID interface{}, in interface{}) *MockCluster_QueryImport_Call {
return &MockCluster_QueryImport_Call{Call: _e.mock.On("QueryImport", nodeID, in)}
}
func (_c *MockCluster_QueryImport_Call) Run(run func(nodeID int64, in *datapb.QueryImportRequest)) *MockCluster_QueryImport_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64), args[1].(*datapb.QueryImportRequest))
})
return _c
}
func (_c *MockCluster_QueryImport_Call) Return(_a0 *datapb.QueryImportResponse, _a1 error) *MockCluster_QueryImport_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockCluster_QueryImport_Call) RunAndReturn(run func(int64, *datapb.QueryImportRequest) (*datapb.QueryImportResponse, error)) *MockCluster_QueryImport_Call {
_c.Call.Return(run)
return _c
}
// QueryPreImport provides a mock function with given fields: nodeID, in
func (_m *MockCluster) QueryPreImport(nodeID int64, in *datapb.QueryPreImportRequest) (*datapb.QueryPreImportResponse, error) {
ret := _m.Called(nodeID, in)
var r0 *datapb.QueryPreImportResponse
var r1 error
if rf, ok := ret.Get(0).(func(int64, *datapb.QueryPreImportRequest) (*datapb.QueryPreImportResponse, error)); ok {
return rf(nodeID, in)
}
if rf, ok := ret.Get(0).(func(int64, *datapb.QueryPreImportRequest) *datapb.QueryPreImportResponse); ok {
r0 = rf(nodeID, in)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*datapb.QueryPreImportResponse)
}
}
if rf, ok := ret.Get(1).(func(int64, *datapb.QueryPreImportRequest) error); ok {
r1 = rf(nodeID, in)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockCluster_QueryPreImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryPreImport'
type MockCluster_QueryPreImport_Call struct {
*mock.Call
}
// QueryPreImport is a helper method to define mock.On call
// - nodeID int64
// - in *datapb.QueryPreImportRequest
func (_e *MockCluster_Expecter) QueryPreImport(nodeID interface{}, in interface{}) *MockCluster_QueryPreImport_Call {
return &MockCluster_QueryPreImport_Call{Call: _e.mock.On("QueryPreImport", nodeID, in)}
}
func (_c *MockCluster_QueryPreImport_Call) Run(run func(nodeID int64, in *datapb.QueryPreImportRequest)) *MockCluster_QueryPreImport_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64), args[1].(*datapb.QueryPreImportRequest))
})
return _c
}
func (_c *MockCluster_QueryPreImport_Call) Return(_a0 *datapb.QueryPreImportResponse, _a1 error) *MockCluster_QueryPreImport_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockCluster_QueryPreImport_Call) RunAndReturn(run func(int64, *datapb.QueryPreImportRequest) (*datapb.QueryPreImportResponse, error)) *MockCluster_QueryPreImport_Call {
_c.Call.Return(run)
return _c
}
// Register provides a mock function with given fields: node
func (_m *MockCluster) Register(node *NodeInfo) error {
ret := _m.Called(node)
var r0 error
if rf, ok := ret.Get(0).(func(*NodeInfo) error); ok {
r0 = rf(node)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register'
type MockCluster_Register_Call struct {
*mock.Call
}
// Register is a helper method to define mock.On call
// - node *NodeInfo
func (_e *MockCluster_Expecter) Register(node interface{}) *MockCluster_Register_Call {
return &MockCluster_Register_Call{Call: _e.mock.On("Register", node)}
}
func (_c *MockCluster_Register_Call) Run(run func(node *NodeInfo)) *MockCluster_Register_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*NodeInfo))
})
return _c
}
func (_c *MockCluster_Register_Call) Return(_a0 error) *MockCluster_Register_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_Register_Call) RunAndReturn(run func(*NodeInfo) error) *MockCluster_Register_Call {
_c.Call.Return(run)
return _c
}
// Startup provides a mock function with given fields: ctx, nodes
func (_m *MockCluster) Startup(ctx context.Context, nodes []*NodeInfo) error {
ret := _m.Called(ctx, nodes)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []*NodeInfo) error); ok {
r0 = rf(ctx, nodes)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_Startup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Startup'
type MockCluster_Startup_Call struct {
*mock.Call
}
// Startup is a helper method to define mock.On call
// - ctx context.Context
// - nodes []*NodeInfo
func (_e *MockCluster_Expecter) Startup(ctx interface{}, nodes interface{}) *MockCluster_Startup_Call {
return &MockCluster_Startup_Call{Call: _e.mock.On("Startup", ctx, nodes)}
}
func (_c *MockCluster_Startup_Call) Run(run func(ctx context.Context, nodes []*NodeInfo)) *MockCluster_Startup_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].([]*NodeInfo))
})
return _c
}
func (_c *MockCluster_Startup_Call) Return(_a0 error) *MockCluster_Startup_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_Startup_Call) RunAndReturn(run func(context.Context, []*NodeInfo) error) *MockCluster_Startup_Call {
_c.Call.Return(run)
return _c
}
// UnRegister provides a mock function with given fields: node
func (_m *MockCluster) UnRegister(node *NodeInfo) error {
ret := _m.Called(node)
var r0 error
if rf, ok := ret.Get(0).(func(*NodeInfo) error); ok {
r0 = rf(node)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_UnRegister_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnRegister'
type MockCluster_UnRegister_Call struct {
*mock.Call
}
// UnRegister is a helper method to define mock.On call
// - node *NodeInfo
func (_e *MockCluster_Expecter) UnRegister(node interface{}) *MockCluster_UnRegister_Call {
return &MockCluster_UnRegister_Call{Call: _e.mock.On("UnRegister", node)}
}
func (_c *MockCluster_UnRegister_Call) Run(run func(node *NodeInfo)) *MockCluster_UnRegister_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*NodeInfo))
})
return _c
}
func (_c *MockCluster_UnRegister_Call) Return(_a0 error) *MockCluster_UnRegister_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_UnRegister_Call) RunAndReturn(run func(*NodeInfo) error) *MockCluster_UnRegister_Call {
_c.Call.Return(run)
return _c
}
// Watch provides a mock function with given fields: ctx, ch
func (_m *MockCluster) Watch(ctx context.Context, ch RWChannel) error {
ret := _m.Called(ctx, ch)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, RWChannel) error); ok {
r0 = rf(ctx, ch)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockCluster_Watch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Watch'
type MockCluster_Watch_Call struct {
*mock.Call
}
// Watch is a helper method to define mock.On call
// - ctx context.Context
// - ch RWChannel
func (_e *MockCluster_Expecter) Watch(ctx interface{}, ch interface{}) *MockCluster_Watch_Call {
return &MockCluster_Watch_Call{Call: _e.mock.On("Watch", ctx, ch)}
}
func (_c *MockCluster_Watch_Call) Run(run func(ctx context.Context, ch RWChannel)) *MockCluster_Watch_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(RWChannel))
})
return _c
}
func (_c *MockCluster_Watch_Call) Return(_a0 error) *MockCluster_Watch_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockCluster_Watch_Call) RunAndReturn(run func(context.Context, RWChannel) error) *MockCluster_Watch_Call {
_c.Call.Return(run)
return _c
}
// NewMockCluster creates a new instance of MockCluster. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockCluster(t interface {
mock.TestingT
Cleanup(func())
}) *MockCluster {
mock := &MockCluster{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}