delegator

package
v0.10.3-0...-f06509b Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Overview

delegator package contains the logic of shard delegator.

Index

Constants

This section is empty.

Variables

View Source
var ErrTsLagTooLarge = errors.New("Timestamp lag too large")

ErrTsLagTooLarge serviceable and guarantee lag too large.

Functions

func FilterSegmentsByVector

func FilterSegmentsByVector(partitionStats *storage.PartitionStatsSnapshot,
	searchReq *internalpb.SearchRequest,
	vectorBytes [][]byte,
	dim int64,
	keyField *schemapb.FieldSchema,
	filteredSegments map[UniqueID]struct{},
	filterRatio float64,
)

func FilterSegmentsOnScalarField

func FilterSegmentsOnScalarField(partitionStats *storage.PartitionStatsSnapshot,
	targetRanges []*exprutil.PlanRange,
	keyField *schemapb.FieldSchema,
	filteredSegments map[UniqueID]struct{},
)

func NewDistribution

func NewDistribution() *distribution

NewDistribution creates a new distribution instance with all field initialized.

func NewSnapshot

func NewSnapshot(sealed []SnapshotItem, growing []SegmentEntry, last *snapshot, version int64, targetVersion int64) *snapshot

NewSnapshot returns a prepared snapshot with channel initialized.

func PruneSegments

func PruneSegments(ctx context.Context,
	partitionStats map[UniqueID]*storage.PartitionStatsSnapshot,
	searchReq *internalpb.SearchRequest,
	queryReq *internalpb.RetrieveRequest,
	schema *schemapb.CollectionSchema,
	sealedSegments []SnapshotItem,
	info PruneInfo,
)

func WrapErrTsLagTooLarge

func WrapErrTsLagTooLarge(duration time.Duration, maxLag time.Duration) error

WrapErrTsLagTooLarge wraps ErrTsLagTooLarge with lag and max value.

Types

type ConsumeSubName

type ConsumeSubName = string

ConsumeSubName is consumer's subscription name of the message stream

type DSL

type DSL = string

DSL is the Domain Specific Language

type DeleteData

type DeleteData struct {
	PartitionID int64
	PrimaryKeys []storage.PrimaryKey
	Timestamps  []uint64
	RowCount    int64
}

func (*DeleteData) Append

func (d *DeleteData) Append(ad DeleteData)

Append appends another delete data into this one.

type ExcludedSegments

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

func NewExcludedSegments

func NewExcludedSegments(cleanInterval time.Duration) *ExcludedSegments

func (*ExcludedSegments) CleanInvalid

func (s *ExcludedSegments) CleanInvalid(ts uint64)

func (*ExcludedSegments) Insert

func (s *ExcludedSegments) Insert(excludeInfo map[int64]uint64)

func (*ExcludedSegments) ShouldClean

func (s *ExcludedSegments) ShouldClean() bool

func (*ExcludedSegments) Verify

func (s *ExcludedSegments) Verify(segmentID int64, ts uint64) bool

return false if segment has been excluded

type FieldID

type FieldID = int64

FieldID is to uniquely identify the field

type InsertData

type InsertData struct {
	RowIDs        []int64
	PrimaryKeys   []storage.PrimaryKey
	Timestamps    []uint64
	InsertRecord  *segcorepb.InsertRecord
	StartPosition *msgpb.MsgPosition
	PartitionID   int64
}

InsertData

type IntPrimaryKey

type IntPrimaryKey = typeutil.IntPrimaryKey

IntPrimaryKey is the primary key of int type

type MockShardDelegator

type MockShardDelegator struct {
	mock.Mock
}

MockShardDelegator is an autogenerated mock type for the ShardDelegator type

func NewMockShardDelegator

