syncmgr

package
v0.0.0-...-34e0b2d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorageSerializer

func NewStorageSerializer(allocator allocator.Interface, metacache metacache.MetaCache, metaWriter MetaWriter) (*storageV1Serializer, error)

Types

type MetaWriter

type MetaWriter interface {
	UpdateSync(context.Context, *SyncTask) error
	DropChannel(context.Context, string) error
}

MetaWriter is the interface for SyncManager to write segment sync meta.

func BrokerMetaWriter

func BrokerMetaWriter(broker broker.Broker, serverID int64, opts ...retry.Option) MetaWriter

type MockMetaWriter

type MockMetaWriter struct {
	mock.Mock
}

MockMetaWriter is an autogenerated mock type for the MetaWriter type

func NewMockMetaWriter

func NewMockMetaWriter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockMetaWriter

NewMockMetaWriter creates a new instance of MockMetaWriter. 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 (*MockMetaWriter) DropChannel

func (_m *MockMetaWriter) DropChannel(_a0 context.Context, _a1 string) error

DropChannel provides a mock function with given fields: _a0, _a1

func (*MockMetaWriter) EXPECT

func (*MockMetaWriter) UpdateSync

func (_m *MockMetaWriter) UpdateSync(_a0 context.Context, _a1 *SyncTask) error

UpdateSync provides a mock function with given fields: _a0, _a1

type MockMetaWriter_DropChannel_Call

type MockMetaWriter_DropChannel_Call struct {
	*mock.Call
}

MockMetaWriter_DropChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropChannel'

func (*MockMetaWriter_DropChannel_Call) Return

func (*MockMetaWriter_DropChannel_Call) Run

func (*MockMetaWriter_DropChannel_Call) RunAndReturn

type MockMetaWriter_Expecter

type MockMetaWriter_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockMetaWriter_Expecter) DropChannel

func (_e *MockMetaWriter_Expecter) DropChannel(_a0 interface{}, _a1 interface{}) *MockMetaWriter_DropChannel_Call

DropChannel is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 string

func (*MockMetaWriter_Expecter) UpdateSync

func (_e *MockMetaWriter_Expecter) UpdateSync(_a0 interface{}, _a1 interface{}) *MockMetaWriter_UpdateSync_Call

UpdateSync is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 *SyncTask

type MockMetaWriter_UpdateSync_Call

type MockMetaWriter_UpdateSync_Call struct {
	*mock.Call
}

MockMetaWriter_UpdateSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSync'

func (*MockMetaWriter_UpdateSync_Call) Return

func (*MockMetaWriter_UpdateSync_Call) Run

func (*MockMetaWriter_UpdateSync_Call) RunAndReturn

type MockSerializer

type MockSerializer struct {
	mock.Mock
}

MockSerializer is an autogenerated mock type for the Serializer type

func NewMockSerializer

func NewMockSerializer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSerializer

NewMockSerializer creates a new instance of MockSerializer. 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 (*MockSerializer) EXPECT

func (*MockSerializer) EncodeBuffer

func (_m *MockSerializer) EncodeBuffer(ctx context.Context, pack *SyncPack) (Task, error)

EncodeBuffer provides a mock function with given fields: ctx, pack

type MockSerializer_EncodeBuffer_Call

type MockSerializer_EncodeBuffer_Call struct {
	*mock.Call
}

MockSerializer_EncodeBuffer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncodeBuffer'

func (*MockSerializer_EncodeBuffer_Call) Return

func (*MockSerializer_EncodeBuffer_Call) Run

func (*MockSerializer_EncodeBuffer_Call) RunAndReturn

type MockSerializer_Expecter

type MockSerializer_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockSerializer_Expecter) EncodeBuffer

func (_e *MockSerializer_Expecter) EncodeBuffer(ctx interface{}, pack interface{}) *MockSerializer_EncodeBuffer_Call

EncodeBuffer is a helper method to define mock.On call

  • ctx context.Context
  • pack *SyncPack

type MockSyncManager

type MockSyncManager struct {
	mock.Mock
}

MockSyncManager is an autogenerated mock type for the SyncManager type

func NewMockSyncManager

func NewMockSyncManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSyncManager

NewMockSyncManager creates a new instance of MockSyncManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockSyncManager) EXPECT

func (*MockSyncManager) SyncData

func (_m *MockSyncManager) SyncData(ctx context.Context, task Task, callbacks ...func(error) error) *conc.Future[struct{}]

SyncData provides a mock function with given fields: ctx, task, callbacks

type MockSyncManager_Expecter

type MockSyncManager_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockSyncManager_Expecter) SyncData

func (_e *MockSyncManager_Expecter) SyncData(ctx interface{}, task interface{}, callbacks ...interface{}) *MockSyncManager_SyncData_Call

SyncData is a helper method to define mock.On call

  • ctx context.Context
  • task Task
  • callbacks ...func(error) error

type MockSyncManager_SyncData_Call

type MockSyncManager_SyncData_Call struct {
	*mock.Call
}

MockSyncManager_SyncData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncData'

func (*MockSyncManager_SyncData_Call) Return

func (*MockSyncManager_SyncData_Call) Run

func (_c *MockSyncManager_SyncData_Call) Run(run func(ctx context.Context, task Task, callbacks ...func(error) error)) *MockSyncManager_SyncData_Call

func (*MockSyncManager_SyncData_Call) RunAndReturn

func (_c *MockSyncManager_SyncData_Call) RunAndReturn(run func(context.Context, Task, ...func(error) error) *conc.Future[struct{}]) *MockSyncManager_SyncData_Call

type MockTask

type MockTask struct {
	mock.Mock
}

MockTask is an autogenerated mock type for the Task type

func NewMockTask

func NewMockTask(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockTask

NewMockTask creates a new instance of MockTask. 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 (*MockTask) ChannelName

func (_m *MockTask) ChannelName() string

ChannelName provides a mock function with given fields:

func (*MockTask) Checkpoint

func (_m *MockTask) Checkpoint() *msgpb.MsgPosition

Checkpoint provides a mock function with given fields:

func (*MockTask) EXPECT

func (_m *MockTask) EXPECT() *MockTask_Expecter

func (*MockTask) HandleError

func (_m *MockTask) HandleError(_a0 error)

HandleError provides a mock function with given fields: _a0

func (*MockTask) Run

func (_m *MockTask) Run(_a0 context.Context) error

Run provides a mock function with given fields: _a0

func (*MockTask) SegmentID

func (_m *MockTask) SegmentID() int64

SegmentID provides a mock function with given fields:

func (*MockTask) StartPosition

func (_m *MockTask) StartPosition() *msgpb.MsgPosition

StartPosition provides a mock function with given fields:

type MockTask_ChannelName_Call

type MockTask_ChannelName_Call struct {
	*mock.Call
}

MockTask_ChannelName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChannelName'

func (*MockTask_ChannelName_Call) Return

func (*MockTask_ChannelName_Call) Run

func (*MockTask_ChannelName_Call) RunAndReturn

func (_c *MockTask_ChannelName_Call) RunAndReturn(run func() string) *MockTask_ChannelName_Call

type MockTask_Checkpoint_Call

type MockTask_Checkpoint_Call struct {
	*mock.Call
}

MockTask_Checkpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Checkpoint'

func (*MockTask_Checkpoint_Call) Return

func (*MockTask_Checkpoint_Call) Run

func (*MockTask_Checkpoint_Call) RunAndReturn

func (_c *MockTask_Checkpoint_Call) RunAndReturn(run func() *msgpb.MsgPosition) *MockTask_Checkpoint_Call

type MockTask_Expecter

type MockTask_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockTask_Expecter) ChannelName

func (_e *MockTask_Expecter) ChannelName() *MockTask_ChannelName_Call

ChannelName is a helper method to define mock.On call

func (*MockTask_Expecter) Checkpoint

func (_e *MockTask_Expecter) Checkpoint() *MockTask_Checkpoint_Call

Checkpoint is a helper method to define mock.On call

func (*MockTask_Expecter) HandleError

func (_e *MockTask_Expecter) HandleError(_a0 interface{}) *MockTask_HandleError_Call

