delegator

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

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Overview

delegator package contains the logic of shard delegator.

Index

Constants

View Source
const (
	ForwardPolicyDefault         = ``
	L0ForwardPolicyBF            = `FilterByBF`
	L0ForwardPolicyRemoteLoad    = `RemoteLoad`
	StreamingForwardPolicyBF     = `FilterByBF`
	StreamingForwardPolicyDirect = `Direct`
)

Variables

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

ErrTsLagTooLarge serviceable and guarantee lag too large.

Functions

func BuildSparseFieldData

func BuildSparseFieldData(field *schemapb.FieldSchema, sparseArray *schemapb.SparseFloatArray) *schemapb.FieldData

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 PruneByScalarField

func PruneByScalarField(expr Expr, segmentStats []storage.SegmentStats, segmentIDs []UniqueID, filteredSegments map[UniqueID]struct{})

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 SetBM25Params

func SetBM25Params(req *internalpb.SearchRequest, avgdl float64) error

func WrapErrTsLagTooLarge

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

WrapErrTsLagTooLarge wraps ErrTsLagTooLarge with lag and max value.

Types

type BatchApplyRet

type BatchApplyRet = struct {
	DeleteDataIdx int
	StartIdx      int
	Segment2Hits  map[int64][]bool
}

type BinaryRangeExpr

type BinaryRangeExpr struct {
	PhysicalExpr
	// contains filtered or unexported fields
}

func NewBinaryRangeExpr

func NewBinaryRangeExpr(lower storage.ScalarFieldValue,
	upper storage.ScalarFieldValue, inLower bool, inUpper bool,
) *BinaryRangeExpr

func (*BinaryRangeExpr) Eval

func (bre *BinaryRangeExpr) Eval(evalCtx *EvalCtx) *bitset.BitSet

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 EvalCtx

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

func NewEvalCtx

func NewEvalCtx(segStats []storage.SegmentStats, size uint, allTrueBst *bitset.BitSet) *EvalCtx

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 Expr

type Expr interface {
	Inputs() []Expr
	Eval(evalCtx *EvalCtx) *bitset.BitSet
}

func ParseBinaryRangeExpr

func ParseBinaryRangeExpr(exprPb *planpb.BinaryRangeExpr, parseCtx *ParseContext) (Expr, error)

func ParseExpr

func ParseExpr(exprPb *planpb.Expr, parseCtx *ParseContext) (Expr, error)

func ParseLogicalBinaryExpr

func ParseLogicalBinaryExpr(exprPb *planpb.BinaryExpr, parseCtx *ParseContext) (Expr, error)

func ParseLogicalUnaryExpr

func ParseLogicalUnaryExpr(exprPb *planpb.UnaryExpr, parseCtx *ParseContext) (Expr, error)

func ParseTermExpr

func ParseTermExpr(exprPb *planpb.TermExpr, parseCtx *ParseContext) (Expr, error)

func ParseUnaryRangeExpr

func ParseUnaryRangeExpr(exprPb *planpb.UnaryRangeExpr, parseCtx *ParseContext) (Expr, error)

type FieldID

type FieldID = int64

FieldID is to uniquely identify the field

type IDFOracle

type IDFOracle interface {
	SyncDistribution(snapshot *snapshot)

	UpdateGrowing(segmentID int64, stats map[int64]*storage.BM25Stats)

	Register(segmentID int64, stats map[int64]*storage.BM25Stats, state commonpb.SegmentState)
	Remove(segmentID int64, state commonpb.SegmentState)

	BuildIDF(fieldID int64, tfs *schemapb.SparseFloatArray) ([][]byte, float64, error)
}

func NewIDFOracle

func NewIDFOracle(functions []*schemapb.FunctionSchema) IDFOracle

type InsertData

type InsertData struct {
	RowIDs       []int64
	PrimaryKeys  []storage.PrimaryKey
	Timestamps   []uint64
	InsertRecord *segcorepb.InsertRecord
	BM25Stats    map[int64]*storage.BM25Stats

	StartPosition *msgpb.MsgPosition
	PartitionID   int64
}

InsertData

type IntPrimaryKey

type IntPrimaryKey = typeutil.IntPrimaryKey

IntPrimaryKey is the primary key of int type

type LogicalBinaryExpr

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