func NewMockShardDelegator(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockShardDelegator

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

func (*MockShardDelegator) AddExcludedSegments

func (_m *MockShardDelegator) AddExcludedSegments(excludeInfo map[int64]uint64)

AddExcludedSegments provides a mock function with given fields: excludeInfo

func (*MockShardDelegator) Close

func (_m *MockShardDelegator) Close()

Close provides a mock function with given fields:

func (*MockShardDelegator) Collection

func (_m *MockShardDelegator) Collection() int64

Collection provides a mock function with given fields:

func (*MockShardDelegator) EXPECT

func (*MockShardDelegator) GetSegmentInfo

func (_m *MockShardDelegator) GetSegmentInfo(readable bool) ([]SnapshotItem, []SegmentEntry)

GetSegmentInfo provides a mock function with given fields: readable

func (*MockShardDelegator) GetStatistics

GetStatistics provides a mock function with given fields: ctx, req

func (*MockShardDelegator) GetTargetVersion

func (_m *MockShardDelegator) GetTargetVersion() int64

GetTargetVersion provides a mock function with given fields:

func (*MockShardDelegator) LoadGrowing

func (_m *MockShardDelegator) LoadGrowing(ctx context.Context, infos []*querypb.SegmentLoadInfo, version int64) error

LoadGrowing provides a mock function with given fields: ctx, infos, version

func (*MockShardDelegator) LoadSegments

func (_m *MockShardDelegator) LoadSegments(ctx context.Context, req *querypb.LoadSegmentsRequest) error

LoadSegments provides a mock function with given fields: ctx, req

func (*MockShardDelegator) ProcessDelete

func (_m *MockShardDelegator) ProcessDelete(deleteData []*DeleteData, ts uint64)

ProcessDelete provides a mock function with given fields: deleteData, ts

func (*MockShardDelegator) ProcessInsert

func (_m *MockShardDelegator) ProcessInsert(insertRecords map[int64]*InsertData)

ProcessInsert provides a mock function with given fields: insertRecords

func (*MockShardDelegator) Query

Query provides a mock function with given fields: ctx, req

func (*MockShardDelegator) QueryStream

QueryStream provides a mock function with given fields: ctx, req, srv

func (*MockShardDelegator) ReleaseSegments

func (_m *MockShardDelegator) ReleaseSegments(ctx context.Context, req *querypb.ReleaseSegmentsRequest, force bool) error

ReleaseSegments provides a mock function with given fields: ctx, req, force

func (*MockShardDelegator) Search

Search provides a mock function with given fields: ctx, req

func (*MockShardDelegator) Serviceable

func (_m *MockShardDelegator) Serviceable() bool

Serviceable provides a mock function with given fields:

func (*MockShardDelegator) Start

func (_m *MockShardDelegator) Start()

Start provides a mock function with given fields:

func (*MockShardDelegator) SyncDistribution

func (_m *MockShardDelegator) SyncDistribution(ctx context.Context, entries ...SegmentEntry)

SyncDistribution provides a mock function with given fields: ctx, entries

func (*MockShardDelegator) SyncTargetVersion

func (_m *MockShardDelegator) SyncTargetVersion(newVersion int64, growingInTarget []int64, sealedInTarget []int64, droppedInTarget []int64, checkpoint *msgpb.MsgPosition)

SyncTargetVersion provides a mock function with given fields: newVersion, growingInTarget, sealedInTarget, droppedInTarget, checkpoint

func (*MockShardDelegator) TryCleanExcludedSegments

func (_m *MockShardDelegator) TryCleanExcludedSegments(ts uint64)

TryCleanExcludedSegments provides a mock function with given fields: ts

func (*MockShardDelegator) VerifyExcludedSegments

func (_m *MockShardDelegator) VerifyExcludedSegments(segmentID int64, ts uint64) bool

VerifyExcludedSegments provides a mock function with given fields: segmentID, ts

func (*MockShardDelegator) Version

func (_m *MockShardDelegator) Version() int64

Version provides a mock function with given fields:

type MockShardDelegator_AddExcludedSegments_Call

type MockShardDelegator_AddExcludedSegments_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_AddExcludedSegments_Call) Return

func (*MockShardDelegator_AddExcludedSegments_Call) Run

func (*MockShardDelegator_AddExcludedSegments_Call) RunAndReturn

type MockShardDelegator_Close_Call

type MockShardDelegator_Close_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_Close_Call) Return

func (*MockShardDelegator_Close_Call) Run

func (*MockShardDelegator_Close_Call) RunAndReturn

func (_c *MockShardDelegator_Close_Call) RunAndReturn(run func()) *MockShardDelegator_Close_Call

type MockShardDelegator_Collection_Call

type MockShardDelegator_Collection_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_Collection_Call) Return

func (*MockShardDelegator_Collection_Call) Run

func (*MockShardDelegator_Collection_Call) RunAndReturn

type MockShardDelegator_Expecter

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

func (*MockShardDelegator_Expecter) AddExcludedSegments

func (_e *MockShardDelegator_Expecter) AddExcludedSegments(excludeInfo interface{}) *MockShardDelegator_AddExcludedSegments_Call

AddExcludedSegments is a helper method to define mock.On call

  • excludeInfo map[int64]uint64

func (*MockShardDelegator_Expecter) Close

Close is a helper method to define mock.On call

func (*MockShardDelegator_Expecter) Collection