HandleError is a helper method to define mock.On call

  • _a0 error

func (*MockTask_Expecter) Run

func (_e *MockTask_Expecter) Run(_a0 interface{}) *MockTask_Run_Call

Run is a helper method to define mock.On call

  • _a0 context.Context

func (*MockTask_Expecter) SegmentID

func (_e *MockTask_Expecter) SegmentID() *MockTask_SegmentID_Call

SegmentID is a helper method to define mock.On call

func (*MockTask_Expecter) StartPosition

func (_e *MockTask_Expecter) StartPosition() *MockTask_StartPosition_Call

StartPosition is a helper method to define mock.On call

type MockTask_HandleError_Call

type MockTask_HandleError_Call struct {
	*mock.Call
}

MockTask_HandleError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleError'

func (*MockTask_HandleError_Call) Return

func (*MockTask_HandleError_Call) Run

func (*MockTask_HandleError_Call) RunAndReturn

func (_c *MockTask_HandleError_Call) RunAndReturn(run func(error)) *MockTask_HandleError_Call

type MockTask_Run_Call

type MockTask_Run_Call struct {
	*mock.Call
}

MockTask_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'

func (*MockTask_Run_Call) Return

func (_c *MockTask_Run_Call) Return(_a0 error) *MockTask_Run_Call

func (*MockTask_Run_Call) Run

func (_c *MockTask_Run_Call) Run(run func(_a0 context.Context)) *MockTask_Run_Call

func (*MockTask_Run_Call) RunAndReturn

func (_c *MockTask_Run_Call) RunAndReturn(run func(context.Context) error) *MockTask_Run_Call

type MockTask_SegmentID_Call

type MockTask_SegmentID_Call struct {
	*mock.Call
}

MockTask_SegmentID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SegmentID'

func (*MockTask_SegmentID_Call) Return

func (*MockTask_SegmentID_Call) Run

func (_c *MockTask_SegmentID_Call) Run(run func()) *MockTask_SegmentID_Call

func (*MockTask_SegmentID_Call) RunAndReturn

func (_c *MockTask_SegmentID_Call) RunAndReturn(run func() int64) *MockTask_SegmentID_Call

type MockTask_StartPosition_Call

type MockTask_StartPosition_Call struct {
	*mock.Call
}

MockTask_StartPosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartPosition'

func (*MockTask_StartPosition_Call) Return

func (*MockTask_StartPosition_Call) Run

func (*MockTask_StartPosition_Call) RunAndReturn

type Serializer

type Serializer interface {
	EncodeBuffer(ctx context.Context, pack *SyncPack) (Task, error)
}

Serializer is the interface for storage/storageV2 implementation to encoding WriteBuffer into sync task.

type SyncManager

type SyncManager interface {
	// SyncData is the method to submit sync task.
	SyncData(ctx context.Context, task Task, callbacks ...func(error) error) *conc.Future[struct{}]
}

SyncManager is the interface for sync manager. it processes the sync tasks inside and changes the meta.

func NewSyncManager

func NewSyncManager(chunkManager storage.ChunkManager) SyncManager

type SyncManagerOption

type SyncManagerOption struct {
	// contains filtered or unexported fields
}

type SyncMeta

type SyncMeta struct {
	// contains filtered or unexported fields
}

type SyncPack

type SyncPack struct {
	// contains filtered or unexported fields
}

SyncPack is the struct contains buffer sync data.

func (*SyncPack) WithBatchSize

func (p *SyncPack) WithBatchSize(batchSize int64) *SyncPack

func (*SyncPack) WithChannelName

func (p *SyncPack) WithChannelName(chanName string) *SyncPack

func (*SyncPack) WithCheckpoint

func (p *SyncPack) WithCheckpoint(cp *msgpb.MsgPosition) *SyncPack

func (*SyncPack) WithCollectionID

func (p *SyncPack) WithCollectionID(collID int64) *SyncPack

func (*SyncPack) WithDeleteData

func (p *SyncPack) WithDeleteData(deltaData *storage.DeleteData) *SyncPack

func (*SyncPack) WithDrop

func (p *SyncPack) WithDrop() *SyncPack

func (*SyncPack) WithFlush

