milvus/internal/querynodev2/delegator/mock_delegator.go
Bingyi Sun 0c0630cc38
feat: support dropping index without releasing collection (#42941)
issue: #42942

This pr includes the following changes:
1. Added checks for index checker in querycoord to generate drop index
tasks
2. Added drop index interface to querynode
3. To avoid search failure after dropping the index, the querynode
allows the use of lazy mode (warmup=disable) to load raw data even when
indexes contain raw data.
4. In segcore, loading the index no longer deletes raw data; instead, it
evicts it.
5. In expr, the index is pinned to prevent concurrent errors.

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2025-09-02 16:17:52 +08:00

1399 lines
46 KiB
Go

// Code generated by mockery v2.53.3. DO NOT EDIT.
package delegator
import (
context "context"
milvuspb "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
internalpb "github.com/milvus-io/milvus/pkg/v2/proto/internalpb"
mock "github.com/stretchr/testify/mock"
querypb "github.com/milvus-io/milvus/pkg/v2/proto/querypb"
schemapb "github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
streamrpc "github.com/milvus-io/milvus/internal/util/streamrpc"
)
// MockShardDelegator is an autogenerated mock type for the ShardDelegator type
type MockShardDelegator struct {
mock.Mock
}
type MockShardDelegator_Expecter struct {
mock *mock.Mock
}
func (_m *MockShardDelegator) EXPECT() *MockShardDelegator_Expecter {
return &MockShardDelegator_Expecter{mock: &_m.Mock}
}
// AddExcludedSegments provides a mock function with given fields: excludeInfo
func (_m *MockShardDelegator) AddExcludedSegments(excludeInfo map[int64]uint64) {
_m.Called(excludeInfo)
}
// MockShardDelegator_AddExcludedSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddExcludedSegments'
type MockShardDelegator_AddExcludedSegments_Call struct {
*mock.Call
}
// AddExcludedSegments is a helper method to define mock.On call
// - excludeInfo map[int64]uint64
func (_e *MockShardDelegator_Expecter) AddExcludedSegments(excludeInfo interface{}) *MockShardDelegator_AddExcludedSegments_Call {
return &MockShardDelegator_AddExcludedSegments_Call{Call: _e.mock.On("AddExcludedSegments", excludeInfo)}
}
func (_c *MockShardDelegator_AddExcludedSegments_Call) Run(run func(excludeInfo map[int64]uint64)) *MockShardDelegator_AddExcludedSegments_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(map[int64]uint64))
})
return _c
}
func (_c *MockShardDelegator_AddExcludedSegments_Call) Return() *MockShardDelegator_AddExcludedSegments_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_AddExcludedSegments_Call) RunAndReturn(run func(map[int64]uint64)) *MockShardDelegator_AddExcludedSegments_Call {
_c.Run(run)
return _c
}
// Close provides a mock function with no fields
func (_m *MockShardDelegator) Close() {
_m.Called()
}
// MockShardDelegator_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type MockShardDelegator_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) Close() *MockShardDelegator_Close_Call {
return &MockShardDelegator_Close_Call{Call: _e.mock.On("Close")}
}
func (_c *MockShardDelegator_Close_Call) Run(run func()) *MockShardDelegator_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_Close_Call) Return() *MockShardDelegator_Close_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_Close_Call) RunAndReturn(run func()) *MockShardDelegator_Close_Call {
_c.Run(run)
return _c
}
// Collection provides a mock function with no fields
func (_m *MockShardDelegator) Collection() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Collection")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockShardDelegator_Collection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Collection'
type MockShardDelegator_Collection_Call struct {
*mock.Call
}
// Collection is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) Collection() *MockShardDelegator_Collection_Call {
return &MockShardDelegator_Collection_Call{Call: _e.mock.On("Collection")}
}
func (_c *MockShardDelegator_Collection_Call) Run(run func()) *MockShardDelegator_Collection_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_Collection_Call) Return(_a0 int64) *MockShardDelegator_Collection_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_Collection_Call) RunAndReturn(run func() int64) *MockShardDelegator_Collection_Call {
_c.Call.Return(run)
return _c
}
// DropIndex provides a mock function with given fields: ctx, req
func (_m *MockShardDelegator) DropIndex(ctx context.Context, req *querypb.DropIndexRequest) error {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for DropIndex")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.DropIndexRequest) error); ok {
r0 = rf(ctx, req)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockShardDelegator_DropIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIndex'
type MockShardDelegator_DropIndex_Call struct {
*mock.Call
}
// DropIndex is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.DropIndexRequest
func (_e *MockShardDelegator_Expecter) DropIndex(ctx interface{}, req interface{}) *MockShardDelegator_DropIndex_Call {
return &MockShardDelegator_DropIndex_Call{Call: _e.mock.On("DropIndex", ctx, req)}
}
func (_c *MockShardDelegator_DropIndex_Call) Run(run func(ctx context.Context, req *querypb.DropIndexRequest)) *MockShardDelegator_DropIndex_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.DropIndexRequest))
})
return _c
}
func (_c *MockShardDelegator_DropIndex_Call) Return(_a0 error) *MockShardDelegator_DropIndex_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_DropIndex_Call) RunAndReturn(run func(context.Context, *querypb.DropIndexRequest) error) *MockShardDelegator_DropIndex_Call {
_c.Call.Return(run)
return _c
}
// GetChannelQueryView provides a mock function with no fields
func (_m *MockShardDelegator) GetChannelQueryView() *channelQueryView {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetChannelQueryView")
}
var r0 *channelQueryView
if rf, ok := ret.Get(0).(func() *channelQueryView); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*channelQueryView)
}
}
return r0
}
// MockShardDelegator_GetChannelQueryView_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChannelQueryView'
type MockShardDelegator_GetChannelQueryView_Call struct {
*mock.Call
}
// GetChannelQueryView is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) GetChannelQueryView() *MockShardDelegator_GetChannelQueryView_Call {
return &MockShardDelegator_GetChannelQueryView_Call{Call: _e.mock.On("GetChannelQueryView")}
}
func (_c *MockShardDelegator_GetChannelQueryView_Call) Run(run func()) *MockShardDelegator_GetChannelQueryView_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_GetChannelQueryView_Call) Return(_a0 *channelQueryView) *MockShardDelegator_GetChannelQueryView_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_GetChannelQueryView_Call) RunAndReturn(run func() *channelQueryView) *MockShardDelegator_GetChannelQueryView_Call {
_c.Call.Return(run)
return _c
}
// GetDeleteBufferSize provides a mock function with no fields
func (_m *MockShardDelegator) GetDeleteBufferSize() (int64, int64) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetDeleteBufferSize")
}
var r0 int64
var r1 int64
if rf, ok := ret.Get(0).(func() (int64, int64)); ok {
return rf()
}
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func() int64); ok {
r1 = rf()
} else {
r1 = ret.Get(1).(int64)
}
return r0, r1
}
// MockShardDelegator_GetDeleteBufferSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeleteBufferSize'
type MockShardDelegator_GetDeleteBufferSize_Call struct {
*mock.Call
}
// GetDeleteBufferSize is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) GetDeleteBufferSize() *MockShardDelegator_GetDeleteBufferSize_Call {
return &MockShardDelegator_GetDeleteBufferSize_Call{Call: _e.mock.On("GetDeleteBufferSize")}
}
func (_c *MockShardDelegator_GetDeleteBufferSize_Call) Run(run func()) *MockShardDelegator_GetDeleteBufferSize_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_GetDeleteBufferSize_Call) Return(entryNum int64, memorySize int64) *MockShardDelegator_GetDeleteBufferSize_Call {
_c.Call.Return(entryNum, memorySize)
return _c
}
func (_c *MockShardDelegator_GetDeleteBufferSize_Call) RunAndReturn(run func() (int64, int64)) *MockShardDelegator_GetDeleteBufferSize_Call {
_c.Call.Return(run)
return _c
}
// GetPartitionStatsVersions provides a mock function with given fields: ctx
func (_m *MockShardDelegator) GetPartitionStatsVersions(ctx context.Context) map[int64]int64 {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetPartitionStatsVersions")
}
var r0 map[int64]int64
if rf, ok := ret.Get(0).(func(context.Context) map[int64]int64); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[int64]int64)
}
}
return r0
}
// MockShardDelegator_GetPartitionStatsVersions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPartitionStatsVersions'
type MockShardDelegator_GetPartitionStatsVersions_Call struct {
*mock.Call
}
// GetPartitionStatsVersions is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockShardDelegator_Expecter) GetPartitionStatsVersions(ctx interface{}) *MockShardDelegator_GetPartitionStatsVersions_Call {
return &MockShardDelegator_GetPartitionStatsVersions_Call{Call: _e.mock.On("GetPartitionStatsVersions", ctx)}
}
func (_c *MockShardDelegator_GetPartitionStatsVersions_Call) Run(run func(ctx context.Context)) *MockShardDelegator_GetPartitionStatsVersions_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *MockShardDelegator_GetPartitionStatsVersions_Call) Return(_a0 map[int64]int64) *MockShardDelegator_GetPartitionStatsVersions_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_GetPartitionStatsVersions_Call) RunAndReturn(run func(context.Context) map[int64]int64) *MockShardDelegator_GetPartitionStatsVersions_Call {
_c.Call.Return(run)
return _c
}
// GetSegmentInfo provides a mock function with given fields: readable
func (_m *MockShardDelegator) GetSegmentInfo(readable bool) ([]SnapshotItem, []SegmentEntry) {
ret := _m.Called(readable)
if len(ret) == 0 {
panic("no return value specified for GetSegmentInfo")
}
var r0 []SnapshotItem
var r1 []SegmentEntry
if rf, ok := ret.Get(0).(func(bool) ([]SnapshotItem, []SegmentEntry)); ok {
return rf(readable)
}
if rf, ok := ret.Get(0).(func(bool) []SnapshotItem); ok {
r0 = rf(readable)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]SnapshotItem)
}
}
if rf, ok := ret.Get(1).(func(bool) []SegmentEntry); ok {
r1 = rf(readable)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]SegmentEntry)
}
}
return r0, r1
}
// MockShardDelegator_GetSegmentInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSegmentInfo'
type MockShardDelegator_GetSegmentInfo_Call struct {
*mock.Call
}
// GetSegmentInfo is a helper method to define mock.On call
// - readable bool
func (_e *MockShardDelegator_Expecter) GetSegmentInfo(readable interface{}) *MockShardDelegator_GetSegmentInfo_Call {
return &MockShardDelegator_GetSegmentInfo_Call{Call: _e.mock.On("GetSegmentInfo", readable)}
}
func (_c *MockShardDelegator_GetSegmentInfo_Call) Run(run func(readable bool)) *MockShardDelegator_GetSegmentInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(bool))
})
return _c
}
func (_c *MockShardDelegator_GetSegmentInfo_Call) Return(sealed []SnapshotItem, growing []SegmentEntry) *MockShardDelegator_GetSegmentInfo_Call {
_c.Call.Return(sealed, growing)
return _c
}
func (_c *MockShardDelegator_GetSegmentInfo_Call) RunAndReturn(run func(bool) ([]SnapshotItem, []SegmentEntry)) *MockShardDelegator_GetSegmentInfo_Call {
_c.Call.Return(run)
return _c
}
// GetStatistics provides a mock function with given fields: ctx, req
func (_m *MockShardDelegator) GetStatistics(ctx context.Context, req *querypb.GetStatisticsRequest) ([]*internalpb.GetStatisticsResponse, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for GetStatistics")
}
var r0 []*internalpb.GetStatisticsResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.GetStatisticsRequest) ([]*internalpb.GetStatisticsResponse, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, *querypb.GetStatisticsRequest) []*internalpb.GetStatisticsResponse); ok {
r0 = rf(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*internalpb.GetStatisticsResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *querypb.GetStatisticsRequest) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockShardDelegator_GetStatistics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatistics'
type MockShardDelegator_GetStatistics_Call struct {
*mock.Call
}
// GetStatistics is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.GetStatisticsRequest
func (_e *MockShardDelegator_Expecter) GetStatistics(ctx interface{}, req interface{}) *MockShardDelegator_GetStatistics_Call {
return &MockShardDelegator_GetStatistics_Call{Call: _e.mock.On("GetStatistics", ctx, req)}
}
func (_c *MockShardDelegator_GetStatistics_Call) Run(run func(ctx context.Context, req *querypb.GetStatisticsRequest)) *MockShardDelegator_GetStatistics_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.GetStatisticsRequest))
})
return _c
}
func (_c *MockShardDelegator_GetStatistics_Call) Return(_a0 []*internalpb.GetStatisticsResponse, _a1 error) *MockShardDelegator_GetStatistics_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockShardDelegator_GetStatistics_Call) RunAndReturn(run func(context.Context, *querypb.GetStatisticsRequest) ([]*internalpb.GetStatisticsResponse, error)) *MockShardDelegator_GetStatistics_Call {
_c.Call.Return(run)
return _c
}
// GetTSafe provides a mock function with no fields
func (_m *MockShardDelegator) GetTSafe() uint64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetTSafe")
}
var r0 uint64
if rf, ok := ret.Get(0).(func() uint64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint64)
}
return r0
}
// MockShardDelegator_GetTSafe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTSafe'
type MockShardDelegator_GetTSafe_Call struct {
*mock.Call
}
// GetTSafe is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) GetTSafe() *MockShardDelegator_GetTSafe_Call {
return &MockShardDelegator_GetTSafe_Call{Call: _e.mock.On("GetTSafe")}
}
func (_c *MockShardDelegator_GetTSafe_Call) Run(run func()) *MockShardDelegator_GetTSafe_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_GetTSafe_Call) Return(_a0 uint64) *MockShardDelegator_GetTSafe_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_GetTSafe_Call) RunAndReturn(run func() uint64) *MockShardDelegator_GetTSafe_Call {
_c.Call.Return(run)
return _c
}
// LoadGrowing provides a mock function with given fields: ctx, infos, version
func (_m *MockShardDelegator) LoadGrowing(ctx context.Context, infos []*querypb.SegmentLoadInfo, version int64) error {
ret := _m.Called(ctx, infos, version)
if len(ret) == 0 {
panic("no return value specified for LoadGrowing")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []*querypb.SegmentLoadInfo, int64) error); ok {
r0 = rf(ctx, infos, version)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockShardDelegator_LoadGrowing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadGrowing'
type MockShardDelegator_LoadGrowing_Call struct {
*mock.Call
}
// LoadGrowing is a helper method to define mock.On call
// - ctx context.Context
// - infos []*querypb.SegmentLoadInfo
// - version int64
func (_e *MockShardDelegator_Expecter) LoadGrowing(ctx interface{}, infos interface{}, version interface{}) *MockShardDelegator_LoadGrowing_Call {
return &MockShardDelegator_LoadGrowing_Call{Call: _e.mock.On("LoadGrowing", ctx, infos, version)}
}
func (_c *MockShardDelegator_LoadGrowing_Call) Run(run func(ctx context.Context, infos []*querypb.SegmentLoadInfo, version int64)) *MockShardDelegator_LoadGrowing_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].([]*querypb.SegmentLoadInfo), args[2].(int64))
})
return _c
}
func (_c *MockShardDelegator_LoadGrowing_Call) Return(_a0 error) *MockShardDelegator_LoadGrowing_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_LoadGrowing_Call) RunAndReturn(run func(context.Context, []*querypb.SegmentLoadInfo, int64) error) *MockShardDelegator_LoadGrowing_Call {
_c.Call.Return(run)
return _c
}
// LoadL0 provides a mock function with given fields: ctx, infos, version
func (_m *MockShardDelegator) LoadL0(ctx context.Context, infos []*querypb.SegmentLoadInfo, version int64) error {
ret := _m.Called(ctx, infos, version)
if len(ret) == 0 {
panic("no return value specified for LoadL0")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []*querypb.SegmentLoadInfo, int64) error); ok {
r0 = rf(ctx, infos, version)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockShardDelegator_LoadL0_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadL0'
type MockShardDelegator_LoadL0_Call struct {
*mock.Call
}
// LoadL0 is a helper method to define mock.On call
// - ctx context.Context
// - infos []*querypb.SegmentLoadInfo
// - version int64
func (_e *MockShardDelegator_Expecter) LoadL0(ctx interface{}, infos interface{}, version interface{}) *MockShardDelegator_LoadL0_Call {
return &MockShardDelegator_LoadL0_Call{Call: _e.mock.On("LoadL0", ctx, infos, version)}
}
func (_c *MockShardDelegator_LoadL0_Call) Run(run func(ctx context.Context, infos []*querypb.SegmentLoadInfo, version int64)) *MockShardDelegator_LoadL0_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].([]*querypb.SegmentLoadInfo), args[2].(int64))
})
return _c
}
func (_c *MockShardDelegator_LoadL0_Call) Return(_a0 error) *MockShardDelegator_LoadL0_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_LoadL0_Call) RunAndReturn(run func(context.Context, []*querypb.SegmentLoadInfo, int64) error) *MockShardDelegator_LoadL0_Call {
_c.Call.Return(run)
return _c
}
// LoadSegments provides a mock function with given fields: ctx, req
func (_m *MockShardDelegator) LoadSegments(ctx context.Context, req *querypb.LoadSegmentsRequest) error {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for LoadSegments")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.LoadSegmentsRequest) error); ok {
r0 = rf(ctx, req)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockShardDelegator_LoadSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadSegments'
type MockShardDelegator_LoadSegments_Call struct {
*mock.Call
}
// LoadSegments is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.LoadSegmentsRequest
func (_e *MockShardDelegator_Expecter) LoadSegments(ctx interface{}, req interface{}) *MockShardDelegator_LoadSegments_Call {
return &MockShardDelegator_LoadSegments_Call{Call: _e.mock.On("LoadSegments", ctx, req)}
}
func (_c *MockShardDelegator_LoadSegments_Call) Run(run func(ctx context.Context, req *querypb.LoadSegmentsRequest)) *MockShardDelegator_LoadSegments_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.LoadSegmentsRequest))
})
return _c
}
func (_c *MockShardDelegator_LoadSegments_Call) Return(_a0 error) *MockShardDelegator_LoadSegments_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_LoadSegments_Call) RunAndReturn(run func(context.Context, *querypb.LoadSegmentsRequest) error) *MockShardDelegator_LoadSegments_Call {
_c.Call.Return(run)
return _c
}
// ProcessDelete provides a mock function with given fields: deleteData, ts
func (_m *MockShardDelegator) ProcessDelete(deleteData []*DeleteData, ts uint64) {
_m.Called(deleteData, ts)
}
// MockShardDelegator_ProcessDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessDelete'
type MockShardDelegator_ProcessDelete_Call struct {
*mock.Call
}
// ProcessDelete is a helper method to define mock.On call
// - deleteData []*DeleteData
// - ts uint64
func (_e *MockShardDelegator_Expecter) ProcessDelete(deleteData interface{}, ts interface{}) *MockShardDelegator_ProcessDelete_Call {
return &MockShardDelegator_ProcessDelete_Call{Call: _e.mock.On("ProcessDelete", deleteData, ts)}
}
func (_c *MockShardDelegator_ProcessDelete_Call) Run(run func(deleteData []*DeleteData, ts uint64)) *MockShardDelegator_ProcessDelete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]*DeleteData), args[1].(uint64))
})
return _c
}
func (_c *MockShardDelegator_ProcessDelete_Call) Return() *MockShardDelegator_ProcessDelete_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_ProcessDelete_Call) RunAndReturn(run func([]*DeleteData, uint64)) *MockShardDelegator_ProcessDelete_Call {
_c.Run(run)
return _c
}
// ProcessInsert provides a mock function with given fields: insertRecords
func (_m *MockShardDelegator) ProcessInsert(insertRecords map[int64]*InsertData) {
_m.Called(insertRecords)
}
// MockShardDelegator_ProcessInsert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessInsert'
type MockShardDelegator_ProcessInsert_Call struct {
*mock.Call
}
// ProcessInsert is a helper method to define mock.On call
// - insertRecords map[int64]*InsertData
func (_e *MockShardDelegator_Expecter) ProcessInsert(insertRecords interface{}) *MockShardDelegator_ProcessInsert_Call {
return &MockShardDelegator_ProcessInsert_Call{Call: _e.mock.On("ProcessInsert", insertRecords)}
}
func (_c *MockShardDelegator_ProcessInsert_Call) Run(run func(insertRecords map[int64]*InsertData)) *MockShardDelegator_ProcessInsert_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(map[int64]*InsertData))
})
return _c
}
func (_c *MockShardDelegator_ProcessInsert_Call) Return() *MockShardDelegator_ProcessInsert_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_ProcessInsert_Call) RunAndReturn(run func(map[int64]*InsertData)) *MockShardDelegator_ProcessInsert_Call {
_c.Run(run)
return _c
}
// Query provides a mock function with given fields: ctx, req
func (_m *MockShardDelegator) Query(ctx context.Context, req *querypb.QueryRequest) ([]*internalpb.RetrieveResults, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for Query")
}
var r0 []*internalpb.RetrieveResults
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.QueryRequest) ([]*internalpb.RetrieveResults, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, *querypb.QueryRequest) []*internalpb.RetrieveResults); ok {
r0 = rf(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*internalpb.RetrieveResults)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *querypb.QueryRequest) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockShardDelegator_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'
type MockShardDelegator_Query_Call struct {
*mock.Call
}
// Query is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.QueryRequest
func (_e *MockShardDelegator_Expecter) Query(ctx interface{}, req interface{}) *MockShardDelegator_Query_Call {
return &MockShardDelegator_Query_Call{Call: _e.mock.On("Query", ctx, req)}
}
func (_c *MockShardDelegator_Query_Call) Run(run func(ctx context.Context, req *querypb.QueryRequest)) *MockShardDelegator_Query_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.QueryRequest))
})
return _c
}
func (_c *MockShardDelegator_Query_Call) Return(_a0 []*internalpb.RetrieveResults, _a1 error) *MockShardDelegator_Query_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockShardDelegator_Query_Call) RunAndReturn(run func(context.Context, *querypb.QueryRequest) ([]*internalpb.RetrieveResults, error)) *MockShardDelegator_Query_Call {
_c.Call.Return(run)
return _c
}
// QueryStream provides a mock function with given fields: ctx, req, srv
func (_m *MockShardDelegator) QueryStream(ctx context.Context, req *querypb.QueryRequest, srv streamrpc.QueryStreamServer) error {
ret := _m.Called(ctx, req, srv)
if len(ret) == 0 {
panic("no return value specified for QueryStream")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.QueryRequest, streamrpc.QueryStreamServer) error); ok {
r0 = rf(ctx, req, srv)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockShardDelegator_QueryStream_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryStream'
type MockShardDelegator_QueryStream_Call struct {
*mock.Call
}
// QueryStream is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.QueryRequest
// - srv streamrpc.QueryStreamServer
func (_e *MockShardDelegator_Expecter) QueryStream(ctx interface{}, req interface{}, srv interface{}) *MockShardDelegator_QueryStream_Call {
return &MockShardDelegator_QueryStream_Call{Call: _e.mock.On("QueryStream", ctx, req, srv)}
}
func (_c *MockShardDelegator_QueryStream_Call) Run(run func(ctx context.Context, req *querypb.QueryRequest, srv streamrpc.QueryStreamServer)) *MockShardDelegator_QueryStream_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.QueryRequest), args[2].(streamrpc.QueryStreamServer))
})
return _c
}
func (_c *MockShardDelegator_QueryStream_Call) Return(_a0 error) *MockShardDelegator_QueryStream_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_QueryStream_Call) RunAndReturn(run func(context.Context, *querypb.QueryRequest, streamrpc.QueryStreamServer) error) *MockShardDelegator_QueryStream_Call {
_c.Call.Return(run)
return _c
}
// ReleaseSegments provides a mock function with given fields: ctx, req, force
func (_m *MockShardDelegator) ReleaseSegments(ctx context.Context, req *querypb.ReleaseSegmentsRequest, force bool) error {
ret := _m.Called(ctx, req, force)
if len(ret) == 0 {
panic("no return value specified for ReleaseSegments")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.ReleaseSegmentsRequest, bool) error); ok {
r0 = rf(ctx, req, force)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockShardDelegator_ReleaseSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReleaseSegments'
type MockShardDelegator_ReleaseSegments_Call struct {
*mock.Call
}
// ReleaseSegments is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.ReleaseSegmentsRequest
// - force bool
func (_e *MockShardDelegator_Expecter) ReleaseSegments(ctx interface{}, req interface{}, force interface{}) *MockShardDelegator_ReleaseSegments_Call {
return &MockShardDelegator_ReleaseSegments_Call{Call: _e.mock.On("ReleaseSegments", ctx, req, force)}
}
func (_c *MockShardDelegator_ReleaseSegments_Call) Run(run func(ctx context.Context, req *querypb.ReleaseSegmentsRequest, force bool)) *MockShardDelegator_ReleaseSegments_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.ReleaseSegmentsRequest), args[2].(bool))
})
return _c
}
func (_c *MockShardDelegator_ReleaseSegments_Call) Return(_a0 error) *MockShardDelegator_ReleaseSegments_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_ReleaseSegments_Call) RunAndReturn(run func(context.Context, *querypb.ReleaseSegmentsRequest, bool) error) *MockShardDelegator_ReleaseSegments_Call {
_c.Call.Return(run)
return _c
}
// RunAnalyzer provides a mock function with given fields: ctx, req
func (_m *MockShardDelegator) RunAnalyzer(ctx context.Context, req *querypb.RunAnalyzerRequest) ([]*milvuspb.AnalyzerResult, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for RunAnalyzer")
}
var r0 []*milvuspb.AnalyzerResult
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.RunAnalyzerRequest) ([]*milvuspb.AnalyzerResult, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, *querypb.RunAnalyzerRequest) []*milvuspb.AnalyzerResult); ok {
r0 = rf(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*milvuspb.AnalyzerResult)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *querypb.RunAnalyzerRequest) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockShardDelegator_RunAnalyzer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunAnalyzer'
type MockShardDelegator_RunAnalyzer_Call struct {
*mock.Call
}
// RunAnalyzer is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.RunAnalyzerRequest
func (_e *MockShardDelegator_Expecter) RunAnalyzer(ctx interface{}, req interface{}) *MockShardDelegator_RunAnalyzer_Call {
return &MockShardDelegator_RunAnalyzer_Call{Call: _e.mock.On("RunAnalyzer", ctx, req)}
}
func (_c *MockShardDelegator_RunAnalyzer_Call) Run(run func(ctx context.Context, req *querypb.RunAnalyzerRequest)) *MockShardDelegator_RunAnalyzer_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.RunAnalyzerRequest))
})
return _c
}
func (_c *MockShardDelegator_RunAnalyzer_Call) Return(_a0 []*milvuspb.AnalyzerResult, _a1 error) *MockShardDelegator_RunAnalyzer_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockShardDelegator_RunAnalyzer_Call) RunAndReturn(run func(context.Context, *querypb.RunAnalyzerRequest) ([]*milvuspb.AnalyzerResult, error)) *MockShardDelegator_RunAnalyzer_Call {
_c.Call.Return(run)
return _c
}
// Search provides a mock function with given fields: ctx, req
func (_m *MockShardDelegator) Search(ctx context.Context, req *querypb.SearchRequest) ([]*internalpb.SearchResults, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for Search")
}
var r0 []*internalpb.SearchResults
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *querypb.SearchRequest) ([]*internalpb.SearchResults, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, *querypb.SearchRequest) []*internalpb.SearchResults); ok {
r0 = rf(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*internalpb.SearchResults)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *querypb.SearchRequest) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockShardDelegator_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search'
type MockShardDelegator_Search_Call struct {
*mock.Call
}
// Search is a helper method to define mock.On call
// - ctx context.Context
// - req *querypb.SearchRequest
func (_e *MockShardDelegator_Expecter) Search(ctx interface{}, req interface{}) *MockShardDelegator_Search_Call {
return &MockShardDelegator_Search_Call{Call: _e.mock.On("Search", ctx, req)}
}
func (_c *MockShardDelegator_Search_Call) Run(run func(ctx context.Context, req *querypb.SearchRequest)) *MockShardDelegator_Search_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*querypb.SearchRequest))
})
return _c
}
func (_c *MockShardDelegator_Search_Call) Return(_a0 []*internalpb.SearchResults, _a1 error) *MockShardDelegator_Search_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockShardDelegator_Search_Call) RunAndReturn(run func(context.Context, *querypb.SearchRequest) ([]*internalpb.SearchResults, error)) *MockShardDelegator_Search_Call {
_c.Call.Return(run)
return _c
}
// Serviceable provides a mock function with no fields
func (_m *MockShardDelegator) Serviceable() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Serviceable")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockShardDelegator_Serviceable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Serviceable'
type MockShardDelegator_Serviceable_Call struct {
*mock.Call
}
// Serviceable is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) Serviceable() *MockShardDelegator_Serviceable_Call {
return &MockShardDelegator_Serviceable_Call{Call: _e.mock.On("Serviceable")}
}
func (_c *MockShardDelegator_Serviceable_Call) Run(run func()) *MockShardDelegator_Serviceable_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_Serviceable_Call) Return(_a0 bool) *MockShardDelegator_Serviceable_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_Serviceable_Call) RunAndReturn(run func() bool) *MockShardDelegator_Serviceable_Call {
_c.Call.Return(run)
return _c
}
// Start provides a mock function with no fields
func (_m *MockShardDelegator) Start() {
_m.Called()
}
// MockShardDelegator_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
type MockShardDelegator_Start_Call struct {
*mock.Call
}
// Start is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) Start() *MockShardDelegator_Start_Call {
return &MockShardDelegator_Start_Call{Call: _e.mock.On("Start")}
}
func (_c *MockShardDelegator_Start_Call) Run(run func()) *MockShardDelegator_Start_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_Start_Call) Return() *MockShardDelegator_Start_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_Start_Call) RunAndReturn(run func()) *MockShardDelegator_Start_Call {
_c.Run(run)
return _c
}
// SyncDistribution provides a mock function with given fields: ctx, entries
func (_m *MockShardDelegator) SyncDistribution(ctx context.Context, entries ...SegmentEntry) {
_va := make([]interface{}, len(entries))
for _i := range entries {
_va[_i] = entries[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx)
_ca = append(_ca, _va...)
_m.Called(_ca...)
}
// MockShardDelegator_SyncDistribution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncDistribution'
type MockShardDelegator_SyncDistribution_Call struct {
*mock.Call
}
// SyncDistribution is a helper method to define mock.On call
// - ctx context.Context
// - entries ...SegmentEntry
func (_e *MockShardDelegator_Expecter) SyncDistribution(ctx interface{}, entries ...interface{}) *MockShardDelegator_SyncDistribution_Call {
return &MockShardDelegator_SyncDistribution_Call{Call: _e.mock.On("SyncDistribution",
append([]interface{}{ctx}, entries...)...)}
}
func (_c *MockShardDelegator_SyncDistribution_Call) Run(run func(ctx context.Context, entries ...SegmentEntry)) *MockShardDelegator_SyncDistribution_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]SegmentEntry, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(SegmentEntry)
}
}
run(args[0].(context.Context), variadicArgs...)
})
return _c
}
func (_c *MockShardDelegator_SyncDistribution_Call) Return() *MockShardDelegator_SyncDistribution_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_SyncDistribution_Call) RunAndReturn(run func(context.Context, ...SegmentEntry)) *MockShardDelegator_SyncDistribution_Call {
_c.Run(run)
return _c
}
// SyncPartitionStats provides a mock function with given fields: ctx, partVersions
func (_m *MockShardDelegator) SyncPartitionStats(ctx context.Context, partVersions map[int64]int64) {
_m.Called(ctx, partVersions)
}
// MockShardDelegator_SyncPartitionStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncPartitionStats'
type MockShardDelegator_SyncPartitionStats_Call struct {
*mock.Call
}
// SyncPartitionStats is a helper method to define mock.On call
// - ctx context.Context
// - partVersions map[int64]int64
func (_e *MockShardDelegator_Expecter) SyncPartitionStats(ctx interface{}, partVersions interface{}) *MockShardDelegator_SyncPartitionStats_Call {
return &MockShardDelegator_SyncPartitionStats_Call{Call: _e.mock.On("SyncPartitionStats", ctx, partVersions)}
}
func (_c *MockShardDelegator_SyncPartitionStats_Call) Run(run func(ctx context.Context, partVersions map[int64]int64)) *MockShardDelegator_SyncPartitionStats_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(map[int64]int64))
})
return _c
}
func (_c *MockShardDelegator_SyncPartitionStats_Call) Return() *MockShardDelegator_SyncPartitionStats_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_SyncPartitionStats_Call) RunAndReturn(run func(context.Context, map[int64]int64)) *MockShardDelegator_SyncPartitionStats_Call {
_c.Run(run)
return _c
}
// SyncTargetVersion provides a mock function with given fields: action, partitions
func (_m *MockShardDelegator) SyncTargetVersion(action *querypb.SyncAction, partitions []int64) {
_m.Called(action, partitions)
}
// MockShardDelegator_SyncTargetVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncTargetVersion'
type MockShardDelegator_SyncTargetVersion_Call struct {
*mock.Call
}
// SyncTargetVersion is a helper method to define mock.On call
// - action *querypb.SyncAction
// - partitions []int64
func (_e *MockShardDelegator_Expecter) SyncTargetVersion(action interface{}, partitions interface{}) *MockShardDelegator_SyncTargetVersion_Call {
return &MockShardDelegator_SyncTargetVersion_Call{Call: _e.mock.On("SyncTargetVersion", action, partitions)}
}
func (_c *MockShardDelegator_SyncTargetVersion_Call) Run(run func(action *querypb.SyncAction, partitions []int64)) *MockShardDelegator_SyncTargetVersion_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*querypb.SyncAction), args[1].([]int64))
})
return _c
}
func (_c *MockShardDelegator_SyncTargetVersion_Call) Return() *MockShardDelegator_SyncTargetVersion_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_SyncTargetVersion_Call) RunAndReturn(run func(*querypb.SyncAction, []int64)) *MockShardDelegator_SyncTargetVersion_Call {
_c.Run(run)
return _c
}
// TryCleanExcludedSegments provides a mock function with given fields: ts
func (_m *MockShardDelegator) TryCleanExcludedSegments(ts uint64) {
_m.Called(ts)
}
// MockShardDelegator_TryCleanExcludedSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TryCleanExcludedSegments'
type MockShardDelegator_TryCleanExcludedSegments_Call struct {
*mock.Call
}
// TryCleanExcludedSegments is a helper method to define mock.On call
// - ts uint64
func (_e *MockShardDelegator_Expecter) TryCleanExcludedSegments(ts interface{}) *MockShardDelegator_TryCleanExcludedSegments_Call {
return &MockShardDelegator_TryCleanExcludedSegments_Call{Call: _e.mock.On("TryCleanExcludedSegments", ts)}
}
func (_c *MockShardDelegator_TryCleanExcludedSegments_Call) Run(run func(ts uint64)) *MockShardDelegator_TryCleanExcludedSegments_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(uint64))
})
return _c
}
func (_c *MockShardDelegator_TryCleanExcludedSegments_Call) Return() *MockShardDelegator_TryCleanExcludedSegments_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_TryCleanExcludedSegments_Call) RunAndReturn(run func(uint64)) *MockShardDelegator_TryCleanExcludedSegments_Call {
_c.Run(run)
return _c
}
// UpdateSchema provides a mock function with given fields: ctx, sch, version
func (_m *MockShardDelegator) UpdateSchema(ctx context.Context, sch *schemapb.CollectionSchema, version uint64) error {
ret := _m.Called(ctx, sch, version)
if len(ret) == 0 {
panic("no return value specified for UpdateSchema")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *schemapb.CollectionSchema, uint64) error); ok {
r0 = rf(ctx, sch, version)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockShardDelegator_UpdateSchema_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSchema'
type MockShardDelegator_UpdateSchema_Call struct {
*mock.Call
}
// UpdateSchema is a helper method to define mock.On call
// - ctx context.Context
// - sch *schemapb.CollectionSchema
// - version uint64
func (_e *MockShardDelegator_Expecter) UpdateSchema(ctx interface{}, sch interface{}, version interface{}) *MockShardDelegator_UpdateSchema_Call {
return &MockShardDelegator_UpdateSchema_Call{Call: _e.mock.On("UpdateSchema", ctx, sch, version)}
}
func (_c *MockShardDelegator_UpdateSchema_Call) Run(run func(ctx context.Context, sch *schemapb.CollectionSchema, version uint64)) *MockShardDelegator_UpdateSchema_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*schemapb.CollectionSchema), args[2].(uint64))
})
return _c
}
func (_c *MockShardDelegator_UpdateSchema_Call) Return(_a0 error) *MockShardDelegator_UpdateSchema_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_UpdateSchema_Call) RunAndReturn(run func(context.Context, *schemapb.CollectionSchema, uint64) error) *MockShardDelegator_UpdateSchema_Call {
_c.Call.Return(run)
return _c
}
// UpdateTSafe provides a mock function with given fields: ts
func (_m *MockShardDelegator) UpdateTSafe(ts uint64) {
_m.Called(ts)
}
// MockShardDelegator_UpdateTSafe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTSafe'
type MockShardDelegator_UpdateTSafe_Call struct {
*mock.Call
}
// UpdateTSafe is a helper method to define mock.On call
// - ts uint64
func (_e *MockShardDelegator_Expecter) UpdateTSafe(ts interface{}) *MockShardDelegator_UpdateTSafe_Call {
return &MockShardDelegator_UpdateTSafe_Call{Call: _e.mock.On("UpdateTSafe", ts)}
}
func (_c *MockShardDelegator_UpdateTSafe_Call) Run(run func(ts uint64)) *MockShardDelegator_UpdateTSafe_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(uint64))
})
return _c
}
func (_c *MockShardDelegator_UpdateTSafe_Call) Return() *MockShardDelegator_UpdateTSafe_Call {
_c.Call.Return()
return _c
}
func (_c *MockShardDelegator_UpdateTSafe_Call) RunAndReturn(run func(uint64)) *MockShardDelegator_UpdateTSafe_Call {
_c.Run(run)
return _c
}
// VerifyExcludedSegments provides a mock function with given fields: segmentID, ts
func (_m *MockShardDelegator) VerifyExcludedSegments(segmentID int64, ts uint64) bool {
ret := _m.Called(segmentID, ts)
if len(ret) == 0 {
panic("no return value specified for VerifyExcludedSegments")
}
var r0 bool
if rf, ok := ret.Get(0).(func(int64, uint64) bool); ok {
r0 = rf(segmentID, ts)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockShardDelegator_VerifyExcludedSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyExcludedSegments'
type MockShardDelegator_VerifyExcludedSegments_Call struct {
*mock.Call
}
// VerifyExcludedSegments is a helper method to define mock.On call
// - segmentID int64
// - ts uint64
func (_e *MockShardDelegator_Expecter) VerifyExcludedSegments(segmentID interface{}, ts interface{}) *MockShardDelegator_VerifyExcludedSegments_Call {
return &MockShardDelegator_VerifyExcludedSegments_Call{Call: _e.mock.On("VerifyExcludedSegments", segmentID, ts)}
}
func (_c *MockShardDelegator_VerifyExcludedSegments_Call) Run(run func(segmentID int64, ts uint64)) *MockShardDelegator_VerifyExcludedSegments_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64), args[1].(uint64))
})
return _c
}
func (_c *MockShardDelegator_VerifyExcludedSegments_Call) Return(_a0 bool) *MockShardDelegator_VerifyExcludedSegments_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_VerifyExcludedSegments_Call) RunAndReturn(run func(int64, uint64) bool) *MockShardDelegator_VerifyExcludedSegments_Call {
_c.Call.Return(run)
return _c
}
// Version provides a mock function with no fields
func (_m *MockShardDelegator) Version() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Version")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockShardDelegator_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version'
type MockShardDelegator_Version_Call struct {
*mock.Call
}
// Version is a helper method to define mock.On call
func (_e *MockShardDelegator_Expecter) Version() *MockShardDelegator_Version_Call {
return &MockShardDelegator_Version_Call{Call: _e.mock.On("Version")}
}
func (_c *MockShardDelegator_Version_Call) Run(run func()) *MockShardDelegator_Version_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockShardDelegator_Version_Call) Return(_a0 int64) *MockShardDelegator_Version_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockShardDelegator_Version_Call) RunAndReturn(run func() int64) *MockShardDelegator_Version_Call {
_c.Call.Return(run)
return _c
}
// NewMockShardDelegator creates a new instance of MockShardDelegator. 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 NewMockShardDelegator(t interface {
mock.TestingT
Cleanup(func())
}) *MockShardDelegator {
mock := &MockShardDelegator{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}