Collection is a helper method to define mock.On call

func (*MockShardDelegator_Expecter) GetSegmentInfo

func (_e *MockShardDelegator_Expecter) GetSegmentInfo(readable interface{}) *MockShardDelegator_GetSegmentInfo_Call

GetSegmentInfo is a helper method to define mock.On call

  • readable bool

func (*MockShardDelegator_Expecter) GetStatistics

func (_e *MockShardDelegator_Expecter) GetStatistics(ctx interface{}, req interface{}) *MockShardDelegator_GetStatistics_Call

GetStatistics is a helper method to define mock.On call

  • ctx context.Context
  • req *querypb.GetStatisticsRequest

func (*MockShardDelegator_Expecter) GetTargetVersion

GetTargetVersion is a helper method to define mock.On call

func (*MockShardDelegator_Expecter) LoadGrowing

func (_e *MockShardDelegator_Expecter) LoadGrowing(ctx interface{}, infos interface{}, version interface{}) *MockShardDelegator_LoadGrowing_Call

LoadGrowing is a helper method to define mock.On call

  • ctx context.Context
  • infos []*querypb.SegmentLoadInfo
  • version int64

func (*MockShardDelegator_Expecter) LoadSegments

func (_e *MockShardDelegator_Expecter) LoadSegments(ctx interface{}, req interface{}) *MockShardDelegator_LoadSegments_Call

LoadSegments is a helper method to define mock.On call

  • ctx context.Context
  • req *querypb.LoadSegmentsRequest

func (*MockShardDelegator_Expecter) ProcessDelete

func (_e *MockShardDelegator_Expecter) ProcessDelete(deleteData interface{}, ts interface{}) *MockShardDelegator_ProcessDelete_Call

ProcessDelete is a helper method to define mock.On call

  • deleteData []*DeleteData
  • ts uint64

func (*MockShardDelegator_Expecter) ProcessInsert

func (_e *MockShardDelegator_Expecter) ProcessInsert(insertRecords interface{}) *MockShardDelegator_ProcessInsert_Call

ProcessInsert is a helper method to define mock.On call

  • insertRecords map[int64]*InsertData

func (*MockShardDelegator_Expecter) Query

func (_e *MockShardDelegator_Expecter) Query(ctx interface{}, req interface{}) *MockShardDelegator_Query_Call

Query is a helper method to define mock.On call

  • ctx context.Context
  • req *querypb.QueryRequest

func (*MockShardDelegator_Expecter) QueryStream

func (_e *MockShardDelegator_Expecter) QueryStream(ctx interface{}, req interface{}, srv interface{}) *MockShardDelegator_QueryStream_Call

QueryStream is a helper method to define mock.On call

  • ctx context.Context
  • req *querypb.QueryRequest
  • srv streamrpc.QueryStreamServer

func (*MockShardDelegator_Expecter) ReleaseSegments

func (_e *MockShardDelegator_Expecter) ReleaseSegments(ctx interface{}, req interface{}, force interface{}) *MockShardDelegator_ReleaseSegments_Call

ReleaseSegments is a helper method to define mock.On call

  • ctx context.Context
  • req *querypb.ReleaseSegmentsRequest
  • force bool

func (*MockShardDelegator_Expecter) Search

func (_e *MockShardDelegator_Expecter) Search(ctx interface{}, req interface{}) *MockShardDelegator_Search_Call

Search is a helper method to define mock.On call

  • ctx context.Context
  • req *querypb.SearchRequest

func (*MockShardDelegator_Expecter) Serviceable

Serviceable is a helper method to define mock.On call

func (*MockShardDelegator_Expecter) Start

Start is a helper method to define mock.On call

func (*MockShardDelegator_Expecter) SyncDistribution

func (_e *MockShardDelegator_Expecter) SyncDistribution(ctx interface{}, entries ...interface{}) *MockShardDelegator_SyncDistribution_Call

SyncDistribution is a helper method to define mock.On call

  • ctx context.Context
  • entries ...SegmentEntry

func (*MockShardDelegator_Expecter) SyncTargetVersion

func (_e *MockShardDelegator_Expecter) SyncTargetVersion(newVersion interface{}, growingInTarget interface{}, sealedInTarget interface{}, droppedInTarget interface{}, checkpoint interface{}) *MockShardDelegator_SyncTargetVersion_Call

SyncTargetVersion is a helper method to define mock.On call

  • newVersion int64
  • growingInTarget []int64
  • sealedInTarget []int64
  • droppedInTarget []int64
  • checkpoint *msgpb.MsgPosition

