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

2064 lines
57 KiB
Go

// Code generated by mockery v2.53.3. DO NOT EDIT.
package segments
import (
context "context"
commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
datapb "github.com/milvus-io/milvus/pkg/v2/proto/datapb"
metautil "github.com/milvus-io/milvus/pkg/v2/util/metautil"
mock "github.com/stretchr/testify/mock"
msgpb "github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
querypb "github.com/milvus-io/milvus/pkg/v2/proto/querypb"
segcore "github.com/milvus-io/milvus/internal/util/segcore"
segcorepb "github.com/milvus-io/milvus/pkg/v2/proto/segcorepb"
storage "github.com/milvus-io/milvus/internal/storage"
)
// MockSegment is an autogenerated mock type for the Segment type
type MockSegment struct {
mock.Mock
}
type MockSegment_Expecter struct {
mock *mock.Mock
}
func (_m *MockSegment) EXPECT() *MockSegment_Expecter {
return &MockSegment_Expecter{mock: &_m.Mock}
}
// BatchPkExist provides a mock function with given fields: lc
func (_m *MockSegment) BatchPkExist(lc *storage.BatchLocationsCache) []bool {
ret := _m.Called(lc)
if len(ret) == 0 {
panic("no return value specified for BatchPkExist")
}
var r0 []bool
if rf, ok := ret.Get(0).(func(*storage.BatchLocationsCache) []bool); ok {
r0 = rf(lc)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]bool)
}
}
return r0
}
// MockSegment_BatchPkExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchPkExist'
type MockSegment_BatchPkExist_Call struct {
*mock.Call
}
// BatchPkExist is a helper method to define mock.On call
// - lc *storage.BatchLocationsCache
func (_e *MockSegment_Expecter) BatchPkExist(lc interface{}) *MockSegment_BatchPkExist_Call {
return &MockSegment_BatchPkExist_Call{Call: _e.mock.On("BatchPkExist", lc)}
}
func (_c *MockSegment_BatchPkExist_Call) Run(run func(lc *storage.BatchLocationsCache)) *MockSegment_BatchPkExist_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*storage.BatchLocationsCache))
})
return _c
}
func (_c *MockSegment_BatchPkExist_Call) Return(_a0 []bool) *MockSegment_BatchPkExist_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_BatchPkExist_Call) RunAndReturn(run func(*storage.BatchLocationsCache) []bool) *MockSegment_BatchPkExist_Call {
_c.Call.Return(run)
return _c
}
// CASVersion provides a mock function with given fields: _a0, _a1
func (_m *MockSegment) CASVersion(_a0 int64, _a1 int64) bool {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for CASVersion")
}
var r0 bool
if rf, ok := ret.Get(0).(func(int64, int64) bool); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockSegment_CASVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CASVersion'
type MockSegment_CASVersion_Call struct {
*mock.Call
}
// CASVersion is a helper method to define mock.On call
// - _a0 int64
// - _a1 int64
func (_e *MockSegment_Expecter) CASVersion(_a0 interface{}, _a1 interface{}) *MockSegment_CASVersion_Call {
return &MockSegment_CASVersion_Call{Call: _e.mock.On("CASVersion", _a0, _a1)}
}
func (_c *MockSegment_CASVersion_Call) Run(run func(_a0 int64, _a1 int64)) *MockSegment_CASVersion_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64), args[1].(int64))
})
return _c
}
func (_c *MockSegment_CASVersion_Call) Return(_a0 bool) *MockSegment_CASVersion_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_CASVersion_Call) RunAndReturn(run func(int64, int64) bool) *MockSegment_CASVersion_Call {
_c.Call.Return(run)
return _c
}
// Collection provides a mock function with no fields
func (_m *MockSegment) 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
}
// MockSegment_Collection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Collection'
type MockSegment_Collection_Call struct {
*mock.Call
}
// Collection is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Collection() *MockSegment_Collection_Call {
return &MockSegment_Collection_Call{Call: _e.mock.On("Collection")}
}
func (_c *MockSegment_Collection_Call) Run(run func()) *MockSegment_Collection_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Collection_Call) Return(_a0 int64) *MockSegment_Collection_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Collection_Call) RunAndReturn(run func() int64) *MockSegment_Collection_Call {
_c.Call.Return(run)
return _c
}
// DatabaseName provides a mock function with no fields
func (_m *MockSegment) DatabaseName() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for DatabaseName")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockSegment_DatabaseName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DatabaseName'
type MockSegment_DatabaseName_Call struct {
*mock.Call
}
// DatabaseName is a helper method to define mock.On call
func (_e *MockSegment_Expecter) DatabaseName() *MockSegment_DatabaseName_Call {
return &MockSegment_DatabaseName_Call{Call: _e.mock.On("DatabaseName")}
}
func (_c *MockSegment_DatabaseName_Call) Run(run func()) *MockSegment_DatabaseName_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_DatabaseName_Call) Return(_a0 string) *MockSegment_DatabaseName_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_DatabaseName_Call) RunAndReturn(run func() string) *MockSegment_DatabaseName_Call {
_c.Call.Return(run)
return _c
}
// Delete provides a mock function with given fields: ctx, primaryKeys, timestamps
func (_m *MockSegment) Delete(ctx context.Context, primaryKeys storage.PrimaryKeys, timestamps []uint64) error {
ret := _m.Called(ctx, primaryKeys, timestamps)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, storage.PrimaryKeys, []uint64) error); ok {
r0 = rf(ctx, primaryKeys, timestamps)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSegment_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type MockSegment_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - ctx context.Context
// - primaryKeys storage.PrimaryKeys
// - timestamps []uint64
func (_e *MockSegment_Expecter) Delete(ctx interface{}, primaryKeys interface{}, timestamps interface{}) *MockSegment_Delete_Call {
return &MockSegment_Delete_Call{Call: _e.mock.On("Delete", ctx, primaryKeys, timestamps)}
}
func (_c *MockSegment_Delete_Call) Run(run func(ctx context.Context, primaryKeys storage.PrimaryKeys, timestamps []uint64)) *MockSegment_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(storage.PrimaryKeys), args[2].([]uint64))
})
return _c
}
func (_c *MockSegment_Delete_Call) Return(_a0 error) *MockSegment_Delete_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Delete_Call) RunAndReturn(run func(context.Context, storage.PrimaryKeys, []uint64) error) *MockSegment_Delete_Call {
_c.Call.Return(run)
return _c
}
// DropIndex provides a mock function with given fields: ctx, indexID
func (_m *MockSegment) DropIndex(ctx context.Context, indexID int64) error {
ret := _m.Called(ctx, indexID)
if len(ret) == 0 {
panic("no return value specified for DropIndex")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
r0 = rf(ctx, indexID)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSegment_DropIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIndex'
type MockSegment_DropIndex_Call struct {
*mock.Call
}
// DropIndex is a helper method to define mock.On call
// - ctx context.Context
// - indexID int64
func (_e *MockSegment_Expecter) DropIndex(ctx interface{}, indexID interface{}) *MockSegment_DropIndex_Call {
return &MockSegment_DropIndex_Call{Call: _e.mock.On("DropIndex", ctx, indexID)}
}
func (_c *MockSegment_DropIndex_Call) Run(run func(ctx context.Context, indexID int64)) *MockSegment_DropIndex_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(int64))
})
return _c
}
func (_c *MockSegment_DropIndex_Call) Return(_a0 error) *MockSegment_DropIndex_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_DropIndex_Call) RunAndReturn(run func(context.Context, int64) error) *MockSegment_DropIndex_Call {
_c.Call.Return(run)
return _c
}
// ExistIndex provides a mock function with given fields: fieldID
func (_m *MockSegment) ExistIndex(fieldID int64) bool {
ret := _m.Called(fieldID)
if len(ret) == 0 {
panic("no return value specified for ExistIndex")
}
var r0 bool
if rf, ok := ret.Get(0).(func(int64) bool); ok {
r0 = rf(fieldID)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockSegment_ExistIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExistIndex'
type MockSegment_ExistIndex_Call struct {
*mock.Call
}
// ExistIndex is a helper method to define mock.On call
// - fieldID int64
func (_e *MockSegment_Expecter) ExistIndex(fieldID interface{}) *MockSegment_ExistIndex_Call {
return &MockSegment_ExistIndex_Call{Call: _e.mock.On("ExistIndex", fieldID)}
}
func (_c *MockSegment_ExistIndex_Call) Run(run func(fieldID int64)) *MockSegment_ExistIndex_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64))
})
return _c
}
func (_c *MockSegment_ExistIndex_Call) Return(_a0 bool) *MockSegment_ExistIndex_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_ExistIndex_Call) RunAndReturn(run func(int64) bool) *MockSegment_ExistIndex_Call {
_c.Call.Return(run)
return _c
}
// FinishLoad provides a mock function with no fields
func (_m *MockSegment) FinishLoad() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for FinishLoad")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSegment_FinishLoad_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinishLoad'
type MockSegment_FinishLoad_Call struct {
*mock.Call
}
// FinishLoad is a helper method to define mock.On call
func (_e *MockSegment_Expecter) FinishLoad() *MockSegment_FinishLoad_Call {
return &MockSegment_FinishLoad_Call{Call: _e.mock.On("FinishLoad")}
}
func (_c *MockSegment_FinishLoad_Call) Run(run func()) *MockSegment_FinishLoad_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_FinishLoad_Call) Return(_a0 error) *MockSegment_FinishLoad_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_FinishLoad_Call) RunAndReturn(run func() error) *MockSegment_FinishLoad_Call {
_c.Call.Return(run)
return _c
}
// GetBM25Stats provides a mock function with no fields
func (_m *MockSegment) GetBM25Stats() map[int64]*storage.BM25Stats {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetBM25Stats")
}
var r0 map[int64]*storage.BM25Stats
if rf, ok := ret.Get(0).(func() map[int64]*storage.BM25Stats); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[int64]*storage.BM25Stats)
}
}
return r0
}
// MockSegment_GetBM25Stats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBM25Stats'
type MockSegment_GetBM25Stats_Call struct {
*mock.Call
}
// GetBM25Stats is a helper method to define mock.On call
func (_e *MockSegment_Expecter) GetBM25Stats() *MockSegment_GetBM25Stats_Call {
return &MockSegment_GetBM25Stats_Call{Call: _e.mock.On("GetBM25Stats")}
}
func (_c *MockSegment_GetBM25Stats_Call) Run(run func()) *MockSegment_GetBM25Stats_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_GetBM25Stats_Call) Return(_a0 map[int64]*storage.BM25Stats) *MockSegment_GetBM25Stats_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_GetBM25Stats_Call) RunAndReturn(run func() map[int64]*storage.BM25Stats) *MockSegment_GetBM25Stats_Call {
_c.Call.Return(run)
return _c
}
// GetFieldJSONIndexStats provides a mock function with no fields
func (_m *MockSegment) GetFieldJSONIndexStats() map[int64]*querypb.JsonStatsInfo {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetFieldJSONIndexStats")
}
var r0 map[int64]*querypb.JsonStatsInfo
if rf, ok := ret.Get(0).(func() map[int64]*querypb.JsonStatsInfo); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[int64]*querypb.JsonStatsInfo)
}
}
return r0
}
// MockSegment_GetFieldJSONIndexStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFieldJSONIndexStats'
type MockSegment_GetFieldJSONIndexStats_Call struct {
*mock.Call
}
// GetFieldJSONIndexStats is a helper method to define mock.On call
func (_e *MockSegment_Expecter) GetFieldJSONIndexStats() *MockSegment_GetFieldJSONIndexStats_Call {
return &MockSegment_GetFieldJSONIndexStats_Call{Call: _e.mock.On("GetFieldJSONIndexStats")}
}
func (_c *MockSegment_GetFieldJSONIndexStats_Call) Run(run func()) *MockSegment_GetFieldJSONIndexStats_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_GetFieldJSONIndexStats_Call) Return(_a0 []int64) *MockSegment_GetFieldJSONIndexStats_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_GetFieldJSONIndexStats_Call) RunAndReturn(run func() []int64) *MockSegment_GetFieldJSONIndexStats_Call {
_c.Call.Return(run)
return _c
}
// GetIndex provides a mock function with given fields: fieldID
func (_m *MockSegment) GetIndex(fieldID int64) []*IndexedFieldInfo {
ret := _m.Called(fieldID)
if len(ret) == 0 {
panic("no return value specified for GetIndex")
}
var r0 []*IndexedFieldInfo
if rf, ok := ret.Get(0).(func(int64) []*IndexedFieldInfo); ok {
r0 = rf(fieldID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*IndexedFieldInfo)
}
}
return r0
}
// MockSegment_GetIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndex'
type MockSegment_GetIndex_Call struct {
*mock.Call
}
// GetIndex is a helper method to define mock.On call
// - fieldID int64
func (_e *MockSegment_Expecter) GetIndex(fieldID interface{}) *MockSegment_GetIndex_Call {
return &MockSegment_GetIndex_Call{Call: _e.mock.On("GetIndex", fieldID)}
}
func (_c *MockSegment_GetIndex_Call) Run(run func(fieldID int64)) *MockSegment_GetIndex_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64))
})
return _c
}
func (_c *MockSegment_GetIndex_Call) Return(_a0 []*IndexedFieldInfo) *MockSegment_GetIndex_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_GetIndex_Call) RunAndReturn(run func(int64) []*IndexedFieldInfo) *MockSegment_GetIndex_Call {
_c.Call.Return(run)
return _c
}
// GetIndexByID provides a mock function with given fields: indexID
func (_m *MockSegment) GetIndexByID(indexID int64) *IndexedFieldInfo {
ret := _m.Called(indexID)
if len(ret) == 0 {
panic("no return value specified for GetIndexByID")
}
var r0 *IndexedFieldInfo
if rf, ok := ret.Get(0).(func(int64) *IndexedFieldInfo); ok {
r0 = rf(indexID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*IndexedFieldInfo)
}
}
return r0
}
// MockSegment_GetIndexByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndexByID'
type MockSegment_GetIndexByID_Call struct {
*mock.Call
}
// GetIndexByID is a helper method to define mock.On call
// - indexID int64
func (_e *MockSegment_Expecter) GetIndexByID(indexID interface{}) *MockSegment_GetIndexByID_Call {
return &MockSegment_GetIndexByID_Call{Call: _e.mock.On("GetIndexByID", indexID)}
}
func (_c *MockSegment_GetIndexByID_Call) Run(run func(indexID int64)) *MockSegment_GetIndexByID_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64))
})
return _c
}
func (_c *MockSegment_GetIndexByID_Call) Return(_a0 *IndexedFieldInfo) *MockSegment_GetIndexByID_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_GetIndexByID_Call) RunAndReturn(run func(int64) *IndexedFieldInfo) *MockSegment_GetIndexByID_Call {
_c.Call.Return(run)
return _c
}
// HasRawData provides a mock function with given fields: fieldID
func (_m *MockSegment) HasRawData(fieldID int64) bool {
ret := _m.Called(fieldID)
if len(ret) == 0 {
panic("no return value specified for HasRawData")
}
var r0 bool
if rf, ok := ret.Get(0).(func(int64) bool); ok {
r0 = rf(fieldID)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockSegment_HasRawData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasRawData'
type MockSegment_HasRawData_Call struct {
*mock.Call
}
// HasRawData is a helper method to define mock.On call
// - fieldID int64
func (_e *MockSegment_Expecter) HasRawData(fieldID interface{}) *MockSegment_HasRawData_Call {
return &MockSegment_HasRawData_Call{Call: _e.mock.On("HasRawData", fieldID)}
}
func (_c *MockSegment_HasRawData_Call) Run(run func(fieldID int64)) *MockSegment_HasRawData_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int64))
})
return _c
}
func (_c *MockSegment_HasRawData_Call) Return(_a0 bool) *MockSegment_HasRawData_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_HasRawData_Call) RunAndReturn(run func(int64) bool) *MockSegment_HasRawData_Call {
_c.Call.Return(run)
return _c
}
// ID provides a mock function with no fields
func (_m *MockSegment) ID() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for ID")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockSegment_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID'
type MockSegment_ID_Call struct {
*mock.Call
}
// ID is a helper method to define mock.On call
func (_e *MockSegment_Expecter) ID() *MockSegment_ID_Call {
return &MockSegment_ID_Call{Call: _e.mock.On("ID")}
}
func (_c *MockSegment_ID_Call) Run(run func()) *MockSegment_ID_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_ID_Call) Return(_a0 int64) *MockSegment_ID_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_ID_Call) RunAndReturn(run func() int64) *MockSegment_ID_Call {
_c.Call.Return(run)
return _c
}
// Indexes provides a mock function with no fields
func (_m *MockSegment) Indexes() []*IndexedFieldInfo {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Indexes")
}
var r0 []*IndexedFieldInfo
if rf, ok := ret.Get(0).(func() []*IndexedFieldInfo); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*IndexedFieldInfo)
}
}
return r0
}
// MockSegment_Indexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Indexes'
type MockSegment_Indexes_Call struct {
*mock.Call
}
// Indexes is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Indexes() *MockSegment_Indexes_Call {
return &MockSegment_Indexes_Call{Call: _e.mock.On("Indexes")}
}
func (_c *MockSegment_Indexes_Call) Run(run func()) *MockSegment_Indexes_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Indexes_Call) Return(_a0 []*IndexedFieldInfo) *MockSegment_Indexes_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Indexes_Call) RunAndReturn(run func() []*IndexedFieldInfo) *MockSegment_Indexes_Call {
_c.Call.Return(run)
return _c
}
// Insert provides a mock function with given fields: ctx, rowIDs, timestamps, record
func (_m *MockSegment) Insert(ctx context.Context, rowIDs []int64, timestamps []uint64, record *segcorepb.InsertRecord) error {
ret := _m.Called(ctx, rowIDs, timestamps, record)
if len(ret) == 0 {
panic("no return value specified for Insert")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []int64, []uint64, *segcorepb.InsertRecord) error); ok {
r0 = rf(ctx, rowIDs, timestamps, record)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSegment_Insert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Insert'
type MockSegment_Insert_Call struct {
*mock.Call
}
// Insert is a helper method to define mock.On call
// - ctx context.Context
// - rowIDs []int64
// - timestamps []uint64
// - record *segcorepb.InsertRecord
func (_e *MockSegment_Expecter) Insert(ctx interface{}, rowIDs interface{}, timestamps interface{}, record interface{}) *MockSegment_Insert_Call {
return &MockSegment_Insert_Call{Call: _e.mock.On("Insert", ctx, rowIDs, timestamps, record)}
}
func (_c *MockSegment_Insert_Call) Run(run func(ctx context.Context, rowIDs []int64, timestamps []uint64, record *segcorepb.InsertRecord)) *MockSegment_Insert_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].([]int64), args[2].([]uint64), args[3].(*segcorepb.InsertRecord))
})
return _c
}
func (_c *MockSegment_Insert_Call) Return(_a0 error) *MockSegment_Insert_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Insert_Call) RunAndReturn(run func(context.Context, []int64, []uint64, *segcorepb.InsertRecord) error) *MockSegment_Insert_Call {
_c.Call.Return(run)
return _c
}
// InsertCount provides a mock function with no fields
func (_m *MockSegment) InsertCount() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for InsertCount")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockSegment_InsertCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertCount'
type MockSegment_InsertCount_Call struct {
*mock.Call
}
// InsertCount is a helper method to define mock.On call
func (_e *MockSegment_Expecter) InsertCount() *MockSegment_InsertCount_Call {
return &MockSegment_InsertCount_Call{Call: _e.mock.On("InsertCount")}
}
func (_c *MockSegment_InsertCount_Call) Run(run func()) *MockSegment_InsertCount_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_InsertCount_Call) Return(_a0 int64) *MockSegment_InsertCount_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_InsertCount_Call) RunAndReturn(run func() int64) *MockSegment_InsertCount_Call {
_c.Call.Return(run)
return _c
}
// IsLazyLoad provides a mock function with no fields
func (_m *MockSegment) IsLazyLoad() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsLazyLoad")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockSegment_IsLazyLoad_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsLazyLoad'
type MockSegment_IsLazyLoad_Call struct {
*mock.Call
}
// IsLazyLoad is a helper method to define mock.On call
func (_e *MockSegment_Expecter) IsLazyLoad() *MockSegment_IsLazyLoad_Call {
return &MockSegment_IsLazyLoad_Call{Call: _e.mock.On("IsLazyLoad")}
}
func (_c *MockSegment_IsLazyLoad_Call) Run(run func()) *MockSegment_IsLazyLoad_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_IsLazyLoad_Call) Return(_a0 bool) *MockSegment_IsLazyLoad_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_IsLazyLoad_Call) RunAndReturn(run func() bool) *MockSegment_IsLazyLoad_Call {
_c.Call.Return(run)
return _c
}
// IsSorted provides a mock function with no fields
func (_m *MockSegment) IsSorted() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsSorted")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockSegment_IsSorted_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSorted'
type MockSegment_IsSorted_Call struct {
*mock.Call
}
// IsSorted is a helper method to define mock.On call
func (_e *MockSegment_Expecter) IsSorted() *MockSegment_IsSorted_Call {
return &MockSegment_IsSorted_Call{Call: _e.mock.On("IsSorted")}
}
func (_c *MockSegment_IsSorted_Call) Run(run func()) *MockSegment_IsSorted_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_IsSorted_Call) Return(_a0 bool) *MockSegment_IsSorted_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_IsSorted_Call) RunAndReturn(run func() bool) *MockSegment_IsSorted_Call {
_c.Call.Return(run)
return _c
}
// LastDeltaTimestamp provides a mock function with no fields
func (_m *MockSegment) LastDeltaTimestamp() uint64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for LastDeltaTimestamp")
}
var r0 uint64
if rf, ok := ret.Get(0).(func() uint64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint64)
}
return r0
}
// MockSegment_LastDeltaTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastDeltaTimestamp'
type MockSegment_LastDeltaTimestamp_Call struct {
*mock.Call
}
// LastDeltaTimestamp is a helper method to define mock.On call
func (_e *MockSegment_Expecter) LastDeltaTimestamp() *MockSegment_LastDeltaTimestamp_Call {
return &MockSegment_LastDeltaTimestamp_Call{Call: _e.mock.On("LastDeltaTimestamp")}
}
func (_c *MockSegment_LastDeltaTimestamp_Call) Run(run func()) *MockSegment_LastDeltaTimestamp_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_LastDeltaTimestamp_Call) Return(_a0 uint64) *MockSegment_LastDeltaTimestamp_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_LastDeltaTimestamp_Call) RunAndReturn(run func() uint64) *MockSegment_LastDeltaTimestamp_Call {
_c.Call.Return(run)
return _c
}
// Level provides a mock function with no fields
func (_m *MockSegment) Level() datapb.SegmentLevel {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Level")
}
var r0 datapb.SegmentLevel
if rf, ok := ret.Get(0).(func() datapb.SegmentLevel); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(datapb.SegmentLevel)
}
return r0
}
// MockSegment_Level_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Level'
type MockSegment_Level_Call struct {
*mock.Call
}
// Level is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Level() *MockSegment_Level_Call {
return &MockSegment_Level_Call{Call: _e.mock.On("Level")}
}
func (_c *MockSegment_Level_Call) Run(run func()) *MockSegment_Level_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Level_Call) Return(_a0 datapb.SegmentLevel) *MockSegment_Level_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Level_Call) RunAndReturn(run func() datapb.SegmentLevel) *MockSegment_Level_Call {
_c.Call.Return(run)
return _c
}
// LoadDeltaData provides a mock function with given fields: ctx, deltaData
func (_m *MockSegment) LoadDeltaData(ctx context.Context, deltaData *storage.DeltaData) error {
ret := _m.Called(ctx, deltaData)
if len(ret) == 0 {
panic("no return value specified for LoadDeltaData")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *storage.DeltaData) error); ok {
r0 = rf(ctx, deltaData)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSegment_LoadDeltaData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadDeltaData'
type MockSegment_LoadDeltaData_Call struct {
*mock.Call
}
// LoadDeltaData is a helper method to define mock.On call
// - ctx context.Context
// - deltaData *storage.DeltaData
func (_e *MockSegment_Expecter) LoadDeltaData(ctx interface{}, deltaData interface{}) *MockSegment_LoadDeltaData_Call {
return &MockSegment_LoadDeltaData_Call{Call: _e.mock.On("LoadDeltaData", ctx, deltaData)}
}
func (_c *MockSegment_LoadDeltaData_Call) Run(run func(ctx context.Context, deltaData *storage.DeltaData)) *MockSegment_LoadDeltaData_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*storage.DeltaData))
})
return _c
}
func (_c *MockSegment_LoadDeltaData_Call) Return(_a0 error) *MockSegment_LoadDeltaData_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_LoadDeltaData_Call) RunAndReturn(run func(context.Context, *storage.DeltaData) error) *MockSegment_LoadDeltaData_Call {
_c.Call.Return(run)
return _c
}
// LoadInfo provides a mock function with no fields
func (_m *MockSegment) LoadInfo() *querypb.SegmentLoadInfo {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for LoadInfo")
}
var r0 *querypb.SegmentLoadInfo
if rf, ok := ret.Get(0).(func() *querypb.SegmentLoadInfo); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*querypb.SegmentLoadInfo)
}
}
return r0
}
// MockSegment_LoadInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadInfo'
type MockSegment_LoadInfo_Call struct {
*mock.Call
}
// LoadInfo is a helper method to define mock.On call
func (_e *MockSegment_Expecter) LoadInfo() *MockSegment_LoadInfo_Call {
return &MockSegment_LoadInfo_Call{Call: _e.mock.On("LoadInfo")}
}
func (_c *MockSegment_LoadInfo_Call) Run(run func()) *MockSegment_LoadInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_LoadInfo_Call) Return(_a0 *querypb.SegmentLoadInfo) *MockSegment_LoadInfo_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_LoadInfo_Call) RunAndReturn(run func() *querypb.SegmentLoadInfo) *MockSegment_LoadInfo_Call {
_c.Call.Return(run)
return _c
}
// MayPkExist provides a mock function with given fields: lc
func (_m *MockSegment) MayPkExist(lc *storage.LocationsCache) bool {
ret := _m.Called(lc)
if len(ret) == 0 {
panic("no return value specified for MayPkExist")
}
var r0 bool
if rf, ok := ret.Get(0).(func(*storage.LocationsCache) bool); ok {
r0 = rf(lc)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockSegment_MayPkExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MayPkExist'
type MockSegment_MayPkExist_Call struct {
*mock.Call
}
// MayPkExist is a helper method to define mock.On call
// - lc *storage.LocationsCache
func (_e *MockSegment_Expecter) MayPkExist(lc interface{}) *MockSegment_MayPkExist_Call {
return &MockSegment_MayPkExist_Call{Call: _e.mock.On("MayPkExist", lc)}
}
func (_c *MockSegment_MayPkExist_Call) Run(run func(lc *storage.LocationsCache)) *MockSegment_MayPkExist_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*storage.LocationsCache))
})
return _c
}
func (_c *MockSegment_MayPkExist_Call) Return(_a0 bool) *MockSegment_MayPkExist_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_MayPkExist_Call) RunAndReturn(run func(*storage.LocationsCache) bool) *MockSegment_MayPkExist_Call {
_c.Call.Return(run)
return _c
}
// MemSize provides a mock function with no fields
func (_m *MockSegment) MemSize() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for MemSize")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockSegment_MemSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MemSize'
type MockSegment_MemSize_Call struct {
*mock.Call
}
// MemSize is a helper method to define mock.On call
func (_e *MockSegment_Expecter) MemSize() *MockSegment_MemSize_Call {
return &MockSegment_MemSize_Call{Call: _e.mock.On("MemSize")}
}
func (_c *MockSegment_MemSize_Call) Run(run func()) *MockSegment_MemSize_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_MemSize_Call) Return(_a0 int64) *MockSegment_MemSize_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_MemSize_Call) RunAndReturn(run func() int64) *MockSegment_MemSize_Call {
_c.Call.Return(run)
return _c
}
// NeedUpdatedVersion provides a mock function with no fields
func (_m *MockSegment) NeedUpdatedVersion() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for NeedUpdatedVersion")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockSegment_NeedUpdatedVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NeedUpdatedVersion'
type MockSegment_NeedUpdatedVersion_Call struct {
*mock.Call
}
// NeedUpdatedVersion is a helper method to define mock.On call
func (_e *MockSegment_Expecter) NeedUpdatedVersion() *MockSegment_NeedUpdatedVersion_Call {
return &MockSegment_NeedUpdatedVersion_Call{Call: _e.mock.On("NeedUpdatedVersion")}
}
func (_c *MockSegment_NeedUpdatedVersion_Call) Run(run func()) *MockSegment_NeedUpdatedVersion_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_NeedUpdatedVersion_Call) Return(_a0 int64) *MockSegment_NeedUpdatedVersion_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_NeedUpdatedVersion_Call) RunAndReturn(run func() int64) *MockSegment_NeedUpdatedVersion_Call {
_c.Call.Return(run)
return _c
}
// Partition provides a mock function with no fields
func (_m *MockSegment) Partition() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Partition")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockSegment_Partition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Partition'
type MockSegment_Partition_Call struct {
*mock.Call
}
// Partition is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Partition() *MockSegment_Partition_Call {
return &MockSegment_Partition_Call{Call: _e.mock.On("Partition")}
}
func (_c *MockSegment_Partition_Call) Run(run func()) *MockSegment_Partition_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Partition_Call) Return(_a0 int64) *MockSegment_Partition_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Partition_Call) RunAndReturn(run func() int64) *MockSegment_Partition_Call {
_c.Call.Return(run)
return _c
}
// PinIfNotReleased provides a mock function with no fields
func (_m *MockSegment) PinIfNotReleased() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for PinIfNotReleased")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSegment_PinIfNotReleased_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PinIfNotReleased'
type MockSegment_PinIfNotReleased_Call struct {
*mock.Call
}
// PinIfNotReleased is a helper method to define mock.On call
func (_e *MockSegment_Expecter) PinIfNotReleased() *MockSegment_PinIfNotReleased_Call {
return &MockSegment_PinIfNotReleased_Call{Call: _e.mock.On("PinIfNotReleased")}
}
func (_c *MockSegment_PinIfNotReleased_Call) Run(run func()) *MockSegment_PinIfNotReleased_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_PinIfNotReleased_Call) Return(_a0 error) *MockSegment_PinIfNotReleased_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_PinIfNotReleased_Call) RunAndReturn(run func() error) *MockSegment_PinIfNotReleased_Call {
_c.Call.Return(run)
return _c
}
// Release provides a mock function with given fields: ctx, opts
func (_m *MockSegment) Release(ctx context.Context, opts ...releaseOption) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx)
_ca = append(_ca, _va...)
_m.Called(_ca...)
}
// MockSegment_Release_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Release'
type MockSegment_Release_Call struct {
*mock.Call
}
// Release is a helper method to define mock.On call
// - ctx context.Context
// - opts ...releaseOption
func (_e *MockSegment_Expecter) Release(ctx interface{}, opts ...interface{}) *MockSegment_Release_Call {
return &MockSegment_Release_Call{Call: _e.mock.On("Release",
append([]interface{}{ctx}, opts...)...)}
}
func (_c *MockSegment_Release_Call) Run(run func(ctx context.Context, opts ...releaseOption)) *MockSegment_Release_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]releaseOption, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(releaseOption)
}
}
run(args[0].(context.Context), variadicArgs...)
})
return _c
}
func (_c *MockSegment_Release_Call) Return() *MockSegment_Release_Call {
_c.Call.Return()
return _c
}
func (_c *MockSegment_Release_Call) RunAndReturn(run func(context.Context, ...releaseOption)) *MockSegment_Release_Call {
_c.Run(run)
return _c
}
// RemoveUnusedFieldFiles provides a mock function with no fields
func (_m *MockSegment) RemoveUnusedFieldFiles() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for RemoveUnusedFieldFiles")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSegment_RemoveUnusedFieldFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUnusedFieldFiles'
type MockSegment_RemoveUnusedFieldFiles_Call struct {
*mock.Call
}
// RemoveUnusedFieldFiles is a helper method to define mock.On call
func (_e *MockSegment_Expecter) RemoveUnusedFieldFiles() *MockSegment_RemoveUnusedFieldFiles_Call {
return &MockSegment_RemoveUnusedFieldFiles_Call{Call: _e.mock.On("RemoveUnusedFieldFiles")}
}
func (_c *MockSegment_RemoveUnusedFieldFiles_Call) Run(run func()) *MockSegment_RemoveUnusedFieldFiles_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_RemoveUnusedFieldFiles_Call) Return(_a0 error) *MockSegment_RemoveUnusedFieldFiles_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_RemoveUnusedFieldFiles_Call) RunAndReturn(run func() error) *MockSegment_RemoveUnusedFieldFiles_Call {
_c.Call.Return(run)
return _c
}
// ResetIndexesLazyLoad provides a mock function with given fields: lazyState
func (_m *MockSegment) ResetIndexesLazyLoad(lazyState bool) {
_m.Called(lazyState)
}
// MockSegment_ResetIndexesLazyLoad_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetIndexesLazyLoad'
type MockSegment_ResetIndexesLazyLoad_Call struct {
*mock.Call
}
// ResetIndexesLazyLoad is a helper method to define mock.On call
// - lazyState bool
func (_e *MockSegment_Expecter) ResetIndexesLazyLoad(lazyState interface{}) *MockSegment_ResetIndexesLazyLoad_Call {
return &MockSegment_ResetIndexesLazyLoad_Call{Call: _e.mock.On("ResetIndexesLazyLoad", lazyState)}
}
func (_c *MockSegment_ResetIndexesLazyLoad_Call) Run(run func(lazyState bool)) *MockSegment_ResetIndexesLazyLoad_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(bool))
})
return _c
}
func (_c *MockSegment_ResetIndexesLazyLoad_Call) Return() *MockSegment_ResetIndexesLazyLoad_Call {
_c.Call.Return()
return _c
}
func (_c *MockSegment_ResetIndexesLazyLoad_Call) RunAndReturn(run func(bool)) *MockSegment_ResetIndexesLazyLoad_Call {
_c.Run(run)
return _c
}
// ResourceGroup provides a mock function with no fields
func (_m *MockSegment) ResourceGroup() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for ResourceGroup")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockSegment_ResourceGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResourceGroup'
type MockSegment_ResourceGroup_Call struct {
*mock.Call
}
// ResourceGroup is a helper method to define mock.On call
func (_e *MockSegment_Expecter) ResourceGroup() *MockSegment_ResourceGroup_Call {
return &MockSegment_ResourceGroup_Call{Call: _e.mock.On("ResourceGroup")}
}
func (_c *MockSegment_ResourceGroup_Call) Run(run func()) *MockSegment_ResourceGroup_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_ResourceGroup_Call) Return(_a0 string) *MockSegment_ResourceGroup_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_ResourceGroup_Call) RunAndReturn(run func() string) *MockSegment_ResourceGroup_Call {
_c.Call.Return(run)
return _c
}
// ResourceUsageEstimate provides a mock function with no fields
func (_m *MockSegment) ResourceUsageEstimate() ResourceUsage {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for ResourceUsageEstimate")
}
var r0 ResourceUsage
if rf, ok := ret.Get(0).(func() ResourceUsage); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(ResourceUsage)
}
return r0
}
// MockSegment_ResourceUsageEstimate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResourceUsageEstimate'
type MockSegment_ResourceUsageEstimate_Call struct {
*mock.Call
}
// ResourceUsageEstimate is a helper method to define mock.On call
func (_e *MockSegment_Expecter) ResourceUsageEstimate() *MockSegment_ResourceUsageEstimate_Call {
return &MockSegment_ResourceUsageEstimate_Call{Call: _e.mock.On("ResourceUsageEstimate")}
}
func (_c *MockSegment_ResourceUsageEstimate_Call) Run(run func()) *MockSegment_ResourceUsageEstimate_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_ResourceUsageEstimate_Call) Return(_a0 ResourceUsage) *MockSegment_ResourceUsageEstimate_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_ResourceUsageEstimate_Call) RunAndReturn(run func() ResourceUsage) *MockSegment_ResourceUsageEstimate_Call {
_c.Call.Return(run)
return _c
}
// Retrieve provides a mock function with given fields: ctx, plan
func (_m *MockSegment) Retrieve(ctx context.Context, plan *segcore.RetrievePlan) (*segcorepb.RetrieveResults, error) {
ret := _m.Called(ctx, plan)
if len(ret) == 0 {
panic("no return value specified for Retrieve")
}
var r0 *segcorepb.RetrieveResults
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *segcore.RetrievePlan) (*segcorepb.RetrieveResults, error)); ok {
return rf(ctx, plan)
}
if rf, ok := ret.Get(0).(func(context.Context, *segcore.RetrievePlan) *segcorepb.RetrieveResults); ok {
r0 = rf(ctx, plan)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*segcorepb.RetrieveResults)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *segcore.RetrievePlan) error); ok {
r1 = rf(ctx, plan)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockSegment_Retrieve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Retrieve'
type MockSegment_Retrieve_Call struct {
*mock.Call
}
// Retrieve is a helper method to define mock.On call
// - ctx context.Context
// - plan *segcore.RetrievePlan
func (_e *MockSegment_Expecter) Retrieve(ctx interface{}, plan interface{}) *MockSegment_Retrieve_Call {
return &MockSegment_Retrieve_Call{Call: _e.mock.On("Retrieve", ctx, plan)}
}
func (_c *MockSegment_Retrieve_Call) Run(run func(ctx context.Context, plan *segcore.RetrievePlan)) *MockSegment_Retrieve_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*segcore.RetrievePlan))
})
return _c
}
func (_c *MockSegment_Retrieve_Call) Return(_a0 *segcorepb.RetrieveResults, _a1 error) *MockSegment_Retrieve_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockSegment_Retrieve_Call) RunAndReturn(run func(context.Context, *segcore.RetrievePlan) (*segcorepb.RetrieveResults, error)) *MockSegment_Retrieve_Call {
_c.Call.Return(run)
return _c
}
// RetrieveByOffsets provides a mock function with given fields: ctx, plan
func (_m *MockSegment) RetrieveByOffsets(ctx context.Context, plan *segcore.RetrievePlanWithOffsets) (*segcorepb.RetrieveResults, error) {
ret := _m.Called(ctx, plan)
if len(ret) == 0 {
panic("no return value specified for RetrieveByOffsets")
}
var r0 *segcorepb.RetrieveResults
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *segcore.RetrievePlanWithOffsets) (*segcorepb.RetrieveResults, error)); ok {
return rf(ctx, plan)
}
if rf, ok := ret.Get(0).(func(context.Context, *segcore.RetrievePlanWithOffsets) *segcorepb.RetrieveResults); ok {
r0 = rf(ctx, plan)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*segcorepb.RetrieveResults)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *segcore.RetrievePlanWithOffsets) error); ok {
r1 = rf(ctx, plan)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockSegment_RetrieveByOffsets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveByOffsets'
type MockSegment_RetrieveByOffsets_Call struct {
*mock.Call
}
// RetrieveByOffsets is a helper method to define mock.On call
// - ctx context.Context
// - plan *segcore.RetrievePlanWithOffsets
func (_e *MockSegment_Expecter) RetrieveByOffsets(ctx interface{}, plan interface{}) *MockSegment_RetrieveByOffsets_Call {
return &MockSegment_RetrieveByOffsets_Call{Call: _e.mock.On("RetrieveByOffsets", ctx, plan)}
}
func (_c *MockSegment_RetrieveByOffsets_Call) Run(run func(ctx context.Context, plan *segcore.RetrievePlanWithOffsets)) *MockSegment_RetrieveByOffsets_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*segcore.RetrievePlanWithOffsets))
})
return _c
}
func (_c *MockSegment_RetrieveByOffsets_Call) Return(_a0 *segcorepb.RetrieveResults, _a1 error) *MockSegment_RetrieveByOffsets_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockSegment_RetrieveByOffsets_Call) RunAndReturn(run func(context.Context, *segcore.RetrievePlanWithOffsets) (*segcorepb.RetrieveResults, error)) *MockSegment_RetrieveByOffsets_Call {
_c.Call.Return(run)
return _c
}
// RowNum provides a mock function with no fields
func (_m *MockSegment) RowNum() int64 {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for RowNum")
}
var r0 int64
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
return r0
}
// MockSegment_RowNum_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RowNum'
type MockSegment_RowNum_Call struct {
*mock.Call
}
// RowNum is a helper method to define mock.On call
func (_e *MockSegment_Expecter) RowNum() *MockSegment_RowNum_Call {
return &MockSegment_RowNum_Call{Call: _e.mock.On("RowNum")}
}
func (_c *MockSegment_RowNum_Call) Run(run func()) *MockSegment_RowNum_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_RowNum_Call) Return(_a0 int64) *MockSegment_RowNum_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_RowNum_Call) RunAndReturn(run func() int64) *MockSegment_RowNum_Call {
_c.Call.Return(run)
return _c
}
// Search provides a mock function with given fields: ctx, searchReq
func (_m *MockSegment) Search(ctx context.Context, searchReq *segcore.SearchRequest) (*segcore.SearchResult, error) {
ret := _m.Called(ctx, searchReq)
if len(ret) == 0 {
panic("no return value specified for Search")
}
var r0 *segcore.SearchResult
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *segcore.SearchRequest) (*segcore.SearchResult, error)); ok {
return rf(ctx, searchReq)
}
if rf, ok := ret.Get(0).(func(context.Context, *segcore.SearchRequest) *segcore.SearchResult); ok {
r0 = rf(ctx, searchReq)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*segcore.SearchResult)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *segcore.SearchRequest) error); ok {
r1 = rf(ctx, searchReq)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockSegment_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search'
type MockSegment_Search_Call struct {
*mock.Call
}
// Search is a helper method to define mock.On call
// - ctx context.Context
// - searchReq *segcore.SearchRequest
func (_e *MockSegment_Expecter) Search(ctx interface{}, searchReq interface{}) *MockSegment_Search_Call {
return &MockSegment_Search_Call{Call: _e.mock.On("Search", ctx, searchReq)}
}
func (_c *MockSegment_Search_Call) Run(run func(ctx context.Context, searchReq *segcore.SearchRequest)) *MockSegment_Search_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*segcore.SearchRequest))
})
return _c
}
func (_c *MockSegment_Search_Call) Return(_a0 *segcore.SearchResult, _a1 error) *MockSegment_Search_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockSegment_Search_Call) RunAndReturn(run func(context.Context, *segcore.SearchRequest) (*segcore.SearchResult, error)) *MockSegment_Search_Call {
_c.Call.Return(run)
return _c
}
// Shard provides a mock function with no fields
func (_m *MockSegment) Shard() metautil.Channel {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Shard")
}
var r0 metautil.Channel
if rf, ok := ret.Get(0).(func() metautil.Channel); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(metautil.Channel)
}
return r0
}
// MockSegment_Shard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shard'
type MockSegment_Shard_Call struct {
*mock.Call
}
// Shard is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Shard() *MockSegment_Shard_Call {
return &MockSegment_Shard_Call{Call: _e.mock.On("Shard")}
}
func (_c *MockSegment_Shard_Call) Run(run func()) *MockSegment_Shard_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Shard_Call) Return(_a0 metautil.Channel) *MockSegment_Shard_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Shard_Call) RunAndReturn(run func() metautil.Channel) *MockSegment_Shard_Call {
_c.Call.Return(run)
return _c
}
// StartPosition provides a mock function with no fields
func (_m *MockSegment) StartPosition() *msgpb.MsgPosition {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for StartPosition")
}
var r0 *msgpb.MsgPosition
if rf, ok := ret.Get(0).(func() *msgpb.MsgPosition); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*msgpb.MsgPosition)
}
}
return r0
}
// MockSegment_StartPosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartPosition'
type MockSegment_StartPosition_Call struct {
*mock.Call
}
// StartPosition is a helper method to define mock.On call
func (_e *MockSegment_Expecter) StartPosition() *MockSegment_StartPosition_Call {
return &MockSegment_StartPosition_Call{Call: _e.mock.On("StartPosition")}
}
func (_c *MockSegment_StartPosition_Call) Run(run func()) *MockSegment_StartPosition_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_StartPosition_Call) Return(_a0 *msgpb.MsgPosition) *MockSegment_StartPosition_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_StartPosition_Call) RunAndReturn(run func() *msgpb.MsgPosition) *MockSegment_StartPosition_Call {
_c.Call.Return(run)
return _c
}
// Type provides a mock function with no fields
func (_m *MockSegment) Type() commonpb.SegmentState {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Type")
}
var r0 commonpb.SegmentState
if rf, ok := ret.Get(0).(func() commonpb.SegmentState); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(commonpb.SegmentState)
}
return r0
}
// MockSegment_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type'
type MockSegment_Type_Call struct {
*mock.Call
}
// Type is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Type() *MockSegment_Type_Call {
return &MockSegment_Type_Call{Call: _e.mock.On("Type")}
}
func (_c *MockSegment_Type_Call) Run(run func()) *MockSegment_Type_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Type_Call) Return(_a0 commonpb.SegmentState) *MockSegment_Type_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Type_Call) RunAndReturn(run func() commonpb.SegmentState) *MockSegment_Type_Call {
_c.Call.Return(run)
return _c
}
// Unpin provides a mock function with no fields
func (_m *MockSegment) Unpin() {
_m.Called()
}
// MockSegment_Unpin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unpin'
type MockSegment_Unpin_Call struct {
*mock.Call
}
// Unpin is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Unpin() *MockSegment_Unpin_Call {
return &MockSegment_Unpin_Call{Call: _e.mock.On("Unpin")}
}
func (_c *MockSegment_Unpin_Call) Run(run func()) *MockSegment_Unpin_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Unpin_Call) Return() *MockSegment_Unpin_Call {
_c.Call.Return()
return _c
}
func (_c *MockSegment_Unpin_Call) RunAndReturn(run func()) *MockSegment_Unpin_Call {
_c.Run(run)
return _c
}
// UpdateBM25Stats provides a mock function with given fields: stats
func (_m *MockSegment) UpdateBM25Stats(stats map[int64]*storage.BM25Stats) {
_m.Called(stats)
}
// MockSegment_UpdateBM25Stats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBM25Stats'
type MockSegment_UpdateBM25Stats_Call struct {
*mock.Call
}
// UpdateBM25Stats is a helper method to define mock.On call
// - stats map[int64]*storage.BM25Stats
func (_e *MockSegment_Expecter) UpdateBM25Stats(stats interface{}) *MockSegment_UpdateBM25Stats_Call {
return &MockSegment_UpdateBM25Stats_Call{Call: _e.mock.On("UpdateBM25Stats", stats)}
}
func (_c *MockSegment_UpdateBM25Stats_Call) Run(run func(stats map[int64]*storage.BM25Stats)) *MockSegment_UpdateBM25Stats_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(map[int64]*storage.BM25Stats))
})
return _c
}
func (_c *MockSegment_UpdateBM25Stats_Call) Return() *MockSegment_UpdateBM25Stats_Call {
_c.Call.Return()
return _c
}
func (_c *MockSegment_UpdateBM25Stats_Call) RunAndReturn(run func(map[int64]*storage.BM25Stats)) *MockSegment_UpdateBM25Stats_Call {
_c.Run(run)
return _c
}
// UpdateBloomFilter provides a mock function with given fields: pks
func (_m *MockSegment) UpdateBloomFilter(pks []storage.PrimaryKey) {
_m.Called(pks)
}
// MockSegment_UpdateBloomFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBloomFilter'
type MockSegment_UpdateBloomFilter_Call struct {
*mock.Call
}
// UpdateBloomFilter is a helper method to define mock.On call
// - pks []storage.PrimaryKey
func (_e *MockSegment_Expecter) UpdateBloomFilter(pks interface{}) *MockSegment_UpdateBloomFilter_Call {
return &MockSegment_UpdateBloomFilter_Call{Call: _e.mock.On("UpdateBloomFilter", pks)}
}
func (_c *MockSegment_UpdateBloomFilter_Call) Run(run func(pks []storage.PrimaryKey)) *MockSegment_UpdateBloomFilter_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]storage.PrimaryKey))
})
return _c
}
func (_c *MockSegment_UpdateBloomFilter_Call) Return() *MockSegment_UpdateBloomFilter_Call {
_c.Call.Return()
return _c
}
func (_c *MockSegment_UpdateBloomFilter_Call) RunAndReturn(run func([]storage.PrimaryKey)) *MockSegment_UpdateBloomFilter_Call {
_c.Run(run)
return _c
}
// Version provides a mock function with no fields
func (_m *MockSegment) 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
}
// MockSegment_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version'
type MockSegment_Version_Call struct {
*mock.Call
}
// Version is a helper method to define mock.On call
func (_e *MockSegment_Expecter) Version() *MockSegment_Version_Call {
return &MockSegment_Version_Call{Call: _e.mock.On("Version")}
}
func (_c *MockSegment_Version_Call) Run(run func()) *MockSegment_Version_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockSegment_Version_Call) Return(_a0 int64) *MockSegment_Version_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockSegment_Version_Call) RunAndReturn(run func() int64) *MockSegment_Version_Call {
_c.Call.Return(run)
return _c
}
// NewMockSegment creates a new instance of MockSegment. 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 NewMockSegment(t interface {
mock.TestingT
Cleanup(func())
}) *MockSegment {
mock := &MockSegment{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}