func NewLogicalBinaryExpr

func NewLogicalBinaryExpr(l Expr, r Expr, op planpb.BinaryExpr_BinaryOp) *LogicalBinaryExpr

func (*LogicalBinaryExpr) Eval

func (lbe *LogicalBinaryExpr) Eval(evalCtx *EvalCtx) *bitset.BitSet

func (*LogicalBinaryExpr) Inputs

func (lbe *LogicalBinaryExpr) Inputs() []Expr

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) GetDeleteBufferSize

func (_m *MockShardDelegator) GetDeleteBufferSize() (int64, int64)

GetDeleteBufferSize provides a mock function with given fields:

func (*MockShardDelegator) GetPartitionStatsVersions

func (_m *MockShardDelegator) GetPartitionStatsVersions(ctx context.Context) map[int64]int64

GetPartitionStatsVersions provides a mock function with given fields: ctx

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) SyncPartitionStats

func (_m *MockShardDelegator) SyncPartitionStats(ctx context.Context, partVersions map[int64]int64)

SyncPartitionStats provides a mock function with given fields: ctx, partVersions

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) GetDeleteBufferSize

GetDeleteBufferSize is a helper method to define mock.On call

func (*MockShardDelegator_Expecter) GetPartitionStatsVersions

func (_e *MockShardDelegator_Expecter) GetPartitionStatsVersions(ctx interface{}) *MockShardDelegator_GetPartitionStatsVersions_Call

GetPartitionStatsVersions is a helper method to define mock.On call

  • ctx context.Context

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) SyncPartitionStats

func (_e *MockShardDelegator_Expecter) SyncPartitionStats(ctx interface{}, partVersions interface{}) *MockShardDelegator_SyncPartitionStats_Call

SyncPartitionStats is a helper method to define mock.On call

  • ctx context.Context
  • partVersions map[int64]int64

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_GetDeleteBufferSize_Call

type MockShardDelegator_GetDeleteBufferSize_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_GetDeleteBufferSize_Call) Return

func (*MockShardDelegator_GetDeleteBufferSize_Call) Run

func (*MockShardDelegator_GetDeleteBufferSize_Call) RunAndReturn

type MockShardDelegator_GetPartitionStatsVersions_Call

type MockShardDelegator_GetPartitionStatsVersions_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_GetPartitionStatsVersions_Call) Return

func (*MockShardDelegator_GetPartitionStatsVersions_Call) Run

func (*MockShardDelegator_GetPartitionStatsVersions_Call) RunAndReturn

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_SyncPartitionStats_Call

type MockShardDelegator_SyncPartitionStats_Call struct {
	*mock.Call
}

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

func (*MockShardDelegator_SyncPartitionStats_Call) Return

func (*MockShardDelegator_SyncPartitionStats_Call) Run

func (*MockShardDelegator_SyncPartitionStats_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 ParseContext

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

func NewParseContext

func NewParseContext(keyField FieldID, dType schemapb.DataType) *ParseContext

type PhysicalExpr

type PhysicalExpr struct {
	Expr
}

func (*PhysicalExpr) Inputs

func (lbe *PhysicalExpr) Inputs() []Expr

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
	Level         datapb.SegmentLevel
}

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)
	SyncPartitionStats(ctx context.Context, partVersions map[int64]int64)
	GetPartitionStatsVersions(ctx context.Context) map[int64]int64
	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
	GetDeleteBufferSize() (entryNum int64, memorySize 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 TermExpr

type TermExpr struct {
	PhysicalExpr
	// contains filtered or unexported fields
}

func NewTermExpr

func NewTermExpr(values []storage.ScalarFieldValue) *TermExpr

func (*TermExpr) Eval

func (te *TermExpr) Eval(evalCtx *EvalCtx) *bitset.BitSet

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 UnaryRangeExpr

type UnaryRangeExpr struct {
	PhysicalExpr
	// contains filtered or unexported fields
}

func NewUnaryRangeExpr

func NewUnaryRangeExpr(value storage.ScalarFieldValue, op planpb.OpType) *UnaryRangeExpr

func (*UnaryRangeExpr) Eval

func (ure *UnaryRangeExpr) Eval(
	evalCtx *EvalCtx,
) *bitset.BitSet

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