Documentation ¶
Index ¶
- Constants
- type BufferBase
- type BufferManager
- type DeltaBuffer
- type InsertBuffer
- type MockBufferManager
- func (_m *MockBufferManager) BufferData(channel string, insertMsgs []*msgstream.InsertMsg, ...) error
- func (_m *MockBufferManager) DropChannel(channel string)
- func (_m *MockBufferManager) DropPartitions(channel string, partitionIDs []int64)
- func (_m *MockBufferManager) EXPECT() *MockBufferManager_Expecter
- func (_m *MockBufferManager) FlushChannel(ctx context.Context, channel string, flushTs uint64) error
- func (_m *MockBufferManager) GetCheckpoint(channel string) (*msgpb.MsgPosition, bool, error)
- func (_m *MockBufferManager) NotifyCheckpointUpdated(channel string, ts uint64)
- func (_m *MockBufferManager) Register(channel string, _a1 metacache.MetaCache, opts ...WriteBufferOption) error
- func (_m *MockBufferManager) RemoveChannel(channel string)
- func (_m *MockBufferManager) SealSegments(ctx context.Context, channel string, segmentIDs []int64) error
- func (_m *MockBufferManager) Start()
- func (_m *MockBufferManager) Stop()
- type MockBufferManager_BufferData_Call
- func (_c *MockBufferManager_BufferData_Call) Return(_a0 error) *MockBufferManager_BufferData_Call
- func (_c *MockBufferManager_BufferData_Call) Run(run func(channel string, insertMsgs []*msgstream.InsertMsg, ...)) *MockBufferManager_BufferData_Call
- func (_c *MockBufferManager_BufferData_Call) RunAndReturn(...) *MockBufferManager_BufferData_Call
- type MockBufferManager_DropChannel_Call
- func (_c *MockBufferManager_DropChannel_Call) Return() *MockBufferManager_DropChannel_Call
- func (_c *MockBufferManager_DropChannel_Call) Run(run func(channel string)) *MockBufferManager_DropChannel_Call
- func (_c *MockBufferManager_DropChannel_Call) RunAndReturn(run func(string)) *MockBufferManager_DropChannel_Call
- type MockBufferManager_DropPartitions_Call
- func (_c *MockBufferManager_DropPartitions_Call) Return() *MockBufferManager_DropPartitions_Call
- func (_c *MockBufferManager_DropPartitions_Call) Run(run func(channel string, partitionIDs []int64)) *MockBufferManager_DropPartitions_Call
- func (_c *MockBufferManager_DropPartitions_Call) RunAndReturn(run func(string, []int64)) *MockBufferManager_DropPartitions_Call
- type MockBufferManager_Expecter
- func (_e *MockBufferManager_Expecter) BufferData(channel interface{}, insertMsgs interface{}, deleteMsgs interface{}, ...) *MockBufferManager_BufferData_Call
- func (_e *MockBufferManager_Expecter) DropChannel(channel interface{}) *MockBufferManager_DropChannel_Call
- func (_e *MockBufferManager_Expecter) DropPartitions(channel interface{}, partitionIDs interface{}) *MockBufferManager_DropPartitions_Call
- func (_e *MockBufferManager_Expecter) FlushChannel(ctx interface{}, channel interface{}, flushTs interface{}) *MockBufferManager_FlushChannel_Call
- func (_e *MockBufferManager_Expecter) GetCheckpoint(channel interface{}) *MockBufferManager_GetCheckpoint_Call
- func (_e *MockBufferManager_Expecter) NotifyCheckpointUpdated(channel interface{}, ts interface{}) *MockBufferManager_NotifyCheckpointUpdated_Call
- func (_e *MockBufferManager_Expecter) Register(channel interface{}, _a1 interface{}, opts ...interface{}) *MockBufferManager_Register_Call
- func (_e *MockBufferManager_Expecter) RemoveChannel(channel interface{}) *MockBufferManager_RemoveChannel_Call
- func (_e *MockBufferManager_Expecter) SealSegments(ctx interface{}, channel interface{}, segmentIDs interface{}) *MockBufferManager_SealSegments_Call
- func (_e *MockBufferManager_Expecter) Start() *MockBufferManager_Start_Call
- func (_e *MockBufferManager_Expecter) Stop() *MockBufferManager_Stop_Call
- type MockBufferManager_FlushChannel_Call
- func (_c *MockBufferManager_FlushChannel_Call) Return(_a0 error) *MockBufferManager_FlushChannel_Call
- func (_c *MockBufferManager_FlushChannel_Call) Run(run func(ctx context.Context, channel string, flushTs uint64)) *MockBufferManager_FlushChannel_Call
- func (_c *MockBufferManager_FlushChannel_Call) RunAndReturn(run func(context.Context, string, uint64) error) *MockBufferManager_FlushChannel_Call
- type MockBufferManager_GetCheckpoint_Call
- func (_c *MockBufferManager_GetCheckpoint_Call) Return(_a0 *msgpb.MsgPosition, _a1 bool, _a2 error) *MockBufferManager_GetCheckpoint_Call
- func (_c *MockBufferManager_GetCheckpoint_Call) Run(run func(channel string)) *MockBufferManager_GetCheckpoint_Call
- func (_c *MockBufferManager_GetCheckpoint_Call) RunAndReturn(run func(string) (*msgpb.MsgPosition, bool, error)) *MockBufferManager_GetCheckpoint_Call
- type MockBufferManager_NotifyCheckpointUpdated_Call
- func (_c *MockBufferManager_NotifyCheckpointUpdated_Call) Return() *MockBufferManager_NotifyCheckpointUpdated_Call
- func (_c *MockBufferManager_NotifyCheckpointUpdated_Call) Run(run func(channel string, ts uint64)) *MockBufferManager_NotifyCheckpointUpdated_Call
- func (_c *MockBufferManager_NotifyCheckpointUpdated_Call) RunAndReturn(run func(string, uint64)) *MockBufferManager_NotifyCheckpointUpdated_Call
- type MockBufferManager_Register_Call
- func (_c *MockBufferManager_Register_Call) Return(_a0 error) *MockBufferManager_Register_Call
- func (_c *MockBufferManager_Register_Call) Run(run func(channel string, _a1 metacache.MetaCache, opts ...WriteBufferOption)) *MockBufferManager_Register_Call
- func (_c *MockBufferManager_Register_Call) RunAndReturn(run func(string, metacache.MetaCache, ...WriteBufferOption) error) *MockBufferManager_Register_Call
- type MockBufferManager_RemoveChannel_Call
- func (_c *MockBufferManager_RemoveChannel_Call) Return() *MockBufferManager_RemoveChannel_Call
- func (_c *MockBufferManager_RemoveChannel_Call) Run(run func(channel string)) *MockBufferManager_RemoveChannel_Call
- func (_c *MockBufferManager_RemoveChannel_Call) RunAndReturn(run func(string)) *MockBufferManager_RemoveChannel_Call
- type MockBufferManager_SealSegments_Call
- func (_c *MockBufferManager_SealSegments_Call) Return(_a0 error) *MockBufferManager_SealSegments_Call
- func (_c *MockBufferManager_SealSegments_Call) Run(run func(ctx context.Context, channel string, segmentIDs []int64)) *MockBufferManager_SealSegments_Call
- func (_c *MockBufferManager_SealSegments_Call) RunAndReturn(run func(context.Context, string, []int64) error) *MockBufferManager_SealSegments_Call
- type MockBufferManager_Start_Call
- type MockBufferManager_Stop_Call
- type MockWriteBuffer
- func (_m *MockWriteBuffer) BufferData(insertMsgs []*msgstream.InsertMsg, deleteMsgs []*msgstream.DeleteMsg, ...) error
- func (_m *MockWriteBuffer) Close(ctx context.Context, drop bool)
- func (_m *MockWriteBuffer) DropPartitions(partitionIDs []int64)
- func (_m *MockWriteBuffer) EXPECT() *MockWriteBuffer_Expecter
- func (_m *MockWriteBuffer) EvictBuffer(policies ...SyncPolicy)
- func (_m *MockWriteBuffer) GetCheckpoint() *msgpb.MsgPosition
- func (_m *MockWriteBuffer) GetFlushTimestamp() uint64
- func (_m *MockWriteBuffer) HasSegment(segmentID int64) bool
- func (_m *MockWriteBuffer) MemorySize() int64
- func (_m *MockWriteBuffer) SealSegments(ctx context.Context, segmentIDs []int64) error
- func (_m *MockWriteBuffer) SetFlushTimestamp(flushTs uint64)
- type MockWriteBuffer_BufferData_Call
- type MockWriteBuffer_Close_Call
- type MockWriteBuffer_DropPartitions_Call
- func (_c *MockWriteBuffer_DropPartitions_Call) Return() *MockWriteBuffer_DropPartitions_Call
- func (_c *MockWriteBuffer_DropPartitions_Call) Run(run func(partitionIDs []int64)) *MockWriteBuffer_DropPartitions_Call
- func (_c *MockWriteBuffer_DropPartitions_Call) RunAndReturn(run func([]int64)) *MockWriteBuffer_DropPartitions_Call
- type MockWriteBuffer_EvictBuffer_Call
- func (_c *MockWriteBuffer_EvictBuffer_Call) Return() *MockWriteBuffer_EvictBuffer_Call
- func (_c *MockWriteBuffer_EvictBuffer_Call) Run(run func(policies ...SyncPolicy)) *MockWriteBuffer_EvictBuffer_Call
- func (_c *MockWriteBuffer_EvictBuffer_Call) RunAndReturn(run func(...SyncPolicy)) *MockWriteBuffer_EvictBuffer_Call
- type MockWriteBuffer_Expecter
- func (_e *MockWriteBuffer_Expecter) BufferData(insertMsgs interface{}, deleteMsgs interface{}, startPos interface{}, ...) *MockWriteBuffer_BufferData_Call
- func (_e *MockWriteBuffer_Expecter) Close(ctx interface{}, drop interface{}) *MockWriteBuffer_Close_Call
- func (_e *MockWriteBuffer_Expecter) DropPartitions(partitionIDs interface{}) *MockWriteBuffer_DropPartitions_Call
- func (_e *MockWriteBuffer_Expecter) EvictBuffer(policies ...interface{}) *MockWriteBuffer_EvictBuffer_Call
- func (_e *MockWriteBuffer_Expecter) GetCheckpoint() *MockWriteBuffer_GetCheckpoint_Call
- func (_e *MockWriteBuffer_Expecter) GetFlushTimestamp() *MockWriteBuffer_GetFlushTimestamp_Call
- func (_e *MockWriteBuffer_Expecter) HasSegment(segmentID interface{}) *MockWriteBuffer_HasSegment_Call
- func (_e *MockWriteBuffer_Expecter) MemorySize() *MockWriteBuffer_MemorySize_Call
- func (_e *MockWriteBuffer_Expecter) SealSegments(ctx interface{}, segmentIDs interface{}) *MockWriteBuffer_SealSegments_Call
- func (_e *MockWriteBuffer_Expecter) SetFlushTimestamp(flushTs interface{}) *MockWriteBuffer_SetFlushTimestamp_Call
- type MockWriteBuffer_GetCheckpoint_Call
- func (_c *MockWriteBuffer_GetCheckpoint_Call) Return(_a0 *msgpb.MsgPosition) *MockWriteBuffer_GetCheckpoint_Call
- func (_c *MockWriteBuffer_GetCheckpoint_Call) Run(run func()) *MockWriteBuffer_GetCheckpoint_Call
- func (_c *MockWriteBuffer_GetCheckpoint_Call) RunAndReturn(run func() *msgpb.MsgPosition) *MockWriteBuffer_GetCheckpoint_Call
- type MockWriteBuffer_GetFlushTimestamp_Call
- func (_c *MockWriteBuffer_GetFlushTimestamp_Call) Return(_a0 uint64) *MockWriteBuffer_GetFlushTimestamp_Call
- func (_c *MockWriteBuffer_GetFlushTimestamp_Call) Run(run func()) *MockWriteBuffer_GetFlushTimestamp_Call
- func (_c *MockWriteBuffer_GetFlushTimestamp_Call) RunAndReturn(run func() uint64) *MockWriteBuffer_GetFlushTimestamp_Call
- type MockWriteBuffer_HasSegment_Call
- func (_c *MockWriteBuffer_HasSegment_Call) Return(_a0 bool) *MockWriteBuffer_HasSegment_Call
- func (_c *MockWriteBuffer_HasSegment_Call) Run(run func(segmentID int64)) *MockWriteBuffer_HasSegment_Call
- func (_c *MockWriteBuffer_HasSegment_Call) RunAndReturn(run func(int64) bool) *MockWriteBuffer_HasSegment_Call
- type MockWriteBuffer_MemorySize_Call
- type MockWriteBuffer_SealSegments_Call
- func (_c *MockWriteBuffer_SealSegments_Call) Return(_a0 error) *MockWriteBuffer_SealSegments_Call
- func (_c *MockWriteBuffer_SealSegments_Call) Run(run func(ctx context.Context, segmentIDs []int64)) *MockWriteBuffer_SealSegments_Call
- func (_c *MockWriteBuffer_SealSegments_Call) RunAndReturn(run func(context.Context, []int64) error) *MockWriteBuffer_SealSegments_Call
- type MockWriteBuffer_SetFlushTimestamp_Call
- func (_c *MockWriteBuffer_SetFlushTimestamp_Call) Return() *MockWriteBuffer_SetFlushTimestamp_Call
- func (_c *MockWriteBuffer_SetFlushTimestamp_Call) Run(run func(flushTs uint64)) *MockWriteBuffer_SetFlushTimestamp_Call
- func (_c *MockWriteBuffer_SetFlushTimestamp_Call) RunAndReturn(run func(uint64)) *MockWriteBuffer_SetFlushTimestamp_Call
- type SegStartPosHeap
- type SelectSegmentFnPolicy
- type SelectSegmentFunc
- type SyncPolicy
- func GetDroppedSegmentPolicy(meta metacache.MetaCache) SyncPolicy
- func GetFlushTsPolicy(flushTimestamp *atomic.Uint64, meta metacache.MetaCache) SyncPolicy
- func GetFullBufferPolicy() SyncPolicy
- func GetOldestBufferPolicy(num int) SyncPolicy
- func GetSealedSegmentsPolicy(meta metacache.MetaCache) SyncPolicy
- func GetSyncStaleBufferPolicy(staleDuration time.Duration) SyncPolicy
- type TimeRange
- type WriteBuffer
- func NewBFWriteBuffer(channel string, metacache metacache.MetaCache, syncMgr syncmgr.SyncManager, ...) (WriteBuffer, error)
- func NewL0WriteBuffer(channel string, metacache metacache.MetaCache, syncMgr syncmgr.SyncManager, ...) (WriteBuffer, error)
- func NewWriteBuffer(channel string, metacache metacache.MetaCache, syncMgr syncmgr.SyncManager, ...) (WriteBuffer, error)
- type WriteBufferOption
- func WithDeletePolicy(policy string) WriteBufferOption
- func WithIDAllocator(allocator allocator.Interface) WriteBufferOption
- func WithMetaWriter(writer syncmgr.MetaWriter) WriteBufferOption
- func WithPKStatsFactory(factory metacache.PkStatsFactory) WriteBufferOption
- func WithSyncPolicy(policy SyncPolicy) WriteBufferOption
Constants ¶
const ( // DeletePolicyBFPKOracle is the const config value for using bf pk oracle as delete policy DeletePolicyBFPkOracle = `bloom_filter_pkoracle` // DeletePolicyL0Delta is the const config value for using L0 delta as deleta policy. DeletePolicyL0Delta = `l0_delta` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferBase ¶
type BufferBase struct { TimestampFrom typeutil.Timestamp TimestampTo typeutil.Timestamp // contains filtered or unexported fields }
func (*BufferBase) GetTimeRange ¶
func (b *BufferBase) GetTimeRange() *TimeRange
func (*BufferBase) IsEmpty ¶
func (b *BufferBase) IsEmpty() bool
func (*BufferBase) IsFull ¶
func (b *BufferBase) IsFull() bool
func (*BufferBase) MinTimestamp ¶
func (b *BufferBase) MinTimestamp() typeutil.Timestamp
func (*BufferBase) UpdateStatistics ¶
func (b *BufferBase) UpdateStatistics(entryNum, size int64, tr TimeRange, startPos, endPos *msgpb.MsgPosition)
type BufferManager ¶
type BufferManager interface { // Register adds a WriteBuffer with provided schema & options. Register(channel string, metacache metacache.MetaCache, opts ...WriteBufferOption) error // SealSegments notifies writeBuffer corresponding to provided channel to seal segments. // which will cause segment start flush procedure. SealSegments(ctx context.Context, channel string, segmentIDs []int64) error // FlushChannel set the flushTs of the provided write buffer. FlushChannel(ctx context.Context, channel string, flushTs uint64) error // RemoveChannel removes a write buffer from manager. RemoveChannel(channel string) // DropChannel remove write buffer and perform drop. DropChannel(channel string) DropPartitions(channel string, partitionIDs []int64) // BufferData put data into channel write buffer. BufferData(channel string, insertMsgs []*msgstream.InsertMsg, deleteMsgs []*msgstream.DeleteMsg, startPos, endPos *msgpb.MsgPosition) error // GetCheckpoint returns checkpoint for provided channel. GetCheckpoint(channel string) (*msgpb.MsgPosition, bool, error) // NotifyCheckpointUpdated notify write buffer checkpoint updated to reset flushTs. NotifyCheckpointUpdated(channel string, ts uint64) // Start makes the background check start to work. Start() // Stop the background checker and wait for worker goroutine quit. Stop() }
BufferManager is the interface for WriteBuffer management.
func NewManager ¶
func NewManager(syncMgr syncmgr.SyncManager) BufferManager
NewManager returns initialized manager as `Manager`
type DeltaBuffer ¶
type DeltaBuffer struct { BufferBase // contains filtered or unexported fields }
func NewDeltaBuffer ¶
func NewDeltaBuffer() *DeltaBuffer
func (*DeltaBuffer) Buffer ¶
func (db *DeltaBuffer) Buffer(pks []storage.PrimaryKey, tss []typeutil.Timestamp, startPos, endPos *msgpb.MsgPosition) (bufSize int64)
func (*DeltaBuffer) Yield ¶
func (db *DeltaBuffer) Yield() *storage.DeleteData
type InsertBuffer ¶
type InsertBuffer struct { BufferBase // contains filtered or unexported fields }
func NewInsertBuffer ¶
func NewInsertBuffer(sch *schemapb.CollectionSchema) (*InsertBuffer, error)
func (*InsertBuffer) Buffer ¶
func (ib *InsertBuffer) Buffer(inData *inData, startPos, endPos *msgpb.MsgPosition) int64
func (*InsertBuffer) Yield ¶
func (ib *InsertBuffer) Yield() []*storage.InsertData
type MockBufferManager ¶
MockBufferManager is an autogenerated mock type for the BufferManager type
func NewMockBufferManager ¶
func NewMockBufferManager(t interface { mock.TestingT Cleanup(func()) }) *MockBufferManager
NewMockBufferManager creates a new instance of MockBufferManager. 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 (*MockBufferManager) BufferData ¶
func (_m *MockBufferManager) BufferData(channel string, insertMsgs []*msgstream.InsertMsg, deleteMsgs []*msgstream.DeleteMsg, startPos *msgpb.MsgPosition, endPos *msgpb.MsgPosition) error
BufferData provides a mock function with given fields: channel, insertMsgs, deleteMsgs, startPos, endPos
func (*MockBufferManager) DropChannel ¶
func (_m *MockBufferManager) DropChannel(channel string)
DropChannel provides a mock function with given fields: channel
func (*MockBufferManager) DropPartitions ¶
func (_m *MockBufferManager) DropPartitions(channel string, partitionIDs []int64)
DropPartitions provides a mock function with given fields: channel, partitionIDs
func (*MockBufferManager) EXPECT ¶
func (_m *MockBufferManager) EXPECT() *MockBufferManager_Expecter
func (*MockBufferManager) FlushChannel ¶
func (_m *MockBufferManager) FlushChannel(ctx context.Context, channel string, flushTs uint64) error
FlushChannel provides a mock function with given fields: ctx, channel, flushTs
func (*MockBufferManager) GetCheckpoint ¶
func (_m *MockBufferManager) GetCheckpoint(channel string) (*msgpb.MsgPosition, bool, error)
GetCheckpoint provides a mock function with given fields: channel
func (*MockBufferManager) NotifyCheckpointUpdated ¶
func (_m *MockBufferManager) NotifyCheckpointUpdated(channel string, ts uint64)
NotifyCheckpointUpdated provides a mock function with given fields: channel, ts
func (*MockBufferManager) Register ¶
func (_m *MockBufferManager) Register(channel string, _a1 metacache.MetaCache, opts ...WriteBufferOption) error
Register provides a mock function with given fields: channel, _a1, opts
func (*MockBufferManager) RemoveChannel ¶
func (_m *MockBufferManager) RemoveChannel(channel string)
RemoveChannel provides a mock function with given fields: channel
func (*MockBufferManager) SealSegments ¶
func (_m *MockBufferManager) SealSegments(ctx context.Context, channel string, segmentIDs []int64) error
SealSegments provides a mock function with given fields: ctx, channel, segmentIDs
func (*MockBufferManager) Start ¶
func (_m *MockBufferManager) Start()
Start provides a mock function with given fields:
func (*MockBufferManager) Stop ¶
func (_m *MockBufferManager) Stop()
Stop provides a mock function with given fields:
type MockBufferManager_BufferData_Call ¶
MockBufferManager_BufferData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BufferData'
func (*MockBufferManager_BufferData_Call) Return ¶
func (_c *MockBufferManager_BufferData_Call) Return(_a0 error) *MockBufferManager_BufferData_Call
func (*MockBufferManager_BufferData_Call) Run ¶
func (_c *MockBufferManager_BufferData_Call) Run(run func(channel string, insertMsgs []*msgstream.InsertMsg, deleteMsgs []*msgstream.DeleteMsg, startPos *msgpb.MsgPosition, endPos *msgpb.MsgPosition)) *MockBufferManager_BufferData_Call
func (*MockBufferManager_BufferData_Call) RunAndReturn ¶
func (_c *MockBufferManager_BufferData_Call) RunAndReturn(run func(string, []*msgstream.InsertMsg, []*msgstream.DeleteMsg, *msgpb.MsgPosition, *msgpb.MsgPosition) error) *MockBufferManager_BufferData_Call
type MockBufferManager_DropChannel_Call ¶
MockBufferManager_DropChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropChannel'
func (*MockBufferManager_DropChannel_Call) Return ¶
func (_c *MockBufferManager_DropChannel_Call) Return() *MockBufferManager_DropChannel_Call
func (*MockBufferManager_DropChannel_Call) Run ¶
func (_c *MockBufferManager_DropChannel_Call) Run(run func(channel string)) *MockBufferManager_DropChannel_Call
func (*MockBufferManager_DropChannel_Call) RunAndReturn ¶
func (_c *MockBufferManager_DropChannel_Call) RunAndReturn(run func(string)) *MockBufferManager_DropChannel_Call
type MockBufferManager_DropPartitions_Call ¶
MockBufferManager_DropPartitions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropPartitions'
func (*MockBufferManager_DropPartitions_Call) Return ¶
func (_c *MockBufferManager_DropPartitions_Call) Return() *MockBufferManager_DropPartitions_Call
func (*MockBufferManager_DropPartitions_Call) Run ¶
func (_c *MockBufferManager_DropPartitions_Call) Run(run func(channel string, partitionIDs []int64)) *MockBufferManager_DropPartitions_Call
func (*MockBufferManager_DropPartitions_Call) RunAndReturn ¶
func (_c *MockBufferManager_DropPartitions_Call) RunAndReturn(run func(string, []int64)) *MockBufferManager_DropPartitions_Call
type MockBufferManager_Expecter ¶
type MockBufferManager_Expecter struct {
// contains filtered or unexported fields
}
func (*MockBufferManager_Expecter) BufferData ¶
func (_e *MockBufferManager_Expecter) BufferData(channel interface{}, insertMsgs interface{}, deleteMsgs interface{}, startPos interface{}, endPos interface{}) *MockBufferManager_BufferData_Call
BufferData is a helper method to define mock.On call
- channel string
- insertMsgs []*msgstream.InsertMsg
- deleteMsgs []*msgstream.DeleteMsg
- startPos *msgpb.MsgPosition
- endPos *msgpb.MsgPosition
func (*MockBufferManager_Expecter) DropChannel ¶
func (_e *MockBufferManager_Expecter) DropChannel(channel interface{}) *MockBufferManager_DropChannel_Call
DropChannel is a helper method to define mock.On call
- channel string
func (*MockBufferManager_Expecter) DropPartitions ¶
func (_e *MockBufferManager_Expecter) DropPartitions(channel interface{}, partitionIDs interface{}) *MockBufferManager_DropPartitions_Call
DropPartitions is a helper method to define mock.On call
- channel string
- partitionIDs []int64
func (*MockBufferManager_Expecter) FlushChannel ¶
func (_e *MockBufferManager_Expecter) FlushChannel(ctx interface{}, channel interface{}, flushTs interface{}) *MockBufferManager_FlushChannel_Call
FlushChannel is a helper method to define mock.On call
- ctx context.Context
- channel string
- flushTs uint64
func (*MockBufferManager_Expecter) GetCheckpoint ¶
func (_e *MockBufferManager_Expecter) GetCheckpoint(channel interface{}) *MockBufferManager_GetCheckpoint_Call
GetCheckpoint is a helper method to define mock.On call
- channel string
func (*MockBufferManager_Expecter) NotifyCheckpointUpdated ¶
func (_e *MockBufferManager_Expecter) NotifyCheckpointUpdated(channel interface{}, ts interface{}) *MockBufferManager_NotifyCheckpointUpdated_Call
NotifyCheckpointUpdated is a helper method to define mock.On call
- channel string
- ts uint64
func (*MockBufferManager_Expecter) Register ¶
func (_e *MockBufferManager_Expecter) Register(channel interface{}, _a1 interface{}, opts ...interface{}) *MockBufferManager_Register_Call
Register is a helper method to define mock.On call
- channel string
- _a1 metacache.MetaCache
- opts ...WriteBufferOption
func (*MockBufferManager_Expecter) RemoveChannel ¶
func (_e *MockBufferManager_Expecter) RemoveChannel(channel interface{}) *MockBufferManager_RemoveChannel_Call
RemoveChannel is a helper method to define mock.On call
- channel string
func (*MockBufferManager_Expecter) SealSegments ¶
func (_e *MockBufferManager_Expecter) SealSegments(ctx interface{}, channel interface{}, segmentIDs interface{}) *MockBufferManager_SealSegments_Call
SealSegments is a helper method to define mock.On call
- ctx context.Context
- channel string
- segmentIDs []int64
func (*MockBufferManager_Expecter) Start ¶
func (_e *MockBufferManager_Expecter) Start() *MockBufferManager_Start_Call
Start is a helper method to define mock.On call
func (*MockBufferManager_Expecter) Stop ¶
func (_e *MockBufferManager_Expecter) Stop() *MockBufferManager_Stop_Call
Stop is a helper method to define mock.On call
type MockBufferManager_FlushChannel_Call ¶
MockBufferManager_FlushChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FlushChannel'
func (*MockBufferManager_FlushChannel_Call) Return ¶
func (_c *MockBufferManager_FlushChannel_Call) Return(_a0 error) *MockBufferManager_FlushChannel_Call
func (*MockBufferManager_FlushChannel_Call) Run ¶
func (_c *MockBufferManager_FlushChannel_Call) Run(run func(ctx context.Context, channel string, flushTs uint64)) *MockBufferManager_FlushChannel_Call
func (*MockBufferManager_FlushChannel_Call) RunAndReturn ¶
func (_c *MockBufferManager_FlushChannel_Call) RunAndReturn(run func(context.Context, string, uint64) error) *MockBufferManager_FlushChannel_Call
type MockBufferManager_GetCheckpoint_Call ¶
MockBufferManager_GetCheckpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCheckpoint'
func (*MockBufferManager_GetCheckpoint_Call) Return ¶
func (_c *MockBufferManager_GetCheckpoint_Call) Return(_a0 *msgpb.MsgPosition, _a1 bool, _a2 error) *MockBufferManager_GetCheckpoint_Call
func (*MockBufferManager_GetCheckpoint_Call) Run ¶
func (_c *MockBufferManager_GetCheckpoint_Call) Run(run func(channel string)) *MockBufferManager_GetCheckpoint_Call
func (*MockBufferManager_GetCheckpoint_Call) RunAndReturn ¶
func (_c *MockBufferManager_GetCheckpoint_Call) RunAndReturn(run func(string) (*msgpb.MsgPosition, bool, error)) *MockBufferManager_GetCheckpoint_Call
type MockBufferManager_NotifyCheckpointUpdated_Call ¶
MockBufferManager_NotifyCheckpointUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyCheckpointUpdated'
func (*MockBufferManager_NotifyCheckpointUpdated_Call) Run ¶
func (_c *MockBufferManager_NotifyCheckpointUpdated_Call) Run(run func(channel string, ts uint64)) *MockBufferManager_NotifyCheckpointUpdated_Call
func (*MockBufferManager_NotifyCheckpointUpdated_Call) RunAndReturn ¶
func (_c *MockBufferManager_NotifyCheckpointUpdated_Call) RunAndReturn(run func(string, uint64)) *MockBufferManager_NotifyCheckpointUpdated_Call
type MockBufferManager_Register_Call ¶
MockBufferManager_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register'
func (*MockBufferManager_Register_Call) Return ¶
func (_c *MockBufferManager_Register_Call) Return(_a0 error) *MockBufferManager_Register_Call
func (*MockBufferManager_Register_Call) Run ¶
func (_c *MockBufferManager_Register_Call) Run(run func(channel string, _a1 metacache.MetaCache, opts ...WriteBufferOption)) *MockBufferManager_Register_Call
func (*MockBufferManager_Register_Call) RunAndReturn ¶
func (_c *MockBufferManager_Register_Call) RunAndReturn(run func(string, metacache.MetaCache, ...WriteBufferOption) error) *MockBufferManager_Register_Call
type MockBufferManager_RemoveChannel_Call ¶
MockBufferManager_RemoveChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveChannel'
func (*MockBufferManager_RemoveChannel_Call) Return ¶
func (_c *MockBufferManager_RemoveChannel_Call) Return() *MockBufferManager_RemoveChannel_Call
func (*MockBufferManager_RemoveChannel_Call) Run ¶
func (_c *MockBufferManager_RemoveChannel_Call) Run(run func(channel string)) *MockBufferManager_RemoveChannel_Call
func (*MockBufferManager_RemoveChannel_Call) RunAndReturn ¶
func (_c *MockBufferManager_RemoveChannel_Call) RunAndReturn(run func(string)) *MockBufferManager_RemoveChannel_Call
type MockBufferManager_SealSegments_Call ¶
MockBufferManager_SealSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SealSegments'
func (*MockBufferManager_SealSegments_Call) Return ¶
func (_c *MockBufferManager_SealSegments_Call) Return(_a0 error) *MockBufferManager_SealSegments_Call
func (*MockBufferManager_SealSegments_Call) Run ¶
func (_c *MockBufferManager_SealSegments_Call) Run(run func(ctx context.Context, channel string, segmentIDs []int64)) *MockBufferManager_SealSegments_Call
func (*MockBufferManager_SealSegments_Call) RunAndReturn ¶
func (_c *MockBufferManager_SealSegments_Call) RunAndReturn(run func(context.Context, string, []int64) error) *MockBufferManager_SealSegments_Call
type MockBufferManager_Start_Call ¶
MockBufferManager_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*MockBufferManager_Start_Call) Return ¶
func (_c *MockBufferManager_Start_Call) Return() *MockBufferManager_Start_Call
func (*MockBufferManager_Start_Call) Run ¶
func (_c *MockBufferManager_Start_Call) Run(run func()) *MockBufferManager_Start_Call
func (*MockBufferManager_Start_Call) RunAndReturn ¶
func (_c *MockBufferManager_Start_Call) RunAndReturn(run func()) *MockBufferManager_Start_Call
type MockBufferManager_Stop_Call ¶
MockBufferManager_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
func (*MockBufferManager_Stop_Call) Return ¶
func (_c *MockBufferManager_Stop_Call) Return() *MockBufferManager_Stop_Call
func (*MockBufferManager_Stop_Call) Run ¶
func (_c *MockBufferManager_Stop_Call) Run(run func()) *MockBufferManager_Stop_Call
func (*MockBufferManager_Stop_Call) RunAndReturn ¶
func (_c *MockBufferManager_Stop_Call) RunAndReturn(run func()) *MockBufferManager_Stop_Call
type MockWriteBuffer ¶
MockWriteBuffer is an autogenerated mock type for the WriteBuffer type
func NewMockWriteBuffer ¶
func NewMockWriteBuffer(t interface { mock.TestingT Cleanup(func()) }) *MockWriteBuffer
NewMockWriteBuffer creates a new instance of MockWriteBuffer. 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 (*MockWriteBuffer) BufferData ¶
func (_m *MockWriteBuffer) BufferData(insertMsgs []*msgstream.InsertMsg, deleteMsgs []*msgstream.DeleteMsg, startPos *msgpb.MsgPosition, endPos *msgpb.MsgPosition) error
BufferData provides a mock function with given fields: insertMsgs, deleteMsgs, startPos, endPos
func (*MockWriteBuffer) Close ¶
func (_m *MockWriteBuffer) Close(ctx context.Context, drop bool)
Close provides a mock function with given fields: ctx, drop
func (*MockWriteBuffer) DropPartitions ¶
func (_m *MockWriteBuffer) DropPartitions(partitionIDs []int64)
DropPartitions provides a mock function with given fields: partitionIDs
func (*MockWriteBuffer) EXPECT ¶
func (_m *MockWriteBuffer) EXPECT() *MockWriteBuffer_Expecter
func (*MockWriteBuffer) EvictBuffer ¶
func (_m *MockWriteBuffer) EvictBuffer(policies ...SyncPolicy)
EvictBuffer provides a mock function with given fields: policies
func (*MockWriteBuffer) GetCheckpoint ¶
func (_m *MockWriteBuffer) GetCheckpoint() *msgpb.MsgPosition
GetCheckpoint provides a mock function with given fields:
func (*MockWriteBuffer) GetFlushTimestamp ¶
func (_m *MockWriteBuffer) GetFlushTimestamp() uint64
GetFlushTimestamp provides a mock function with given fields:
func (*MockWriteBuffer) HasSegment ¶
func (_m *MockWriteBuffer) HasSegment(segmentID int64) bool
HasSegment provides a mock function with given fields: segmentID
func (*MockWriteBuffer) MemorySize ¶
func (_m *MockWriteBuffer) MemorySize() int64
MemorySize provides a mock function with given fields:
func (*MockWriteBuffer) SealSegments ¶
func (_m *MockWriteBuffer) SealSegments(ctx context.Context, segmentIDs []int64) error
SealSegments provides a mock function with given fields: ctx, segmentIDs
func (*MockWriteBuffer) SetFlushTimestamp ¶
func (_m *MockWriteBuffer) SetFlushTimestamp(flushTs uint64)
SetFlushTimestamp provides a mock function with given fields: flushTs
type MockWriteBuffer_BufferData_Call ¶
MockWriteBuffer_BufferData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BufferData'
func (*MockWriteBuffer_BufferData_Call) Return ¶
func (_c *MockWriteBuffer_BufferData_Call) Return(_a0 error) *MockWriteBuffer_BufferData_Call
func (*MockWriteBuffer_BufferData_Call) Run ¶
func (_c *MockWriteBuffer_BufferData_Call) Run(run func(insertMsgs []*msgstream.InsertMsg, deleteMsgs []*msgstream.DeleteMsg, startPos *msgpb.MsgPosition, endPos *msgpb.MsgPosition)) *MockWriteBuffer_BufferData_Call
func (*MockWriteBuffer_BufferData_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_BufferData_Call) RunAndReturn(run func([]*msgstream.InsertMsg, []*msgstream.DeleteMsg, *msgpb.MsgPosition, *msgpb.MsgPosition) error) *MockWriteBuffer_BufferData_Call
type MockWriteBuffer_Close_Call ¶
MockWriteBuffer_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
func (*MockWriteBuffer_Close_Call) Return ¶
func (_c *MockWriteBuffer_Close_Call) Return() *MockWriteBuffer_Close_Call
func (*MockWriteBuffer_Close_Call) Run ¶
func (_c *MockWriteBuffer_Close_Call) Run(run func(ctx context.Context, drop bool)) *MockWriteBuffer_Close_Call
func (*MockWriteBuffer_Close_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_Close_Call) RunAndReturn(run func(context.Context, bool)) *MockWriteBuffer_Close_Call
type MockWriteBuffer_DropPartitions_Call ¶
MockWriteBuffer_DropPartitions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropPartitions'
func (*MockWriteBuffer_DropPartitions_Call) Return ¶
func (_c *MockWriteBuffer_DropPartitions_Call) Return() *MockWriteBuffer_DropPartitions_Call
func (*MockWriteBuffer_DropPartitions_Call) Run ¶
func (_c *MockWriteBuffer_DropPartitions_Call) Run(run func(partitionIDs []int64)) *MockWriteBuffer_DropPartitions_Call
func (*MockWriteBuffer_DropPartitions_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_DropPartitions_Call) RunAndReturn(run func([]int64)) *MockWriteBuffer_DropPartitions_Call
type MockWriteBuffer_EvictBuffer_Call ¶
MockWriteBuffer_EvictBuffer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EvictBuffer'
func (*MockWriteBuffer_EvictBuffer_Call) Return ¶
func (_c *MockWriteBuffer_EvictBuffer_Call) Return() *MockWriteBuffer_EvictBuffer_Call
func (*MockWriteBuffer_EvictBuffer_Call) Run ¶
func (_c *MockWriteBuffer_EvictBuffer_Call) Run(run func(policies ...SyncPolicy)) *MockWriteBuffer_EvictBuffer_Call
func (*MockWriteBuffer_EvictBuffer_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_EvictBuffer_Call) RunAndReturn(run func(...SyncPolicy)) *MockWriteBuffer_EvictBuffer_Call
type MockWriteBuffer_Expecter ¶
type MockWriteBuffer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockWriteBuffer_Expecter) BufferData ¶
func (_e *MockWriteBuffer_Expecter) BufferData(insertMsgs interface{}, deleteMsgs interface{}, startPos interface{}, endPos interface{}) *MockWriteBuffer_BufferData_Call
BufferData is a helper method to define mock.On call
- insertMsgs []*msgstream.InsertMsg
- deleteMsgs []*msgstream.DeleteMsg
- startPos *msgpb.MsgPosition
- endPos *msgpb.MsgPosition
func (*MockWriteBuffer_Expecter) Close ¶
func (_e *MockWriteBuffer_Expecter) Close(ctx interface{}, drop interface{}) *MockWriteBuffer_Close_Call
Close is a helper method to define mock.On call
- ctx context.Context
- drop bool
func (*MockWriteBuffer_Expecter) DropPartitions ¶
func (_e *MockWriteBuffer_Expecter) DropPartitions(partitionIDs interface{}) *MockWriteBuffer_DropPartitions_Call
DropPartitions is a helper method to define mock.On call
- partitionIDs []int64
func (*MockWriteBuffer_Expecter) EvictBuffer ¶
func (_e *MockWriteBuffer_Expecter) EvictBuffer(policies ...interface{}) *MockWriteBuffer_EvictBuffer_Call
EvictBuffer is a helper method to define mock.On call
- policies ...SyncPolicy
func (*MockWriteBuffer_Expecter) GetCheckpoint ¶
func (_e *MockWriteBuffer_Expecter) GetCheckpoint() *MockWriteBuffer_GetCheckpoint_Call
GetCheckpoint is a helper method to define mock.On call
func (*MockWriteBuffer_Expecter) GetFlushTimestamp ¶
func (_e *MockWriteBuffer_Expecter) GetFlushTimestamp() *MockWriteBuffer_GetFlushTimestamp_Call
GetFlushTimestamp is a helper method to define mock.On call
func (*MockWriteBuffer_Expecter) HasSegment ¶
func (_e *MockWriteBuffer_Expecter) HasSegment(segmentID interface{}) *MockWriteBuffer_HasSegment_Call
HasSegment is a helper method to define mock.On call
- segmentID int64
func (*MockWriteBuffer_Expecter) MemorySize ¶
func (_e *MockWriteBuffer_Expecter) MemorySize() *MockWriteBuffer_MemorySize_Call
MemorySize is a helper method to define mock.On call
func (*MockWriteBuffer_Expecter) SealSegments ¶
func (_e *MockWriteBuffer_Expecter) SealSegments(ctx interface{}, segmentIDs interface{}) *MockWriteBuffer_SealSegments_Call
SealSegments is a helper method to define mock.On call
- ctx context.Context
- segmentIDs []int64
func (*MockWriteBuffer_Expecter) SetFlushTimestamp ¶
func (_e *MockWriteBuffer_Expecter) SetFlushTimestamp(flushTs interface{}) *MockWriteBuffer_SetFlushTimestamp_Call
SetFlushTimestamp is a helper method to define mock.On call
- flushTs uint64
type MockWriteBuffer_GetCheckpoint_Call ¶
MockWriteBuffer_GetCheckpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCheckpoint'
func (*MockWriteBuffer_GetCheckpoint_Call) Return ¶
func (_c *MockWriteBuffer_GetCheckpoint_Call) Return(_a0 *msgpb.MsgPosition) *MockWriteBuffer_GetCheckpoint_Call
func (*MockWriteBuffer_GetCheckpoint_Call) Run ¶
func (_c *MockWriteBuffer_GetCheckpoint_Call) Run(run func()) *MockWriteBuffer_GetCheckpoint_Call
func (*MockWriteBuffer_GetCheckpoint_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_GetCheckpoint_Call) RunAndReturn(run func() *msgpb.MsgPosition) *MockWriteBuffer_GetCheckpoint_Call
type MockWriteBuffer_GetFlushTimestamp_Call ¶
MockWriteBuffer_GetFlushTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFlushTimestamp'
func (*MockWriteBuffer_GetFlushTimestamp_Call) Return ¶
func (_c *MockWriteBuffer_GetFlushTimestamp_Call) Return(_a0 uint64) *MockWriteBuffer_GetFlushTimestamp_Call
func (*MockWriteBuffer_GetFlushTimestamp_Call) Run ¶
func (_c *MockWriteBuffer_GetFlushTimestamp_Call) Run(run func()) *MockWriteBuffer_GetFlushTimestamp_Call
func (*MockWriteBuffer_GetFlushTimestamp_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_GetFlushTimestamp_Call) RunAndReturn(run func() uint64) *MockWriteBuffer_GetFlushTimestamp_Call
type MockWriteBuffer_HasSegment_Call ¶
MockWriteBuffer_HasSegment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasSegment'
func (*MockWriteBuffer_HasSegment_Call) Return ¶
func (_c *MockWriteBuffer_HasSegment_Call) Return(_a0 bool) *MockWriteBuffer_HasSegment_Call
func (*MockWriteBuffer_HasSegment_Call) Run ¶
func (_c *MockWriteBuffer_HasSegment_Call) Run(run func(segmentID int64)) *MockWriteBuffer_HasSegment_Call
func (*MockWriteBuffer_HasSegment_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_HasSegment_Call) RunAndReturn(run func(int64) bool) *MockWriteBuffer_HasSegment_Call
type MockWriteBuffer_MemorySize_Call ¶
MockWriteBuffer_MemorySize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MemorySize'
func (*MockWriteBuffer_MemorySize_Call) Return ¶
func (_c *MockWriteBuffer_MemorySize_Call) Return(_a0 int64) *MockWriteBuffer_MemorySize_Call
func (*MockWriteBuffer_MemorySize_Call) Run ¶
func (_c *MockWriteBuffer_MemorySize_Call) Run(run func()) *MockWriteBuffer_MemorySize_Call
func (*MockWriteBuffer_MemorySize_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_MemorySize_Call) RunAndReturn(run func() int64) *MockWriteBuffer_MemorySize_Call
type MockWriteBuffer_SealSegments_Call ¶
MockWriteBuffer_SealSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SealSegments'
func (*MockWriteBuffer_SealSegments_Call) Return ¶
func (_c *MockWriteBuffer_SealSegments_Call) Return(_a0 error) *MockWriteBuffer_SealSegments_Call
func (*MockWriteBuffer_SealSegments_Call) Run ¶
func (_c *MockWriteBuffer_SealSegments_Call) Run(run func(ctx context.Context, segmentIDs []int64)) *MockWriteBuffer_SealSegments_Call
func (*MockWriteBuffer_SealSegments_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_SealSegments_Call) RunAndReturn(run func(context.Context, []int64) error) *MockWriteBuffer_SealSegments_Call
type MockWriteBuffer_SetFlushTimestamp_Call ¶
MockWriteBuffer_SetFlushTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFlushTimestamp'
func (*MockWriteBuffer_SetFlushTimestamp_Call) Return ¶
func (_c *MockWriteBuffer_SetFlushTimestamp_Call) Return() *MockWriteBuffer_SetFlushTimestamp_Call
func (*MockWriteBuffer_SetFlushTimestamp_Call) Run ¶
func (_c *MockWriteBuffer_SetFlushTimestamp_Call) Run(run func(flushTs uint64)) *MockWriteBuffer_SetFlushTimestamp_Call
func (*MockWriteBuffer_SetFlushTimestamp_Call) RunAndReturn ¶
func (_c *MockWriteBuffer_SetFlushTimestamp_Call) RunAndReturn(run func(uint64)) *MockWriteBuffer_SetFlushTimestamp_Call
type SegStartPosHeap ¶
type SegStartPosHeap []*segmentBuffer
SegMemSizeHeap implement max-heap for sorting.
func (SegStartPosHeap) Len ¶
func (h SegStartPosHeap) Len() int
func (SegStartPosHeap) Less ¶
func (h SegStartPosHeap) Less(i, j int) bool
func (*SegStartPosHeap) Pop ¶
func (h *SegStartPosHeap) Pop() interface{}
func (*SegStartPosHeap) Push ¶
func (h *SegStartPosHeap) Push(x any)
func (SegStartPosHeap) Swap ¶
func (h SegStartPosHeap) Swap(i, j int)
type SelectSegmentFnPolicy ¶
type SelectSegmentFnPolicy struct {
// contains filtered or unexported fields
}
func (SelectSegmentFnPolicy) Reason ¶
func (f SelectSegmentFnPolicy) Reason() string
func (SelectSegmentFnPolicy) SelectSegments ¶
func (f SelectSegmentFnPolicy) SelectSegments(buffers []*segmentBuffer, ts typeutil.Timestamp) []int64
type SelectSegmentFunc ¶
type SyncPolicy ¶
type SyncPolicy interface { SelectSegments(buffers []*segmentBuffer, ts typeutil.Timestamp) []int64 Reason() string }
func GetDroppedSegmentPolicy ¶
func GetDroppedSegmentPolicy(meta metacache.MetaCache) SyncPolicy
func GetFlushTsPolicy ¶
func GetFlushTsPolicy(flushTimestamp *atomic.Uint64, meta metacache.MetaCache) SyncPolicy
func GetFullBufferPolicy ¶
func GetFullBufferPolicy() SyncPolicy
func GetOldestBufferPolicy ¶
func GetOldestBufferPolicy(num int) SyncPolicy
func GetSealedSegmentsPolicy ¶
func GetSealedSegmentsPolicy(meta metacache.MetaCache) SyncPolicy
func GetSyncStaleBufferPolicy ¶
func GetSyncStaleBufferPolicy(staleDuration time.Duration) SyncPolicy
type TimeRange ¶
type TimeRange struct {
// contains filtered or unexported fields
}
TimeRange is a range of timestamp contains the min-timestamp and max-timestamp
func NewTimeRange ¶
func (*TimeRange) GetMaxTimestamp ¶
func (*TimeRange) GetMinTimestamp ¶
type WriteBuffer ¶
type WriteBuffer interface { // HasSegment checks whether certain segment exists in this buffer. HasSegment(segmentID int64) bool // BufferData is the method to buffer dml data msgs. BufferData(insertMsgs []*msgstream.InsertMsg, deleteMsgs []*msgstream.DeleteMsg, startPos, endPos *msgpb.MsgPosition) error // FlushTimestamp set flush timestamp for write buffer SetFlushTimestamp(flushTs uint64) // GetFlushTimestamp get current flush timestamp GetFlushTimestamp() uint64 // SealSegments is the method to perform `Sync` operation with provided options. SealSegments(ctx context.Context, segmentIDs []int64) error // DropPartitions mark segments as Dropped of the partition DropPartitions(partitionIDs []int64) // GetCheckpoint returns current channel checkpoint. // If there are any non-empty segment buffer, returns the earliest buffer start position. // Otherwise, returns latest buffered checkpoint. GetCheckpoint() *msgpb.MsgPosition // MemorySize returns the size in bytes currently used by this write buffer. MemorySize() int64 // EvictBuffer evicts buffer to sync manager which match provided sync policies. EvictBuffer(policies ...SyncPolicy) // Close is the method to close and sink current buffer data. Close(ctx context.Context, drop bool) }
WriteBuffer is the interface for channel write buffer. It provides abstraction for channel write buffer and pk bloom filter & L0 delta logic.
func NewBFWriteBuffer ¶
func NewBFWriteBuffer(channel string, metacache metacache.MetaCache, syncMgr syncmgr.SyncManager, option *writeBufferOption) (WriteBuffer, error)
func NewL0WriteBuffer ¶
func NewL0WriteBuffer(channel string, metacache metacache.MetaCache, syncMgr syncmgr.SyncManager, option *writeBufferOption) (WriteBuffer, error)
func NewWriteBuffer ¶
func NewWriteBuffer(channel string, metacache metacache.MetaCache, syncMgr syncmgr.SyncManager, opts ...WriteBufferOption) (WriteBuffer, error)
type WriteBufferOption ¶
type WriteBufferOption func(opt *writeBufferOption)
func WithDeletePolicy ¶
func WithDeletePolicy(policy string) WriteBufferOption
func WithIDAllocator ¶
func WithIDAllocator(allocator allocator.Interface) WriteBufferOption
func WithMetaWriter ¶
func WithMetaWriter(writer syncmgr.MetaWriter) WriteBufferOption
func WithPKStatsFactory ¶
func WithPKStatsFactory(factory metacache.PkStatsFactory) WriteBufferOption
func WithSyncPolicy ¶
func WithSyncPolicy(policy SyncPolicy) WriteBufferOption