func (p *SyncPack) WithFlush() *SyncPack

func (*SyncPack) WithInsertData

func (p *SyncPack) WithInsertData(insertData []*storage.InsertData) *SyncPack

func (*SyncPack) WithLevel

func (p *SyncPack) WithLevel(level datapb.SegmentLevel) *SyncPack

func (*SyncPack) WithPartitionID

func (p *SyncPack) WithPartitionID(partID int64) *SyncPack

func (*SyncPack) WithSegmentID

func (p *SyncPack) WithSegmentID(segID int64) *SyncPack

func (*SyncPack) WithStartPosition

func (p *SyncPack) WithStartPosition(start *msgpb.MsgPosition) *SyncPack

func (*SyncPack) WithTimeRange

func (p *SyncPack) WithTimeRange(from, to typeutil.Timestamp) *SyncPack

type SyncTask

type SyncTask struct {
	// contains filtered or unexported fields
}

func NewSyncTask

func NewSyncTask() *SyncTask

func (*SyncTask) Binlogs

func (*SyncTask) ChannelName

func (t *SyncTask) ChannelName() string

func (*SyncTask) Checkpoint

func (t *SyncTask) Checkpoint() *msgpb.MsgPosition

func (*SyncTask) HandleError

func (t *SyncTask) HandleError(err error)

func (*SyncTask) Run

func (t *SyncTask) Run(ctx context.Context) (err error)

func (*SyncTask) SegmentID

func (t *SyncTask) SegmentID() int64

func (*SyncTask) StartPosition

func (t *SyncTask) StartPosition() *msgpb.MsgPosition

func (*SyncTask) WithAllocator

func (t *SyncTask) WithAllocator(allocator allocator.Interface) *SyncTask

func (*SyncTask) WithBatchSize

func (t *SyncTask) WithBatchSize(batchSize int64) *SyncTask

func (*SyncTask) WithChannelName

func (t *SyncTask) WithChannelName(chanName string) *SyncTask

func (*SyncTask) WithCheckpoint

func (t *SyncTask) WithCheckpoint(cp *msgpb.MsgPosition) *SyncTask

func (*SyncTask) WithChunkManager

func (t *SyncTask) WithChunkManager(cm storage.ChunkManager) *SyncTask

func (*SyncTask) WithCollectionID

func (t *SyncTask) WithCollectionID(collID int64) *SyncTask

func (*SyncTask) WithDrop

func (t *SyncTask) WithDrop() *SyncTask

func (*SyncTask) WithFailureCallback

func (t *SyncTask) WithFailureCallback(callback func(error)) *SyncTask

func (*SyncTask) WithFlush

func (t *SyncTask) WithFlush() *SyncTask

func (*SyncTask) WithLevel

func (t *SyncTask) WithLevel(level datapb.SegmentLevel) *SyncTask

func (*SyncTask) WithMetaCache

func (t *SyncTask) WithMetaCache(metacache metacache.MetaCache) *SyncTask

func (*SyncTask) WithMetaWriter

func (t *SyncTask) WithMetaWriter(metaWriter MetaWriter) *SyncTask

func (*SyncTask) WithPartitionID

func (t *SyncTask) WithPartitionID(partID int64) *SyncTask

func (*SyncTask) WithSchema

func (t *SyncTask) WithSchema(schema *schemapb.CollectionSchema) *SyncTask

func (*SyncTask) WithSegmentID

func (t *SyncTask) WithSegmentID(segID int64) *SyncTask

func (*SyncTask) WithStartPosition

func (t *SyncTask) WithStartPosition(start *msgpb.MsgPosition) *SyncTask

func (*SyncTask) WithTimeRange

func (t *SyncTask) WithTimeRange(from, to typeutil.Timestamp) *SyncTask

func (*SyncTask) WithWriteRetryOptions

func (t *SyncTask) WithWriteRetryOptions(opts ...retry.Option) *SyncTask

type Task

type Task interface {
	SegmentID() int64
	Checkpoint() *msgpb.MsgPosition
	StartPosition() *msgpb.MsgPosition
	ChannelName() string
	Run(context.Context) error
	HandleError(error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL