Documentation ¶
Index ¶
- Variables
- type AssignSegmentRequest
- type AssignSegmentResult
- type PChannelSegmentAllocManager
- func (m *PChannelSegmentAllocManager) AssignSegment(ctx context.Context, req *AssignSegmentRequest) (*AssignSegmentResult, error)
- func (m *PChannelSegmentAllocManager) Channel() types.PChannelInfo
- func (m *PChannelSegmentAllocManager) Close(ctx context.Context)
- func (m *PChannelSegmentAllocManager) IsNoWaitSeal() bool
- func (m *PChannelSegmentAllocManager) MustSealSegments(ctx context.Context, infos ...stats.SegmentBelongs)
- func (m *PChannelSegmentAllocManager) NewCollection(collectionID int64, vchannel string, partitionIDs []int64) error
- func (m *PChannelSegmentAllocManager) NewPartition(collectionID int64, partitionID int64) error
- func (m *PChannelSegmentAllocManager) RemoveCollection(ctx context.Context, collectionID int64) error
- func (m *PChannelSegmentAllocManager) RemovePartition(ctx context.Context, collectionID int64, partitionID int64) error
- func (m *PChannelSegmentAllocManager) SealAndFenceSegmentUntil(ctx context.Context, collectionID int64, timetick uint64) ([]int64, error)
- func (m *PChannelSegmentAllocManager) TryToSealSegments(ctx context.Context, infos ...stats.SegmentBelongs)
- func (m *PChannelSegmentAllocManager) TryToSealWaitedSegment(ctx context.Context)
- func (m *PChannelSegmentAllocManager) WaitUntilNoWaitSeal(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrSegmentNotGrowing = errors.New("segment is not growing") ErrTimeTickTooOld = errors.New("time tick is too old") ErrNotEnoughSpace = stats.ErrNotEnoughSpace ErrTooLargeInsert = stats.ErrTooLargeInsert )
var ErrFencedAssign = errors.New("fenced assign")
Functions ¶
This section is empty.
Types ¶
type AssignSegmentRequest ¶
type AssignSegmentRequest struct { CollectionID int64 PartitionID int64 InsertMetrics stats.InsertMetrics TimeTick uint64 TxnSession *txn.TxnSession }
AssignSegmentRequest is a request to allocate segment.
type AssignSegmentResult ¶
type AssignSegmentResult struct { SegmentID int64 Acknowledge *atomic.Int32 // used to ack the segment assign result has been consumed }
AssignSegmentResult is a result of segment allocation. The sum of Results.Row is equal to InserMetrics.NumRows.
func (*AssignSegmentResult) Ack ¶
func (r *AssignSegmentResult) Ack()
Ack acks the segment assign result has been consumed. Must be only call once after the segment assign result has been consumed.
type PChannelSegmentAllocManager ¶
type PChannelSegmentAllocManager struct {
// contains filtered or unexported fields
}
PChannelSegmentAllocManager is a segment assign manager of determined pchannel.
func RecoverPChannelSegmentAllocManager ¶
func RecoverPChannelSegmentAllocManager( ctx context.Context, pchannel types.PChannelInfo, wal *syncutil.Future[wal.WAL], ) (*PChannelSegmentAllocManager, error)
RecoverPChannelSegmentAllocManager recovers the segment assignment manager at the specified pchannel.
func (*PChannelSegmentAllocManager) AssignSegment ¶
func (m *PChannelSegmentAllocManager) AssignSegment(ctx context.Context, req *AssignSegmentRequest) (*AssignSegmentResult, error)
AssignSegment assigns a segment for a assign segment request.
func (*PChannelSegmentAllocManager) Channel ¶
func (m *PChannelSegmentAllocManager) Channel() types.PChannelInfo
Channel returns the pchannel info.
func (*PChannelSegmentAllocManager) Close ¶
func (m *PChannelSegmentAllocManager) Close(ctx context.Context)
Close try to persist all stats and invalid the manager.
func (*PChannelSegmentAllocManager) IsNoWaitSeal ¶
func (m *PChannelSegmentAllocManager) IsNoWaitSeal() bool
IsNoWaitSeal returns whether the segment manager is no segment wait for seal.
func (*PChannelSegmentAllocManager) MustSealSegments ¶
func (m *PChannelSegmentAllocManager) MustSealSegments(ctx context.Context, infos ...stats.SegmentBelongs)
func (*PChannelSegmentAllocManager) NewCollection ¶
func (m *PChannelSegmentAllocManager) NewCollection(collectionID int64, vchannel string, partitionIDs []int64) error
NewPartitions creates a new partition with the specified partitionIDs.
func (*PChannelSegmentAllocManager) NewPartition ¶
func (m *PChannelSegmentAllocManager) NewPartition(collectionID int64, partitionID int64) error
NewPartition creates a new partition with the specified partitionID.
func (*PChannelSegmentAllocManager) RemoveCollection ¶
func (m *PChannelSegmentAllocManager) RemoveCollection(ctx context.Context, collectionID int64) error
RemoveCollection removes the specified collection.
func (*PChannelSegmentAllocManager) RemovePartition ¶
func (m *PChannelSegmentAllocManager) RemovePartition(ctx context.Context, collectionID int64, partitionID int64) error
RemovePartition removes the specified partitions.
func (*PChannelSegmentAllocManager) SealAndFenceSegmentUntil ¶
func (m *PChannelSegmentAllocManager) SealAndFenceSegmentUntil(ctx context.Context, collectionID int64, timetick uint64) ([]int64, error)
SealAndFenceSegmentUntil seal all segment that contains the message less than the incoming timetick.
func (*PChannelSegmentAllocManager) TryToSealSegments ¶
func (m *PChannelSegmentAllocManager) TryToSealSegments(ctx context.Context, infos ...stats.SegmentBelongs)
TryToSealSegments tries to seal the specified segments.
func (*PChannelSegmentAllocManager) TryToSealWaitedSegment ¶
func (m *PChannelSegmentAllocManager) TryToSealWaitedSegment(ctx context.Context)
TryToSealWaitedSegment tries to seal the wait for sealing segment.
func (*PChannelSegmentAllocManager) WaitUntilNoWaitSeal ¶
func (m *PChannelSegmentAllocManager) WaitUntilNoWaitSeal(ctx context.Context) error
WaitUntilNoWaitSeal waits until no segment wait for seal.