mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 21:39:19 +08:00
0b905078e7
See also #27675 This PR make previously merged refactory of datanode go online - Use write node to replace insert/delete node - Use write buffer manager to control all buffers - Use sync manager to control sync tasks instead of flush manager Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
196 lines
5.8 KiB
Go
196 lines
5.8 KiB
Go
// Code generated by mockery v2.32.4. DO NOT EDIT.
|
|
|
|
package syncmgr
|
|
|
|
import (
|
|
context "context"
|
|
|
|
conc "github.com/milvus-io/milvus/pkg/util/conc"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
msgpb "github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
|
|
)
|
|
|
|
// MockSyncManager is an autogenerated mock type for the SyncManager type
|
|
type MockSyncManager struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockSyncManager_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockSyncManager) EXPECT() *MockSyncManager_Expecter {
|
|
return &MockSyncManager_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Block provides a mock function with given fields: segmentID
|
|
func (_m *MockSyncManager) Block(segmentID int64) {
|
|
_m.Called(segmentID)
|
|
}
|
|
|
|
// MockSyncManager_Block_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Block'
|
|
type MockSyncManager_Block_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Block is a helper method to define mock.On call
|
|
// - segmentID int64
|
|
func (_e *MockSyncManager_Expecter) Block(segmentID interface{}) *MockSyncManager_Block_Call {
|
|
return &MockSyncManager_Block_Call{Call: _e.mock.On("Block", segmentID)}
|
|
}
|
|
|
|
func (_c *MockSyncManager_Block_Call) Run(run func(segmentID int64)) *MockSyncManager_Block_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(int64))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_Block_Call) Return() *MockSyncManager_Block_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_Block_Call) RunAndReturn(run func(int64)) *MockSyncManager_Block_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetMinCheckpoints provides a mock function with given fields: channel
|
|
func (_m *MockSyncManager) GetMinCheckpoints(channel string) *msgpb.MsgPosition {
|
|
ret := _m.Called(channel)
|
|
|
|
var r0 *msgpb.MsgPosition
|
|
if rf, ok := ret.Get(0).(func(string) *msgpb.MsgPosition); ok {
|
|
r0 = rf(channel)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*msgpb.MsgPosition)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockSyncManager_GetMinCheckpoints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMinCheckpoints'
|
|
type MockSyncManager_GetMinCheckpoints_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetMinCheckpoints is a helper method to define mock.On call
|
|
// - channel string
|
|
func (_e *MockSyncManager_Expecter) GetMinCheckpoints(channel interface{}) *MockSyncManager_GetMinCheckpoints_Call {
|
|
return &MockSyncManager_GetMinCheckpoints_Call{Call: _e.mock.On("GetMinCheckpoints", channel)}
|
|
}
|
|
|
|
func (_c *MockSyncManager_GetMinCheckpoints_Call) Run(run func(channel string)) *MockSyncManager_GetMinCheckpoints_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_GetMinCheckpoints_Call) Return(_a0 *msgpb.MsgPosition) *MockSyncManager_GetMinCheckpoints_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_GetMinCheckpoints_Call) RunAndReturn(run func(string) *msgpb.MsgPosition) *MockSyncManager_GetMinCheckpoints_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// SyncData provides a mock function with given fields: ctx, task
|
|
func (_m *MockSyncManager) SyncData(ctx context.Context, task *SyncTask) *conc.Future[error] {
|
|
ret := _m.Called(ctx, task)
|
|
|
|
var r0 *conc.Future[error]
|
|
if rf, ok := ret.Get(0).(func(context.Context, *SyncTask) *conc.Future[error]); ok {
|
|
r0 = rf(ctx, task)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*conc.Future[error])
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockSyncManager_SyncData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncData'
|
|
type MockSyncManager_SyncData_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// SyncData is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - task *SyncTask
|
|
func (_e *MockSyncManager_Expecter) SyncData(ctx interface{}, task interface{}) *MockSyncManager_SyncData_Call {
|
|
return &MockSyncManager_SyncData_Call{Call: _e.mock.On("SyncData", ctx, task)}
|
|
}
|
|
|
|
func (_c *MockSyncManager_SyncData_Call) Run(run func(ctx context.Context, task *SyncTask)) *MockSyncManager_SyncData_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(*SyncTask))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_SyncData_Call) Return(_a0 *conc.Future[error]) *MockSyncManager_SyncData_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_SyncData_Call) RunAndReturn(run func(context.Context, *SyncTask) *conc.Future[error]) *MockSyncManager_SyncData_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Unblock provides a mock function with given fields: segmentID
|
|
func (_m *MockSyncManager) Unblock(segmentID int64) {
|
|
_m.Called(segmentID)
|
|
}
|
|
|
|
// MockSyncManager_Unblock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unblock'
|
|
type MockSyncManager_Unblock_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Unblock is a helper method to define mock.On call
|
|
// - segmentID int64
|
|
func (_e *MockSyncManager_Expecter) Unblock(segmentID interface{}) *MockSyncManager_Unblock_Call {
|
|
return &MockSyncManager_Unblock_Call{Call: _e.mock.On("Unblock", segmentID)}
|
|
}
|
|
|
|
func (_c *MockSyncManager_Unblock_Call) Run(run func(segmentID int64)) *MockSyncManager_Unblock_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(int64))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_Unblock_Call) Return() *MockSyncManager_Unblock_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSyncManager_Unblock_Call) RunAndReturn(run func(int64)) *MockSyncManager_Unblock_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockSyncManager creates a new instance of MockSyncManager. 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 NewMockSyncManager(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockSyncManager {
|
|
mock := &MockSyncManager{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|