func (*MockShardDelegator_Expecter) TryCleanExcludedSegments

func (_e *MockShardDelegator_Expecter) TryCleanExcludedSegments(ts interface{}) *MockShardDelegator_TryCleanExcludedSegments_Call

TryCleanExcludedSegments is a helper method to define mock.On call

  • ts uint64

func (*MockShardDelegator_Expecter) VerifyExcludedSegments

func (_e *MockShardDelegator_Expecter) VerifyExcludedSegments(segmentID interface{}, ts interface{}) *MockShardDelegator_VerifyExcludedSegments_Call

VerifyExcludedSegments is a helper method to define mock.On call

  • segmentID int64
  • ts uint64

func (*MockShardDelegator_Expecter) Version

Version is a helper method to define mock.On call

type MockShardDelegator_GetSegmentInfo_Call

type MockShardDelegator_GetSegmentInfo_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_GetSegmentInfo_Call) Return

func (*MockShardDelegator_GetSegmentInfo_Call) Run

func (*MockShardDelegator_GetSegmentInfo_Call) RunAndReturn

type MockShardDelegator_GetStatistics_Call

type MockShardDelegator_GetStatistics_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_GetStatistics_Call) Return

func (*MockShardDelegator_GetStatistics_Call) Run

type MockShardDelegator_GetTargetVersion_Call

type MockShardDelegator_GetTargetVersion_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_GetTargetVersion_Call) Return

func (*MockShardDelegator_GetTargetVersion_Call) Run

func (*MockShardDelegator_GetTargetVersion_Call) RunAndReturn

type MockShardDelegator_LoadGrowing_Call

type MockShardDelegator_LoadGrowing_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_LoadGrowing_Call) Return

func (*MockShardDelegator_LoadGrowing_Call) Run

func (*MockShardDelegator_LoadGrowing_Call) RunAndReturn

type MockShardDelegator_LoadSegments_Call

type MockShardDelegator_LoadSegments_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_LoadSegments_Call) Return

func (*MockShardDelegator_LoadSegments_Call) Run

func (*MockShardDelegator_LoadSegments_Call) RunAndReturn

type MockShardDelegator_ProcessDelete_Call

type MockShardDelegator_ProcessDelete_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_ProcessDelete_Call) Return

func (*MockShardDelegator_ProcessDelete_Call) Run

func (*MockShardDelegator_ProcessDelete_Call) RunAndReturn

type MockShardDelegator_ProcessInsert_Call

type MockShardDelegator_ProcessInsert_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_ProcessInsert_Call) Return

func (*MockShardDelegator_ProcessInsert_Call) Run

func (*MockShardDelegator_ProcessInsert_Call) RunAndReturn

type MockShardDelegator_QueryStream_Call

type MockShardDelegator_QueryStream_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_QueryStream_Call) Return

func (*MockShardDelegator_QueryStream_Call) Run

type MockShardDelegator_Query_Call

type MockShardDelegator_Query_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_Query_Call) Return

func (*MockShardDelegator_Query_Call) Run

func (*MockShardDelegator_Query_Call) RunAndReturn

type MockShardDelegator_ReleaseSegments_Call

type MockShardDelegator_ReleaseSegments_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_ReleaseSegments_Call) Return

func (*MockShardDelegator_ReleaseSegments_Call) Run

func (*MockShardDelegator_ReleaseSegments_Call) RunAndReturn

type MockShardDelegator_Search_Call

type MockShardDelegator_Search_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_Search_Call) Return

func (*MockShardDelegator_Search_Call) Run

func (*MockShardDelegator_Search_Call) RunAndReturn

type MockShardDelegator_Serviceable_Call

type MockShardDelegator_Serviceable_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_Serviceable_Call) Return

func (*MockShardDelegator_Serviceable_Call) Run

func (*MockShardDelegator_Serviceable_Call) RunAndReturn

type MockShardDelegator_Start_Call

type MockShardDelegator_Start_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_Start_Call) Return

func (*MockShardDelegator_Start_Call) Run

func (*MockShardDelegator_Start_Call) RunAndReturn

func (_c *MockShardDelegator_Start_Call) RunAndReturn(run func()) *MockShardDelegator_Start_Call

type MockShardDelegator_SyncDistribution_Call

type MockShardDelegator_SyncDistribution_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_SyncDistribution_Call) Return

func (*MockShardDelegator_SyncDistribution_Call) Run

func (*MockShardDelegator_SyncDistribution_Call) RunAndReturn

type MockShardDelegator_SyncTargetVersion_Call

type MockShardDelegator_SyncTargetVersion_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_SyncTargetVersion_Call) Return

func (*MockShardDelegator_SyncTargetVersion_Call) Run

func (_c *MockShardDelegator_SyncTargetVersion_Call) Run(run func(newVersion int64, growingInTarget []int64, sealedInTarget []int64, droppedInTarget []int64, checkpoint *msgpb.MsgPosition)) *MockShardDelegator_SyncTargetVersion_Call

func (*MockShardDelegator_SyncTargetVersion_Call) RunAndReturn

type MockShardDelegator_TryCleanExcludedSegments_Call

type MockShardDelegator_TryCleanExcludedSegments_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_TryCleanExcludedSegments_Call) Return

func (*MockShardDelegator_TryCleanExcludedSegments_Call) Run

func (*MockShardDelegator_TryCleanExcludedSegments_Call) RunAndReturn

type MockShardDelegator_VerifyExcludedSegments_Call

type MockShardDelegator_VerifyExcludedSegments_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_VerifyExcludedSegments_Call) Return

func (*MockShardDelegator_VerifyExcludedSegments_Call) Run

func (*MockShardDelegator_VerifyExcludedSegments_Call) RunAndReturn

type MockShardDelegator_Version_Call

type MockShardDelegator_Version_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_Version_Call) Return

func (*MockShardDelegator_Version_Call) Run

func (*MockShardDelegator_Version_Call) RunAndReturn

type PruneInfo

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

type SegmentEntry

type SegmentEntry struct {
	NodeID        int64
	SegmentID     UniqueID
	PartitionID   UniqueID
	Version       int64
	TargetVersion int64
}

SegmentEntry stores the segment meta information.

type ShardDelegator

type ShardDelegator interface {
	Collection() int64
	Version() int64
	GetSegmentInfo(readable bool) (sealed []SnapshotItem, growing []SegmentEntry)
	SyncDistribution(ctx context.Context, entries ...SegmentEntry)
	Search(ctx context.Context, req *querypb.SearchRequest) ([]*internalpb.SearchResults, error)
	Query(ctx context.Context, req *querypb.QueryRequest) ([]*internalpb.RetrieveResults, error)
	QueryStream(ctx context.Context, req *querypb.QueryRequest, srv streamrpc.QueryStreamServer) error
	GetStatistics(ctx context.Context, req *querypb.GetStatisticsRequest) ([]*internalpb.GetStatisticsResponse, error)

	// data
	ProcessInsert(insertRecords map[int64]*InsertData)
	ProcessDelete(deleteData []*DeleteData, ts uint64)
	LoadGrowing(ctx context.Context, infos []*querypb.SegmentLoadInfo, version int64) error
	LoadSegments(ctx context.Context, req *querypb.LoadSegmentsRequest) error
	ReleaseSegments(ctx context.Context, req *querypb.ReleaseSegmentsRequest, force bool) error
	SyncTargetVersion(newVersion int64, growingInTarget []int64, sealedInTarget []int64, droppedInTarget []int64, checkpoint *msgpb.MsgPosition)
	GetTargetVersion() int64

	// manage exclude segments
	AddExcludedSegments(excludeInfo map[int64]uint64)
	VerifyExcludedSegments(segmentID int64, ts uint64) bool
	TryCleanExcludedSegments(ts uint64)

	// control
	Serviceable() bool
	Start()
	Close()
}

ShardDelegator is the interface definition.

func NewShardDelegator

func NewShardDelegator(ctx context.Context, collectionID UniqueID, replicaID UniqueID, channel string, version int64,
	workerManager cluster.Manager, manager *segments.Manager, tsafeManager tsafe.Manager, loader segments.Loader,
	factory msgstream.Factory, startTs uint64, queryHook optimizers.QueryHook, chunkManager storage.ChunkManager,
) (ShardDelegator, error)

NewShardDelegator creates a new ShardDelegator instance with all fields initialized.

type SnapshotItem

type SnapshotItem struct {
	NodeID   int64
	Segments []SegmentEntry
}

SnapshotItem group segmentEntry slice

type TSafeUpdater

type TSafeUpdater interface {
	RegisterChannel(string) chan Timestamp
	UnregisterChannel(string) error
}

TSafeUpdater is the interface for type provides tsafe update event

type TimeRange

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

TimeRange is a range of time periods

type Timestamp

type Timestamp = typeutil.Timestamp

Timestamp is timestamp

type UniqueID

type UniqueID = typeutil.UniqueID

UniqueID is an identifier that is guaranteed to be unique among all the collections, partitions and segments

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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