segments

package
v0.10.3-0...-72f83e0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 77 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SegmentTypeGrowing = commonpb.SegmentState_Growing
	SegmentTypeSealed  = commonpb.SegmentState_Sealed
)
View Source
const (
	UsedDiskMemoryRatio      = 4
	UsedDiskMemoryRatioAisaq = 64
)

Variables

View Source
var ErrSegmentUnhealthy = errors.New("segment unhealthy")

Functions

func CollectPoolStats

func CollectPoolStats() []metrics.PoolStats

CollectPoolStats returns current stats for all goroutine pools. Called by PoolMetricsCollector at Prometheus scrape time (pull model).

func DecodeSearchResults

func DecodeSearchResults(ctx context.Context, searchResults []*internalpb.SearchResults) ([]*schemapb.SearchResultData, error)

func DeleteCollection

func DeleteCollection(collection *Collection)

deleteCollection delete collection and free the collection memory

func DeleteSearchResults

func DeleteSearchResults(results []*SearchResult)

func DoubleMemoryDataType

func DoubleMemoryDataType(dataType schemapb.DataType) bool

func DoubleMemorySystemField

func DoubleMemorySystemField(fieldID int64) bool

func EncodeSearchResultData

func EncodeSearchResultData(ctx context.Context, searchResultData *schemapb.SearchResultData,
	nq int64, topk int64, metricType string,
) (searchResults *internalpb.SearchResults, err error)

func ExtractOffsetFromVirtualPK

func ExtractOffsetFromVirtualPK(virtualPK int64) int64

ExtractOffsetFromVirtualPK extracts the offset from a virtual PK.

func ExtractSegmentIDFromVirtualPK

func ExtractSegmentIDFromVirtualPK(virtualPK int64) int64

ExtractSegmentIDFromVirtualPK extracts the segmentID from a virtual PK. Uses unsigned right shift to avoid sign-extension for large segment IDs.

func FilterZeroValuesFromSlice

func FilterZeroValuesFromSlice(intVals []int64) []int64

func GetBFApplyPool

func GetBFApplyPool() *conc.Pool[any]

func GetBM25LoadPool

func GetBM25LoadPool() *conc.Pool[any]

func GetCLoadInfoWithFunc

func GetCLoadInfoWithFunc(ctx context.Context,
	fieldSchema *schemapb.FieldSchema,
	loadInfo *querypb.SegmentLoadInfo,
	indexInfo *querypb.FieldIndexInfo,
	f func(c *LoadIndexInfo) error,
) error

func GetDeletePool

func GetDeletePool() *conc.Pool[struct{}]

func GetDynamicPool

func GetDynamicPool() *conc.Pool[any]

GetDynamicPool returns the singleton pool for dynamic cgo operations.

func GetLoadPool

func GetLoadPool() *conc.Pool[any]

func GetPkField

func GetPkField(schema *schemapb.CollectionSchema) *schemapb.FieldSchema

func GetPrimaryKeys

func GetPrimaryKeys(msg *msgstream.InsertMsg, schema *schemapb.CollectionSchema) ([]storage.PrimaryKey, error)

TODO: remove this function to proper file GetPrimaryKeys would get primary keys by insert messages

func GetSQPool

func GetSQPool() *conc.Pool[any]

GetSQPool returns the singleton pool instance for search/query operations.

func GetSegmentRelatedDataSize

func GetSegmentRelatedDataSize(segment Segment) int64

func GetVirtualPK

func GetVirtualPK(segmentID int64, offset int64) int64

GetVirtualPK generates a virtual primary key from segmentID and offset. Virtual PK format: (truncated_segmentID << 32) | offset Only the lower 32 bits of segmentID are preserved. Milvus segment IDs are TSO-allocated 64-bit values that typically exceed 32 bits, so truncation is expected. Use IsVirtualPKFromSegment for safe comparison.

func GetWarmupPool

func GetWarmupPool() *conc.Pool[any]

func HandleCStatus

func HandleCStatus(ctx context.Context, status *C.CStatus, extraInfo string, fields ...zap.Field) error

HandleCStatus deals with the error returned from CGO

func IsExternalField

func IsExternalField(field *schemapb.FieldSchema) bool

IsExternalField checks if a field is an external field (data stored externally).

func IsVirtualPKFromSegment

func IsVirtualPKFromSegment(virtualPK int64, segmentID int64) bool

IsVirtualPKFromSegment checks if a virtual PK belongs to the given segment. Note: Only the lower 32 bits of segmentID are preserved in the virtual PK, so we compare with the truncated segment ID.

func JoinIDPath

func JoinIDPath(ids ...int64) string

JoinIDPath joins ids to path format.

func NewCollectionManager

func NewCollectionManager() *collectionManager

func NewDiskUsageFetcher

func NewDiskUsageFetcher(ctx context.Context) *diskUsageFetcher

func NewFetchFieldsDataOperator

func NewFetchFieldsDataOperator(
	validSegments []Segment,
	manager *Manager,
	retrievePlan *segcore.RetrievePlan,
) queryutil.Operator

NewFetchFieldsDataOperator creates an operator that retrieves full field data from segments using offset-based retrieval. This is the second stage of the IgnoreNonPk pipeline: after PK merge + dedup + topK, fetch actual field data only for the selected rows.

Input[0]: *MergedResultWithOffsets Output[0]: *segcorepb.RetrieveResults (with IDs and full FieldsData)

func NewLoader

func NewLoader(
	ctx context.Context,
	manager *Manager,
	cm storage.ChunkManager,
) *segmentLoader

func NewMergeByPKWithOffsetsOperator

func NewMergeByPKWithOffsetsOperator(
	topK int64,
	reduceType reduce.IReduceType,
) queryutil.Operator

NewMergeByPKWithOffsetsOperator creates an operator that performs PK-ordered merge with timestamp-based deduplication and topK limit, tracking segment offsets for later field data retrieval.

For element-level queries, the operator also tracks ElementIndices per row and counts available results by element count (not doc count).

Input[0]: []*segcorepb.RetrieveResults (valid results with offsets and timestamps) Output[0]: *MergedResultWithOffsets (PKs + offset selections, PK-sorted)

func NewSegmentManager

func NewSegmentManager() *segmentManager

func ReduceAdvancedSearchResults

func ReduceAdvancedSearchResults(ctx context.Context, results []*internalpb.SearchResults) (*internalpb.SearchResults, error)

func ReduceSearchOnQueryNode

func ReduceSearchOnQueryNode(ctx context.Context, results []*internalpb.SearchResults, info *reduce.ResultInfo) (*internalpb.SearchResults, error)

func ReduceSearchResults

func ReduceSearchResults(ctx context.Context, results []*internalpb.SearchResults, info *reduce.ResultInfo) (*internalpb.SearchResults, error)

func ResizeBFApplyPool

func ResizeBFApplyPool(evt *config.Event)

func ResizeBM25LoadPool

func ResizeBM25LoadPool(evt *config.Event)

func ResizeLoadPool

func ResizeLoadPool(evt *config.Event)

func ResizeSQPool

func ResizeSQPool(evt *config.Event)

func ResizeWarmupPool

func ResizeWarmupPool(evt *config.Event)

func Retrieve

func Retrieve(ctx context.Context, manager *Manager, plan *RetrievePlan, req *querypb.QueryRequest) ([]RetrieveSegmentResult, []Segment, error)

retrieve will retrieve all the validate target segments

func RunDelegatorQueryPipeline

func RunDelegatorQueryPipeline(
	ctx context.Context,
	req *querypb.QueryRequest,
	schema *schemapb.CollectionSchema,
	results []*internalpb.RetrieveResults,
) (*internalpb.RetrieveResults, error)

RunDelegatorQueryPipeline is the single entry point for Delegator-level query reduction. Input is already []*internalpb.RetrieveResults from multiple QN workers.

func RunQNQueryPipeline

func RunQNQueryPipeline(
	ctx context.Context,
	req *querypb.QueryRequest,
	schema *schemapb.CollectionSchema,
	plan *planpb.PlanNode,
	segcoreResults []*segcorepb.RetrieveResults,
	segments []Segment,
	manager *Manager,
	retrievePlan *segcore.RetrievePlan,
) (*segcorepb.RetrieveResults, error)

RunQNQueryPipeline is the single entry point for all QN-level query reduction. It replaces the reducer factory pattern with direct pipeline execution.

Pipeline patterns at QN level:

IgnoreNonPk=true (plain query, multi-segment):
  [MergeByPKWithOffsets(topK)] → [FetchFieldsData] → output

Plain / ORDER BY / GROUP BY / GROUP BY+ORDER BY:
  Uses BuildQueryReducePipeline (see pipeline_builders.go)

func SearchHistorical

func SearchHistorical(ctx context.Context, manager *Manager, searchReq *SearchRequest, collID int64, partIDs []int64, segIDs []int64) ([]*SearchResult, []Segment, error)

search will search on the historical segments the target segments in historical. if segIDs is not specified, it will search on all the historical segments speficied by partIDs. if segIDs is specified, it will only search on the segments specified by the segIDs. if partIDs is empty, it means all the partitions of the loaded collection or all the partitions loaded.

func SearchStreaming

func SearchStreaming(ctx context.Context, manager *Manager, searchReq *SearchRequest, collID int64, partIDs []int64, segIDs []int64) ([]*SearchResult, []Segment, error)

searchStreaming will search all the target segments in streaming if partIDs is empty, it means all the partitions of the loaded collection or all the partitions loaded.

func SelectSearchResultData

func SelectSearchResultData(dataArray []*schemapb.SearchResultData, resultOffsets [][]int64, offsets []int64, qi int64) int

func StatisticStreaming

func StatisticStreaming(ctx context.Context, manager *Manager, collID int64, partIDs []int64, segIDs []int64) ([]SegmentStats, []Segment, error)

StatisticStreaming will do statistics all the target segments in streaming if partIDs is empty, it means all the partitions of the loaded collection or all the partitions loaded.

func StatisticsHistorical

func StatisticsHistorical(ctx context.Context, manager *Manager, collID int64, partIDs []int64, segIDs []int64) ([]SegmentStats, []Segment, error)

statistic will do statistics on the historical segments the target segments in historical. if segIDs is not specified, it will search on all the historical segments specified by partIDs. if segIDs is specified, it will only search on the segments specified by the segIDs. if partIDs is empty, it means all the partitions of the loaded collection or all the partitions loaded.

func SupportInterimIndexDataType

func SupportInterimIndexDataType(dataType schemapb.DataType) bool

func WithReleaseScope

func WithReleaseScope(scope ReleaseScope) releaseOption

Types

type BatchInfo

type BatchInfo struct {
	EndOffset int64

	Position *msgpb.MsgPosition

	// minTimestamp is the minimum timestamp in this batch (used for StaleBufferPolicy)
	MinTimestamp typeutil.Timestamp
}

BatchInfo records the mapping between row offset and WAL position for a batch of inserted data. this is used to determine the correct checkpoint position when flushing a range of rows.

type BinlogSaver

type BinlogSaver interface {
	SaveBinlogPaths(ctx context.Context, req *datapb.SaveBinlogPathsRequest) error
}

BinlogSaver is a minimal interface for saving binlog paths to DataCoord. This avoids depending on the full broker.Broker interface.

type CTraceContext

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

CTraceContext is the wrapper for `C.CTraceContext` it stores the internal C.CTraceContext and

func ParseCTraceContext

func ParseCTraceContext(ctx context.Context) *CTraceContext

ParseCTraceContext parses tracing span and convert it into `C.CTraceContext`.

type CheckpointTracker

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

CheckpointTracker tracks the mapping between segment row offsets and WAL positions. it is used by GrowingFlushManager to determine the correct checkpoint when flushing a range of rows from a Growing Segment.

design:

  • each Insert operation records a BatchInfo with (endOffset, position)
  • when flushing rows [0, syncedOffset], we find the last batch where EndOffset <= syncedOffset
  • the Position of that batch becomes the checkpoint (meaning that WAL message is fully persisted)
  • after flush completes, we clean up BatchInfo records that are no longer needed

func NewCheckpointTracker

func NewCheckpointTracker() *CheckpointTracker

NewCheckpointTracker creates a new CheckpointTracker instance.

func (*CheckpointTracker) GetAcknowledgedManifest

func (t *CheckpointTracker) GetAcknowledgedManifest(segID int64) string

GetAcknowledgedManifest returns the last manifest path acknowledged by DataCoord. Returns "" if no manifest has been acknowledged yet.

func (*CheckpointTracker) GetAcknowledgedVersion

func (t *CheckpointTracker) GetAcknowledgedVersion(segID int64) int64

GetAcknowledgedVersion returns the last manifest version acknowledged by DataCoord. Returns -1 if no version has been acknowledged (first flush for this segment).

func (*CheckpointTracker) GetCheckpoint

func (t *CheckpointTracker) GetCheckpoint(segID int64, syncedOffset int64) *msgpb.MsgPosition

GetCheckpoint returns the appropriate checkpoint position for a given synced offset. it finds the last batch where EndOffset <= syncedOffset, meaning all rows in that WAL message have been persisted.

returns nil if no suitable checkpoint is found.

example:

Batches: [{EndOffset:50, Pos:A}, {EndOffset:120, Pos:B}, {EndOffset:200, Pos:C}]
GetCheckpoint(150) -> returns Pos:B (because 120 <= 150, but 200 > 150)
GetCheckpoint(200) -> returns Pos:C (because 200 <= 200)
GetCheckpoint(40)  -> returns nil (no batch has EndOffset <= 40... wait, 50 > 40)

func (*CheckpointTracker) GetFlushedOffset

func (t *CheckpointTracker) GetFlushedOffset(segID int64) int64

GetFlushedOffset returns the last flushed row offset for a segment. returns 0 if the segment has never been flushed.

func (*CheckpointTracker) GetMaxEndOffset

func (t *CheckpointTracker) GetMaxEndOffset(segID int64) int64

GetMaxEndOffset returns the maximum EndOffset recorded for a segment. This represents the latest row offset that has a corresponding WAL position. Returns flushedOffset if no batches exist (all previous batches were cleaned up).

func (*CheckpointTracker) GetMinTimestamp

func (t *CheckpointTracker) GetMinTimestamp(segID int64) typeutil.Timestamp

GetMinTimestamp returns the minimum timestamp of unflushed data for a segment. this is used by StaleBufferPolicy to determine if a segment has stale data.

returns 0 if no unflushed data exists.

func (*CheckpointTracker) GetSegmentIDs

func (t *CheckpointTracker) GetSegmentIDs() []int64

GetSegmentIDs returns all segment IDs being tracked.

func (*CheckpointTracker) GetUnflushedRowCount

func (t *CheckpointTracker) GetUnflushedRowCount(segID int64, currentRowCount int64) int64

GetUnflushedRowCount returns the number of unflushed rows for a segment. Parameters:

  • segID: the segment ID
  • currentRowCount: the current total row count of the segment

Returns the number of rows that haven't been flushed yet.

func (*CheckpointTracker) HasUnflushedData

func (t *CheckpointTracker) HasUnflushedData(segID int64, currentRowCount int64) bool

HasUnflushedData returns true if the segment has unflushed data.

func (*CheckpointTracker) InitSegment

func (t *CheckpointTracker) InitSegment(segID int64, flushedOffset int64)

InitSegment initializes tracking for a recovered segment. this is used during recovery when loading a segment from binlog.

parameters:

  • segID: the segment ID
  • flushedOffset: the row count that has been persisted to binlog

func (*CheckpointTracker) InitSegmentWithManifest

func (t *CheckpointTracker) InitSegmentWithManifest(segID int64, flushedOffset int64, manifest string)

InitSegmentWithManifest initializes tracking for a recovered segment with the last acknowledged manifest. The manifest version is extracted from manifestPath automatically.

func (*CheckpointTracker) RecordBatch

func (t *CheckpointTracker) RecordBatch(segID int64, endOffset int64, position *msgpb.MsgPosition)

RecordBatch records the batch information after a successful Insert operation.

func (*CheckpointTracker) RemoveSegment

func (t *CheckpointTracker) RemoveSegment(segID int64)

RemoveSegment removes all tracking data for a segment. this should be called when a segment is sealed or dropped.

func (*CheckpointTracker) UpdateAcknowledgedManifest

func (t *CheckpointTracker) UpdateAcknowledgedManifest(segID int64, manifest string)

UpdateAcknowledgedManifest updates the acknowledged manifest after SaveBinlogPaths succeeds.

func (*CheckpointTracker) UpdateFlushedOffset

func (t *CheckpointTracker) UpdateFlushedOffset(segID int64, offset int64)

UpdateFlushedOffset updates the flushed offset after a successful sync operation. it also cleans up BatchInfo records that are no longer needed (EndOffset <= offset).

this should be called after the sync operation completes successfully.

type Collection

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

Collection is a wrapper of the underlying C-structure C.CCollection In a query node, `Collection` is a replica info of a collection in these query node.

func NewCollection

func NewCollection(collectionID int64, schema *schemapb.CollectionSchema, indexMeta *segcorepb.CollectionIndexMeta, loadMetaInfo *querypb.LoadMetaInfo) (*Collection, error)

newCollection returns a new Collection

func NewCollectionWithoutSegcoreForTest

func NewCollectionWithoutSegcoreForTest(collectionID int64, schema *schemapb.CollectionSchema) *Collection

new collection without segcore prepare ONLY FOR TEST

func NewTestCollection

func NewTestCollection(collectionID int64, loadType querypb.LoadType, schema *schemapb.CollectionSchema) *Collection

Only for test

func (*Collection) AddPartition

func (c *Collection) AddPartition(partitions ...int64)

addPartitionID would add a partition id to partition id list of collection

func (*Collection) ExistPartition

func (c *Collection) ExistPartition(partitionIDs ...int64) bool

func (*Collection) GetCCollection

func (c *Collection) GetCCollection() *segcore.CCollection

GetCCollection returns the CCollection of collection

func (*Collection) GetDBName

func (c *Collection) GetDBName() string

GetDBName returns the database name of collection.

func (*Collection) GetDBProperties

func (c *Collection) GetDBProperties() []*commonpb.KeyValuePair

func (*Collection) GetLoadType

func (c *Collection) GetLoadType() querypb.LoadType

getLoadType get the loadType of collection, which is loadTypeCollection or loadTypePartition

func (*Collection) GetPartitions

func (c *Collection) GetPartitions() []int64

getPartitionIDs return partitionIDs of collection

func (*Collection) GetResourceGroup

func (c *Collection) GetResourceGroup() string

GetResourceGroup returns the resource group of collection.

func (*Collection) ID

func (c *Collection) ID() int64

ID returns collection id

func (*Collection) IsGpuIndex

func (c *Collection) IsGpuIndex() bool

IsGpuIndex returns a boolean value indicating whether the collection is using a GPU index.

func (*Collection) Ref

func (c *Collection) Ref(count uint32) uint32

func (*Collection) RemovePartition

func (c *Collection) RemovePartition(partitionID int64)

removePartitionID removes the partition id from partition id list of collection

func (*Collection) Schema

func (c *Collection) Schema() *schemapb.CollectionSchema

Schema returns the schema of collection

func (*Collection) Unref

func (c *Collection) Unref(count uint32) uint32

type CollectionManager

type CollectionManager interface {
	List() []int64
	ListWithName() map[int64]string
	Get(collectionID int64) *Collection
	PutOrRef(collectionID int64, schema *schemapb.CollectionSchema, meta *segcorepb.CollectionIndexMeta, loadMeta *querypb.LoadMetaInfo) error
	Ref(collectionID int64, count uint32) bool
	// unref the collection,
	// returns true if the collection ref count goes 0, or the collection not exists,
	// return false otherwise
	Unref(collectionID int64, count uint32) bool
	// UpdateSchema update the underlying collection schema of the provided collection.
	UpdateSchema(collectionID int64, schema *schemapb.CollectionSchema, version uint64) error
}

type FieldInfo

type FieldInfo struct {
	*datapb.FieldBinlog
	RowCount int64
}

type FlushConfig

type FlushConfig struct {
	// Segment base path for binlog storage
	SegmentBasePath string
	// Partition base path for LOB storage (TEXT fields)
	PartitionBasePath string
	// Collection ID
	CollectionID int64
	// Partition ID
	PartitionID int64
	// TEXT column field IDs
	TextFieldIDs []int64
	// LOB base paths for each TEXT field (same order as TextFieldIDs)
	// Format: {partition_path}/lobs/{field_id}
	TextLobPaths []string
	// ReadVersion is the manifest version to read from.
	// Must be set to the last version acknowledged by DataCoord (via SaveBinlogPaths).
	ReadVersion int64
}

FlushConfig contains configuration for flushing segment data. All paths and settings are passed to C++ side via FFI.

type FlushResult

type FlushResult struct {
	// Manifest path (Storage V3 - contains all file information).
	// The committed version is encoded in the path and can be extracted
	// via packed.UnmarshalManifestPath when needed.
	ManifestPath string
	// Number of rows flushed
	NumRows int64
}

FlushResult contains the result of flushing segment data. All data is returned from C++ side via FFI. In Storage V3 FFI mode, only manifest path is needed (all file info is in manifest).

type GrowingFlushManager

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

GrowingFlushManager manages the incremental flush of Growing Segments for TEXT collections. it periodically checks sync policies and triggers flush operations when conditions are met.

key responsibilities:

  • track Growing Segments and their unflushed data via CheckpointTracker
  • apply sync policies to determine which segments to flush
  • extract data from Growing Segments and write to binlog storage
  • update metadata via DataCoord's SaveBinlogPaths API
  • update channel checkpoints

func NewGrowingFlushManager

func NewGrowingFlushManager(
	collectionID int64,
	channelName string,
	schema *schemapb.CollectionSchema,
	collectionManager CollectionManager,
	segmentManager SegmentManager,
	binlogSaver BinlogSaver,
	chunkManager storage.ChunkManager,
	checkpointTracker *CheckpointTracker,
	opts ...GrowingFlushManagerOption,
) *GrowingFlushManager

NewGrowingFlushManager creates a new GrowingFlushManager instance.

func (*GrowingFlushManager) ForceSync

func (m *GrowingFlushManager) ForceSync(ctx context.Context, segID int64) error

ForceSync forces an immediate sync of all unflushed data for a segment. this is typically called when a segment is being sealed or dropped.

func (*GrowingFlushManager) ForceSyncAndSeal

func (m *GrowingFlushManager) ForceSyncAndSeal(ctx context.Context, segID int64) error

ForceSyncAndSeal forces an immediate sync and marks the segment as flushed/sealed. This is called when the segment is being sealed (user flush command). After this call, DataCoord will mark the segment as Flushed and trigger handoff.

This method is idempotent: once a segment has been successfully sealed, subsequent calls are no-ops. This prevents duplicate SaveBinlogPaths(isFlush=true) requests when flush() is called multiple times, which would otherwise resurrect compacted segments via the Dropped→Flushed state transition race and cause duplicate data.

func (*GrowingFlushManager) GetCheckpointTracker

func (m *GrowingFlushManager) GetCheckpointTracker() *CheckpointTracker

GetCheckpointTracker returns the checkpoint tracker for external access.

func (*GrowingFlushManager) RemoveSealedSegment

func (m *GrowingFlushManager) RemoveSealedSegment(segID int64)

RemoveSealedSegment clears the sealed state for a segment. This should be called when the segment is released from QueryNode.

func (*GrowingFlushManager) Start

func (m *GrowingFlushManager) Start(ctx context.Context)

Start begins the background flush checking loop.

func (*GrowingFlushManager) Stop

func (m *GrowingFlushManager) Stop()

Stop signals the manager to stop and waits for completion. Safe to call multiple times.

type GrowingFlushManagerOption

type GrowingFlushManagerOption func(*GrowingFlushManager)

GrowingFlushManagerOption is a function to configure GrowingFlushManager.

func WithFlushInterval

func WithFlushInterval(interval time.Duration) GrowingFlushManagerOption

WithFlushInterval sets the flush check interval.

func WithSyncPolicies

func WithSyncPolicies(policies ...GrowingSyncPolicy) GrowingFlushManagerOption

WithSyncPolicies sets custom sync policies.

type GrowingSegmentBuffer

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

GrowingSegmentBuffer wraps a Growing Segment to provide the interface needed for sync policy selection. this is an adapter that allows reusing the sync policy algorithms from flushcommon/writebuffer with Growing Segments.

note: we can't directly use writebuffer.SyncPolicy because it expects *writebuffer.segmentBuffer which is a private type. instead, we define our own GrowingSyncPolicy interface with the same algorithm logic.

func NewGrowingSegmentBuffer

func NewGrowingSegmentBuffer(segment Segment, tracker *CheckpointTracker) *GrowingSegmentBuffer

NewGrowingSegmentBuffer creates a new GrowingSegmentBuffer wrapping the given segment.

func (*GrowingSegmentBuffer) FlushedOffset

func (b *GrowingSegmentBuffer) FlushedOffset() int64

FlushedOffset returns the last flushed row offset.

func (*GrowingSegmentBuffer) HasUnflushedData

func (b *GrowingSegmentBuffer) HasUnflushedData() bool

HasUnflushedData returns true if there are unflushed rows.

func (*GrowingSegmentBuffer) IsFull

func (b *GrowingSegmentBuffer) IsFull() bool

IsFull returns true if the segment's memory usage exceeds the threshold. the threshold is configured via paramtable.

func (*GrowingSegmentBuffer) MemorySize

func (b *GrowingSegmentBuffer) MemorySize() int64

MemorySize returns the current memory usage of the segment.

func (*GrowingSegmentBuffer) MinTimestamp

func (b *GrowingSegmentBuffer) MinTimestamp() typeutil.Timestamp

MinTimestamp returns the minimum timestamp of unflushed data.

func (*GrowingSegmentBuffer) RowCount

func (b *GrowingSegmentBuffer) RowCount() int64

RowCount returns the current row count of the segment.

func (*GrowingSegmentBuffer) Segment

func (b *GrowingSegmentBuffer) Segment() Segment

Segment returns the underlying segment.

func (*GrowingSegmentBuffer) SegmentID

func (b *GrowingSegmentBuffer) SegmentID() int64

SegmentID returns the segment ID.

func (*GrowingSegmentBuffer) UnflushedRowCount

func (b *GrowingSegmentBuffer) UnflushedRowCount() int64

UnflushedRowCount returns the number of rows that haven't been flushed yet.

type GrowingSyncPolicy

type GrowingSyncPolicy interface {
	// SelectSegments returns the IDs of segments that should be synced.
	SelectSegments(buffers []*GrowingSegmentBuffer, ts typeutil.Timestamp) []int64
	// Reason returns a human-readable reason for this policy.
	Reason() string
}

GrowingSyncPolicy defines the interface for selecting which Growing Segments should be synced. this mirrors writebuffer.SyncPolicy but works with GrowingSegmentBuffer instead of the private segmentBuffer type.

func GetGrowingFullBufferPolicy

func GetGrowingFullBufferPolicy() GrowingSyncPolicy

GetGrowingFullBufferPolicy returns a policy that selects segments whose buffer is full. this mirrors writebuffer.GetFullBufferPolicy.

func GetGrowingMemoryPressurePolicy

func GetGrowingMemoryPressurePolicy(memoryThreshold int64) GrowingSyncPolicy

GetGrowingMemoryPressurePolicy returns a policy that syncs when total memory exceeds threshold.

func GetGrowingOldestBufferPolicy

func GetGrowingOldestBufferPolicy(num int) GrowingSyncPolicy

GetGrowingOldestBufferPolicy returns a policy that selects the N oldest buffers. this mirrors writebuffer.GetOldestBufferPolicy.

func GetGrowingRowCountPolicy

func GetGrowingRowCountPolicy(rowThreshold int64) GrowingSyncPolicy

GetGrowingRowCountPolicy returns a policy that syncs segments with more than N unflushed rows.

func GetGrowingStaleBufferPolicy

func GetGrowingStaleBufferPolicy(staleDuration time.Duration) GrowingSyncPolicy

GetGrowingStaleBufferPolicy returns a policy that selects segments with stale data. this mirrors writebuffer.GetSyncStaleBufferPolicy.

type GrowingSyncPolicyFunc

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

GrowingSyncPolicyFunc is a function type that implements GrowingSyncPolicy.

func (GrowingSyncPolicyFunc) Reason

func (f GrowingSyncPolicyFunc) Reason() string

Reason implements GrowingSyncPolicy.

func (GrowingSyncPolicyFunc) SelectSegments

func (f GrowingSyncPolicyFunc) SelectSegments(buffers []*GrowingSegmentBuffer, ts typeutil.Timestamp) []int64

SelectSegments implements GrowingSyncPolicy.

type IndexAttrCache

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

IndexAttrCache index meta cache stores calculated attribute.

func NewIndexAttrCache

func NewIndexAttrCache() *IndexAttrCache

func (*IndexAttrCache) GetIndexResourceUsage

func (c *IndexAttrCache) GetIndexResourceUsage(indexInfo *querypb.FieldIndexInfo, memoryIndexLoadPredictMemoryUsageFactor float64, fieldBinlog *datapb.FieldBinlog) (memory uint64, disk uint64, err error)

type IndexedFieldInfo

type IndexedFieldInfo struct {
	FieldBinlog *datapb.FieldBinlog
	IndexInfo   *querypb.FieldIndexInfo
	IsLoaded    bool
}

IndexedFieldInfo contains binlog info of vector field

type L0Segment

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

func (*L0Segment) BatchPkExist

func (s *L0Segment) BatchPkExist(lc *storage.BatchLocationsCache) []bool

func (*L0Segment) CASVersion

func (s *L0Segment) CASVersion(old, newVersion int64) bool

func (*L0Segment) Charge

func (s *L0Segment) Charge()

Charge implements pkoracle.Candidate — charges memory resources.

func (*L0Segment) Collection

func (s *L0Segment) Collection() int64

func (*L0Segment) DatabaseName

func (s *L0Segment) DatabaseName() string

func (*L0Segment) Delete

func (s *L0Segment) Delete(ctx context.Context, primaryKeys storage.PrimaryKeys, timestamps []typeutil.Timestamp) error

func (*L0Segment) DeleteRecords

func (s *L0Segment) DeleteRecords() ([]storage.PrimaryKey, []uint64)

func (*L0Segment) DropIndex

func (s *L0Segment) DropIndex(ctx context.Context, indexID int64) error

func (*L0Segment) ExistIndex

func (s *L0Segment) ExistIndex(fieldID int64) bool

func (*L0Segment) FlushData

func (s *L0Segment) FlushData(ctx context.Context, startOffset, endOffset int64, config *FlushConfig) (*FlushResult, error)

FlushData is not supported for L0 segments. L0 segments contain only delete data, not insert data.

func (*L0Segment) GetBM25Stats

func (s *L0Segment) GetBM25Stats() map[int64]*storage.BM25Stats

func (*L0Segment) GetCollection

func (s *L0Segment) GetCollection() *Collection

func (*L0Segment) GetFieldJSONIndexStats

func (s *L0Segment) GetFieldJSONIndexStats() map[int64]*querypb.JsonStatsInfo

func (*L0Segment) GetIndex

func (s *L0Segment) GetIndex(fieldID int64) []*IndexedFieldInfo

func (*L0Segment) GetIndexByID

func (s *L0Segment) GetIndexByID(indexID int64) *IndexedFieldInfo

func (*L0Segment) GetMaxPk

func (s *L0Segment) GetMaxPk() *storage.PrimaryKey

func (*L0Segment) GetMinPk

func (s *L0Segment) GetMinPk() *storage.PrimaryKey

func (*L0Segment) HasRawData

func (s *L0Segment) HasRawData(fieldID int64) bool

func (*L0Segment) ID

func (s *L0Segment) ID() int64

ID returns the identity number.

func (*L0Segment) Indexes

func (s *L0Segment) Indexes() []*IndexedFieldInfo

func (*L0Segment) Insert

func (s *L0Segment) Insert(ctx context.Context, rowIDs []int64, timestamps []typeutil.Timestamp, record *segcorepb.InsertRecord) error

func (*L0Segment) InsertCount

func (s *L0Segment) InsertCount() int64

func (*L0Segment) IsLazyLoad

func (s *L0Segment) IsLazyLoad() bool

func (*L0Segment) IsSorted

func (s *L0Segment) IsSorted() bool

func (*L0Segment) LastDeltaTimestamp

func (s *L0Segment) LastDeltaTimestamp() uint64

func (*L0Segment) Level

func (s *L0Segment) Level() datapb.SegmentLevel

func (*L0Segment) Load

func (s *L0Segment) Load(ctx context.Context) error

func (*L0Segment) LoadDeltaData

func (s *L0Segment) LoadDeltaData(ctx context.Context, deltaData *storage.DeltaData) error

func (*L0Segment) LoadInfo

func (s *L0Segment) LoadInfo() *querypb.SegmentLoadInfo

func (*L0Segment) MayPkExist

func (s *L0Segment) MayPkExist(pk *storage.LocationsCache) bool

MayPkExist returns true if the given PK exists in the PK range and being positive through the bloom filter, false otherwise, may returns true even the PK doesn't exist actually

func (*L0Segment) MemSize

func (s *L0Segment) MemSize() int64

func (*L0Segment) NeedUpdatedVersion

func (s *L0Segment) NeedUpdatedVersion() int64

func (*L0Segment) Partition

func (s *L0Segment) Partition() int64

func (*L0Segment) PinIfNotReleased

func (s *L0Segment) PinIfNotReleased() error

func (*L0Segment) PkCandidateExist

func (s *L0Segment) PkCandidateExist() bool

PkCandidateExist implements pkoracle.Candidate — reports whether PK data has been loaded.

func (*L0Segment) Refund

func (s *L0Segment) Refund()

Refund implements pkoracle.Candidate — releases memory resources.

func (*L0Segment) Release

func (s *L0Segment) Release(ctx context.Context, opts ...releaseOption)

func (*L0Segment) RemoveUnusedFieldFiles

func (s *L0Segment) RemoveUnusedFieldFiles() error

func (*L0Segment) Reopen

func (s *L0Segment) Reopen(ctx context.Context, newLoadInfo *querypb.SegmentLoadInfo) error

func (*L0Segment) ResetIndexesLazyLoad

func (s *L0Segment) ResetIndexesLazyLoad(lazyState bool)

func (*L0Segment) ResourceGroup

func (s *L0Segment) ResourceGroup() string

func (*L0Segment) ResourceUsageEstimate

func (s *L0Segment) ResourceUsageEstimate() ResourceUsage

ResourceUsageEstimate returns the final estimated resource usage of the segment.

func (*L0Segment) Retrieve

func (*L0Segment) RetrieveByOffsets

func (*L0Segment) RowNum

func (s *L0Segment) RowNum() int64

func (*L0Segment) Search

func (s *L0Segment) Search(ctx context.Context, searchReq *segcore.SearchRequest) (*segcore.SearchResult, error)

func (*L0Segment) SetLoadInfo

func (s *L0Segment) SetLoadInfo(loadInfo *querypb.SegmentLoadInfo)

func (*L0Segment) SetNeedUpdatedVersion

func (s *L0Segment) SetNeedUpdatedVersion(version int64)

func (*L0Segment) SetPKCandidate

func (s *L0Segment) SetPKCandidate(candidate pkoracle.Candidate)

func (*L0Segment) Shard

func (s *L0Segment) Shard() metautil.Channel

func (*L0Segment) StartPosition

func (s *L0Segment) StartPosition() *msgpb.MsgPosition

func (*L0Segment) Stats

func (s *L0Segment) Stats() *storage.PkStatistics

Stats implements pkoracle.Candidate — returns PK statistics (min/max PK).

func (*L0Segment) Type

func (s *L0Segment) Type() SegmentType

func (*L0Segment) Unpin

func (s *L0Segment) Unpin()

func (*L0Segment) UpdateBM25Stats

func (s *L0Segment) UpdateBM25Stats(stats map[int64]*storage.BM25Stats)

func (*L0Segment) UpdatePkCandidate

func (s *L0Segment) UpdatePkCandidate(pks []storage.PrimaryKey)

UpdatePkCandidate feeds new primary keys into the PK candidate.

func (*L0Segment) Version

func (s *L0Segment) Version() int64

type LoadIndexInfo

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

LoadIndexInfo is a wrapper of the underlying C-structure C.CLoadIndexInfo

type LoadResource

type LoadResource struct {
	MemorySize uint64
	DiskSize   uint64
}

func (*LoadResource) Add

func (r *LoadResource) Add(resource LoadResource)

func (*LoadResource) IsZero

func (r *LoadResource) IsZero() bool

func (*LoadResource) Sub

func (r *LoadResource) Sub(resource LoadResource)

type Loader

type Loader interface {
	// Load loads binlogs, and spawn segments,
	// NOTE: make sure the ref count of the corresponding collection will never go down to 0 during this
	Load(ctx context.Context, collectionID int64, segmentType SegmentType, version int64, segments ...*querypb.SegmentLoadInfo) ([]Segment, error)

	// LoadDeltaLogs load deltalog and write delta data into provided segment.
	// it also executes resource protection logic in case of OOM.
	LoadDeltaLogs(ctx context.Context, segment Segment, loadInfo *querypb.SegmentLoadInfo) error

	// LoadBloomFilterSet loads needed statslog for RemoteSegment.
	LoadBloomFilterSet(ctx context.Context, collectionID int64, infos ...*querypb.SegmentLoadInfo) ([]*pkoracle.BloomFilterSet, error)

	// GetChunkManager returns the chunk manager for remote storage access.
	GetChunkManager() storage.ChunkManager

	// LoadIndex append index for segment and remove vector binlogs.
	LoadIndex(ctx context.Context,
		segment Segment,
		info *querypb.SegmentLoadInfo,
		version int64) error

	LoadJSONIndex(ctx context.Context,
		segment Segment,
		info *querypb.SegmentLoadInfo) error

	// ReopenSegments update segment data according to new load info.
	ReopenSegments(ctx context.Context,
		loadInfos []*querypb.SegmentLoadInfo,
	) error
}

type LocalSegment

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

Segment is a wrapper of the underlying C-structure segment.

func (*LocalSegment) BatchPkExist

func (s *LocalSegment) BatchPkExist(lc *storage.BatchLocationsCache) []bool

func (*LocalSegment) CASVersion

func (s *LocalSegment) CASVersion(old, newVersion int64) bool

func (*LocalSegment) Charge

func (s *LocalSegment) Charge()

Charge implements pkoracle.Candidate — charges memory resources.

func (*LocalSegment) Collection

func (s *LocalSegment) Collection() int64

func (*LocalSegment) DatabaseName

func (s *LocalSegment) DatabaseName() string

func (*LocalSegment) Delete

func (s *LocalSegment) Delete(ctx context.Context, primaryKeys storage.PrimaryKeys, timestamps []typeutil.Timestamp) error

func (*LocalSegment) DropIndex

func (s *LocalSegment) DropIndex(ctx context.Context, indexID int64) error

func (*LocalSegment) ExistIndex

func (s *LocalSegment) ExistIndex(fieldID int64) bool

func (*LocalSegment) FlushData

func (s *LocalSegment) FlushData(ctx context.Context, startOffset, endOffset int64, config *FlushConfig) (*FlushResult, error)

FlushData flushes data from the growing segment directly to storage via C++ milvus-storage. This is a unified interface that combines data extraction from segcore and writing to storage. The C++ side handles: extracting raw field data from ConcurrentVector, converting to Arrow, and writing to storage via milvus-storage with TEXT column LOB handling.

func (*LocalSegment) GetBM25Stats

func (s *LocalSegment) GetBM25Stats() map[int64]*storage.BM25Stats

func (*LocalSegment) GetCollection

func (s *LocalSegment) GetCollection() *Collection

func (*LocalSegment) GetFieldJSONIndexStats

func (s *LocalSegment) GetFieldJSONIndexStats() map[int64]*querypb.JsonStatsInfo

func (*LocalSegment) GetIndex

func (s *LocalSegment) GetIndex(fieldID int64) []*IndexedFieldInfo

func (*LocalSegment) GetIndexByID

func (s *LocalSegment) GetIndexByID(indexID int64) *IndexedFieldInfo

func (*LocalSegment) GetMaxPk

func (s *LocalSegment) GetMaxPk() *storage.PrimaryKey

func (*LocalSegment) GetMinPk

func (s *LocalSegment) GetMinPk() *storage.PrimaryKey

func (*LocalSegment) HasFieldData

func (s *LocalSegment) HasFieldData(fieldID int64) bool

func (*LocalSegment) HasRawData

func (s *LocalSegment) HasRawData(fieldID int64) bool

func (*LocalSegment) ID

func (s *LocalSegment) ID() int64

ID returns the identity number.

func (*LocalSegment) Indexes

func (s *LocalSegment) Indexes() []*IndexedFieldInfo

func (*LocalSegment) Insert

func (s *LocalSegment) Insert(ctx context.Context, rowIDs []int64, timestamps []typeutil.Timestamp, record *segcorepb.InsertRecord) error

func (*LocalSegment) InsertCount

func (s *LocalSegment) InsertCount() int64

func (*LocalSegment) IsLazyLoad

func (s *LocalSegment) IsLazyLoad() bool

func (*LocalSegment) IsSorted

func (s *LocalSegment) IsSorted() bool

func (*LocalSegment) LastDeltaTimestamp

func (s *LocalSegment) LastDeltaTimestamp() uint64

func (*LocalSegment) Level

func (s *LocalSegment) Level() datapb.SegmentLevel

func (*LocalSegment) Load

func (s *LocalSegment) Load(ctx context.Context) error

func (*LocalSegment) LoadDeltaData

func (s *LocalSegment) LoadDeltaData(ctx context.Context, deltaData *storage.DeltaData) error

func (*LocalSegment) LoadFieldData

func (s *LocalSegment) LoadFieldData(ctx context.Context, fieldID int64, rowCount int64, field *datapb.FieldBinlog) error

-------------------------------------------------------------------------------------- interfaces for sealed segment

func (*LocalSegment) LoadIndex

func (s *LocalSegment) LoadIndex(ctx context.Context, indexInfo *querypb.FieldIndexInfo, fieldType schemapb.DataType) error

func (*LocalSegment) LoadInfo

func (s *LocalSegment) LoadInfo() *querypb.SegmentLoadInfo

func (*LocalSegment) LoadJSONKeyIndex

func (s *LocalSegment) LoadJSONKeyIndex(ctx context.Context, jsonKeyStats *datapb.JsonKeyStats, schemaHelper *typeutil.SchemaHelper, basePath string) error

func (*LocalSegment) MayPkExist

func (s *LocalSegment) MayPkExist(pk *storage.LocationsCache) bool

MayPkExist returns true if the given PK exists in the PK range and being positive through the bloom filter, false otherwise, may returns true even the PK doesn't exist actually

func (*LocalSegment) MemSize

func (s *LocalSegment) MemSize() int64

func (*LocalSegment) NeedUpdatedVersion

func (s *LocalSegment) NeedUpdatedVersion() int64

func (*LocalSegment) Partition

func (s *LocalSegment) Partition() int64

func (*LocalSegment) PinIfNotReleased

func (s *LocalSegment) PinIfNotReleased() error

PinIfNotReleased acquires the `ptrLock` and returns true if the pointer is valid Provide ONLY the read lock operations, don't make `ptrLock` public to avoid abusing of the mutex.

func (*LocalSegment) PkCandidateExist

func (s *LocalSegment) PkCandidateExist() bool

PkCandidateExist implements pkoracle.Candidate — reports whether PK data has been loaded.

func (*LocalSegment) Refund

func (s *LocalSegment) Refund()

Refund implements pkoracle.Candidate — releases memory resources.

func (*LocalSegment) Release

func (s *LocalSegment) Release(ctx context.Context, opts ...releaseOption)

func (*LocalSegment) ReleaseSegmentData

func (s *LocalSegment) ReleaseSegmentData()

ReleaseSegmentData releases the segment data.

func (*LocalSegment) RemoveFieldFile

func (s *LocalSegment) RemoveFieldFile(fieldId int64)

func (*LocalSegment) RemoveUnusedFieldFiles

func (s *LocalSegment) RemoveUnusedFieldFiles() error

func (*LocalSegment) Reopen

func (s *LocalSegment) Reopen(ctx context.Context, newLoadInfo *querypb.SegmentLoadInfo) error

func (*LocalSegment) ResetIndexesLazyLoad

func (s *LocalSegment) ResetIndexesLazyLoad(lazyState bool)

func (*LocalSegment) ResourceGroup

func (s *LocalSegment) ResourceGroup() string

func (*LocalSegment) ResourceUsageEstimate

func (s *LocalSegment) ResourceUsageEstimate() ResourceUsage

ResourceUsageEstimate returns the final estimated resource usage of the segment.

func (*LocalSegment) Retrieve

func (*LocalSegment) RetrieveByOffsets

func (*LocalSegment) RowNum

func (s *LocalSegment) RowNum() int64

func (*LocalSegment) Search

func (s *LocalSegment) Search(ctx context.Context, searchReq *segcore.SearchRequest) (*segcore.SearchResult, error)

Search executes a search on the segment. If searchReq.FilterOnly() is true, only executes the filter and returns valid_count (Stage 1 of two-stage search).

func (*LocalSegment) SetLoadInfo

func (s *LocalSegment) SetLoadInfo(loadInfo *querypb.SegmentLoadInfo)

func (*LocalSegment) SetNeedUpdatedVersion

func (s *LocalSegment) SetNeedUpdatedVersion(version int64)

func (*LocalSegment) SetPKCandidate

func (s *LocalSegment) SetPKCandidate(candidate pkoracle.Candidate)

func (*LocalSegment) Shard

func (s *LocalSegment) Shard() metautil.Channel

func (*LocalSegment) StartLoadData

func (s *LocalSegment) StartLoadData() (state.LoadStateLockGuard, error)

StartLoadData starts the loading process of the segment.

func (*LocalSegment) StartPosition

func (s *LocalSegment) StartPosition() *msgpb.MsgPosition

func (*LocalSegment) Stats

func (s *LocalSegment) Stats() *storage.PkStatistics

Stats implements pkoracle.Candidate — returns PK statistics (min/max PK).

func (*LocalSegment) Type

func (s *LocalSegment) Type() SegmentType

func (*LocalSegment) Unpin

func (s *LocalSegment) Unpin()

func (*LocalSegment) UpdateBM25Stats

func (s *LocalSegment) UpdateBM25Stats(stats map[int64]*storage.BM25Stats)

func (*LocalSegment) UpdateFieldRawDataSize

func (s *LocalSegment) UpdateFieldRawDataSize(ctx context.Context, numRows int64, fieldBinlog *datapb.FieldBinlog) error

func (*LocalSegment) UpdateIndexInfo

func (s *LocalSegment) UpdateIndexInfo(ctx context.Context, indexInfo *querypb.FieldIndexInfo, info *LoadIndexInfo) error

func (*LocalSegment) UpdatePkCandidate

func (s *LocalSegment) UpdatePkCandidate(pks []storage.PrimaryKey)

UpdatePkCandidate updates the PK candidate with provided pks and charges resource. Overrides baseSegment.UpdatePkCandidate to handle resource charging for growing segments.

func (*LocalSegment) Version

func (s *LocalSegment) Version() int64

type Manager

type Manager struct {
	Collection CollectionManager
	Segment    SegmentManager
	Loader     Loader
}

func NewManager

func NewManager() *Manager

func (*Manager) SetLoader

func (mgr *Manager) SetLoader(loader Loader)

type MergedResultWithOffsets

type MergedResultWithOffsets struct {
	IDs          *schemapb.IDs
	Selections   []OffsetSelection
	ElementLevel bool // true if results are element-level
}

MergedResultWithOffsets carries PK merge results + offset mappings for the FetchFieldsData operator to retrieve full field data.

type MockCollectionManager

type MockCollectionManager struct {
	mock.Mock
}

MockCollectionManager is an autogenerated mock type for the CollectionManager type

func NewMockCollectionManager

func NewMockCollectionManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCollectionManager

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

func (*MockCollectionManager) Get

func (_m *MockCollectionManager) Get(collectionID int64) *Collection

Get provides a mock function with given fields: collectionID

func (*MockCollectionManager) List

func (_m *MockCollectionManager) List() []int64

List provides a mock function with no fields

func (*MockCollectionManager) ListWithName

func (_m *MockCollectionManager) ListWithName() map[int64]string

ListWithName provides a mock function with no fields

func (*MockCollectionManager) PutOrRef

func (_m *MockCollectionManager) PutOrRef(collectionID int64, schema *schemapb.CollectionSchema, meta *segcorepb.CollectionIndexMeta, loadMeta *querypb.LoadMetaInfo) error

PutOrRef provides a mock function with given fields: collectionID, schema, meta, loadMeta

func (*MockCollectionManager) Ref

func (_m *MockCollectionManager) Ref(collectionID int64, count uint32) bool

Ref provides a mock function with given fields: collectionID, count

func (*MockCollectionManager) Unref

func (_m *MockCollectionManager) Unref(collectionID int64, count uint32) bool

Unref provides a mock function with given fields: collectionID, count

func (*MockCollectionManager) UpdateSchema

func (_m *MockCollectionManager) UpdateSchema(collectionID int64, schema *schemapb.CollectionSchema, version uint64) error

UpdateSchema provides a mock function with given fields: collectionID, schema, version

type MockCollectionManager_Expecter

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

func (*MockCollectionManager_Expecter) Get

func (_e *MockCollectionManager_Expecter) Get(collectionID interface{}) *MockCollectionManager_Get_Call

Get is a helper method to define mock.On call

  • collectionID int64

func (*MockCollectionManager_Expecter) List

List is a helper method to define mock.On call

func (*MockCollectionManager_Expecter) ListWithName

ListWithName is a helper method to define mock.On call

func (*MockCollectionManager_Expecter) PutOrRef

func (_e *MockCollectionManager_Expecter) PutOrRef(collectionID interface{}, schema interface{}, meta interface{}, loadMeta interface{}) *MockCollectionManager_PutOrRef_Call

PutOrRef is a helper method to define mock.On call

  • collectionID int64
  • schema *schemapb.CollectionSchema
  • meta *segcorepb.CollectionIndexMeta
  • loadMeta *querypb.LoadMetaInfo

func (*MockCollectionManager_Expecter) Ref

func (_e *MockCollectionManager_Expecter) Ref(collectionID interface{}, count interface{}) *MockCollectionManager_Ref_Call

Ref is a helper method to define mock.On call

  • collectionID int64
  • count uint32

func (*MockCollectionManager_Expecter) Unref

func (_e *MockCollectionManager_Expecter) Unref(collectionID interface{}, count interface{}) *MockCollectionManager_Unref_Call

Unref is a helper method to define mock.On call

  • collectionID int64
  • count uint32

func (*MockCollectionManager_Expecter) UpdateSchema

func (_e *MockCollectionManager_Expecter) UpdateSchema(collectionID interface{}, schema interface{}, version interface{}) *MockCollectionManager_UpdateSchema_Call

UpdateSchema is a helper method to define mock.On call

  • collectionID int64
  • schema *schemapb.CollectionSchema
  • version uint64

type MockCollectionManager_Get_Call

type MockCollectionManager_Get_Call struct {
	*mock.Call
}

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

func (*MockCollectionManager_Get_Call) Return

func (*MockCollectionManager_Get_Call) Run

func (_c *MockCollectionManager_Get_Call) Run(run func(collectionID int64)) *MockCollectionManager_Get_Call

func (*MockCollectionManager_Get_Call) RunAndReturn

type MockCollectionManager_ListWithName_Call

type MockCollectionManager_ListWithName_Call struct {
	*mock.Call
}

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

func (*MockCollectionManager_ListWithName_Call) Return

func (*MockCollectionManager_ListWithName_Call) Run

func (*MockCollectionManager_ListWithName_Call) RunAndReturn

type MockCollectionManager_List_Call

type MockCollectionManager_List_Call struct {
	*mock.Call
}

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

func (*MockCollectionManager_List_Call) Return

func (*MockCollectionManager_List_Call) Run

func (*MockCollectionManager_List_Call) RunAndReturn

type MockCollectionManager_PutOrRef_Call

type MockCollectionManager_PutOrRef_Call struct {
	*mock.Call
}

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

func (*MockCollectionManager_PutOrRef_Call) Return

func (*MockCollectionManager_PutOrRef_Call) Run

type MockCollectionManager_Ref_Call

type MockCollectionManager_Ref_Call struct {
	*mock.Call
}

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

func (*MockCollectionManager_Ref_Call) Return

func (*MockCollectionManager_Ref_Call) Run

func (_c *MockCollectionManager_Ref_Call) Run(run func(collectionID int64, count uint32)) *MockCollectionManager_Ref_Call

func (*MockCollectionManager_Ref_Call) RunAndReturn

type MockCollectionManager_Unref_Call

type MockCollectionManager_Unref_Call struct {
	*mock.Call
}

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

func (*MockCollectionManager_Unref_Call) Return

func (*MockCollectionManager_Unref_Call) Run

func (_c *MockCollectionManager_Unref_Call) Run(run func(collectionID int64, count uint32)) *MockCollectionManager_Unref_Call

func (*MockCollectionManager_Unref_Call) RunAndReturn

type MockCollectionManager_UpdateSchema_Call

type MockCollectionManager_UpdateSchema_Call struct {
	*mock.Call
}

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

func (*MockCollectionManager_UpdateSchema_Call) Return

func (*MockCollectionManager_UpdateSchema_Call) Run

func (*MockCollectionManager_UpdateSchema_Call) RunAndReturn

type MockLoader

type MockLoader struct {
	mock.Mock
}

MockLoader is an autogenerated mock type for the Loader type

func NewMockLoader

func NewMockLoader(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockLoader

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

func (_m *MockLoader) EXPECT() *MockLoader_Expecter

func (*MockLoader) GetChunkManager

func (_m *MockLoader) GetChunkManager() storage.ChunkManager

GetChunkManager provides a mock function with no fields

func (*MockLoader) Load

func (_m *MockLoader) Load(ctx context.Context, collectionID int64, segmentType commonpb.SegmentState, version int64, _a4 ...*querypb.SegmentLoadInfo) ([]Segment, error)

Load provides a mock function with given fields: ctx, collectionID, segmentType, version, _a4

func (*MockLoader) LoadBloomFilterSet

func (_m *MockLoader) LoadBloomFilterSet(ctx context.Context, collectionID int64, infos ...*querypb.SegmentLoadInfo) ([]*pkoracle.BloomFilterSet, error)

LoadBloomFilterSet provides a mock function with given fields: ctx, collectionID, infos

func (*MockLoader) LoadDeltaLogs

func (_m *MockLoader) LoadDeltaLogs(ctx context.Context, segment Segment, loadInfo *querypb.SegmentLoadInfo) error

LoadDeltaLogs provides a mock function with given fields: ctx, segment, loadInfo

func (*MockLoader) LoadIndex

func (_m *MockLoader) LoadIndex(ctx context.Context, segment Segment, info *querypb.SegmentLoadInfo, version int64) error

LoadIndex provides a mock function with given fields: ctx, segment, info, version

func (*MockLoader) LoadJSONIndex

func (_m *MockLoader) LoadJSONIndex(ctx context.Context, segment Segment, info *querypb.SegmentLoadInfo) error

LoadJSONIndex provides a mock function with given fields: ctx, segment, info

func (*MockLoader) ReopenSegments

func (_m *MockLoader) ReopenSegments(ctx context.Context, loadInfos []*querypb.SegmentLoadInfo) error

ReopenSegments provides a mock function with given fields: ctx, loadInfos

type MockLoader_Expecter

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

func (*MockLoader_Expecter) GetChunkManager

GetChunkManager is a helper method to define mock.On call

func (*MockLoader_Expecter) Load

func (_e *MockLoader_Expecter) Load(ctx interface{}, collectionID interface{}, segmentType interface{}, version interface{}, _a4 ...interface{}) *MockLoader_Load_Call

Load is a helper method to define mock.On call

  • ctx context.Context
  • collectionID int64
  • segmentType commonpb.SegmentState
  • version int64
  • _a4 ...*querypb.SegmentLoadInfo

func (*MockLoader_Expecter) LoadBloomFilterSet

func (_e *MockLoader_Expecter) LoadBloomFilterSet(ctx interface{}, collectionID interface{}, infos ...interface{}) *MockLoader_LoadBloomFilterSet_Call

LoadBloomFilterSet is a helper method to define mock.On call

  • ctx context.Context
  • collectionID int64
  • infos ...*querypb.SegmentLoadInfo

func (*MockLoader_Expecter) LoadDeltaLogs

func (_e *MockLoader_Expecter) LoadDeltaLogs(ctx interface{}, segment interface{}, loadInfo interface{}) *MockLoader_LoadDeltaLogs_Call

LoadDeltaLogs is a helper method to define mock.On call

  • ctx context.Context
  • segment Segment
  • loadInfo *querypb.SegmentLoadInfo

func (*MockLoader_Expecter) LoadIndex

func (_e *MockLoader_Expecter) LoadIndex(ctx interface{}, segment interface{}, info interface{}, version interface{}) *MockLoader_LoadIndex_Call

LoadIndex is a helper method to define mock.On call

  • ctx context.Context
  • segment Segment
  • info *querypb.SegmentLoadInfo
  • version int64

func (*MockLoader_Expecter) LoadJSONIndex

func (_e *MockLoader_Expecter) LoadJSONIndex(ctx interface{}, segment interface{}, info interface{}) *MockLoader_LoadJSONIndex_Call

LoadJSONIndex is a helper method to define mock.On call

  • ctx context.Context
  • segment Segment
  • info *querypb.SegmentLoadInfo

func (*MockLoader_Expecter) ReopenSegments

func (_e *MockLoader_Expecter) ReopenSegments(ctx interface{}, loadInfos interface{}) *MockLoader_ReopenSegments_Call

ReopenSegments is a helper method to define mock.On call

  • ctx context.Context
  • loadInfos []*querypb.SegmentLoadInfo

type MockLoader_GetChunkManager_Call

type MockLoader_GetChunkManager_Call struct {
	*mock.Call
}

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

func (*MockLoader_GetChunkManager_Call) Return

func (*MockLoader_GetChunkManager_Call) Run

func (*MockLoader_GetChunkManager_Call) RunAndReturn

type MockLoader_LoadBloomFilterSet_Call

type MockLoader_LoadBloomFilterSet_Call struct {
	*mock.Call
}

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

func (*MockLoader_LoadBloomFilterSet_Call) Return

func (*MockLoader_LoadBloomFilterSet_Call) Run

func (*MockLoader_LoadBloomFilterSet_Call) RunAndReturn

type MockLoader_LoadDeltaLogs_Call

type MockLoader_LoadDeltaLogs_Call struct {
	*mock.Call
}

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

func (*MockLoader_LoadDeltaLogs_Call) Return

func (*MockLoader_LoadDeltaLogs_Call) Run

func (*MockLoader_LoadDeltaLogs_Call) RunAndReturn

type MockLoader_LoadIndex_Call

type MockLoader_LoadIndex_Call struct {
	*mock.Call
}

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

func (*MockLoader_LoadIndex_Call) Return

func (*MockLoader_LoadIndex_Call) Run

func (*MockLoader_LoadIndex_Call) RunAndReturn

type MockLoader_LoadJSONIndex_Call

type MockLoader_LoadJSONIndex_Call struct {
	*mock.Call
}

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

func (*MockLoader_LoadJSONIndex_Call) Return

func (*MockLoader_LoadJSONIndex_Call) Run

func (*MockLoader_LoadJSONIndex_Call) RunAndReturn

type MockLoader_Load_Call

type MockLoader_Load_Call struct {
	*mock.Call
}

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

func (*MockLoader_Load_Call) Return

func (_c *MockLoader_Load_Call) Return(_a0 []Segment, _a1 error) *MockLoader_Load_Call

func (*MockLoader_Load_Call) Run

func (_c *MockLoader_Load_Call) Run(run func(ctx context.Context, collectionID int64, segmentType commonpb.SegmentState, version int64, _a4 ...*querypb.SegmentLoadInfo)) *MockLoader_Load_Call

func (*MockLoader_Load_Call) RunAndReturn

type MockLoader_ReopenSegments_Call

type MockLoader_ReopenSegments_Call struct {
	*mock.Call
}

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

func (*MockLoader_ReopenSegments_Call) Return

func (*MockLoader_ReopenSegments_Call) Run

func (*MockLoader_ReopenSegments_Call) RunAndReturn

type MockSegment

type MockSegment struct {
	mock.Mock
}

MockSegment is an autogenerated mock type for the Segment type

func NewMockSegment

func NewMockSegment(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSegment

NewMockSegment creates a new instance of MockSegment. 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 (*MockSegment) BatchPkExist

func (_m *MockSegment) BatchPkExist(lc *storage.BatchLocationsCache) []bool

BatchPkExist provides a mock function with given fields: lc

func (*MockSegment) CASVersion

func (_m *MockSegment) CASVersion(_a0 int64, _a1 int64) bool

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

func (*MockSegment) Charge

func (_m *MockSegment) Charge()

Charge provides a mock function with no fields

func (*MockSegment) Collection

func (_m *MockSegment) Collection() int64

Collection provides a mock function with no fields

func (*MockSegment) DatabaseName

func (_m *MockSegment) DatabaseName() string

DatabaseName provides a mock function with no fields

func (*MockSegment) Delete

func (_m *MockSegment) Delete(ctx context.Context, primaryKeys storage.PrimaryKeys, timestamps []uint64) error

Delete provides a mock function with given fields: ctx, primaryKeys, timestamps

func (*MockSegment) DropIndex

func (_m *MockSegment) DropIndex(ctx context.Context, indexID int64) error

DropIndex provides a mock function with given fields: ctx, indexID

func (*MockSegment) EXPECT

func (_m *MockSegment) EXPECT() *MockSegment_Expecter

func (*MockSegment) ExistIndex

func (_m *MockSegment) ExistIndex(fieldID int64) bool

ExistIndex provides a mock function with given fields: fieldID

func (*MockSegment) FlushData

func (_m *MockSegment) FlushData(ctx context.Context, startOffset int64, endOffset int64, config *FlushConfig) (*FlushResult, error)

FlushData provides a mock function with given fields: ctx, startOffset, endOffset, config

func (*MockSegment) GetBM25Stats

func (_m *MockSegment) GetBM25Stats() map[int64]*storage.BM25Stats

GetBM25Stats provides a mock function with no fields

func (*MockSegment) GetFieldJSONIndexStats

func (_m *MockSegment) GetFieldJSONIndexStats() map[int64]*querypb.JsonStatsInfo

GetFieldJSONIndexStats provides a mock function with no fields

func (*MockSegment) GetIndex

func (_m *MockSegment) GetIndex(fieldID int64) []*IndexedFieldInfo

GetIndex provides a mock function with given fields: fieldID

func (*MockSegment) GetIndexByID

func (_m *MockSegment) GetIndexByID(indexID int64) *IndexedFieldInfo

GetIndexByID provides a mock function with given fields: indexID

func (*MockSegment) GetMaxPk

func (_m *MockSegment) GetMaxPk() *storage.PrimaryKey

GetMaxPk provides a mock function with no fields

func (*MockSegment) GetMinPk

func (_m *MockSegment) GetMinPk() *storage.PrimaryKey

GetMinPk provides a mock function with no fields

func (*MockSegment) HasRawData

func (_m *MockSegment) HasRawData(fieldID int64) bool

HasRawData provides a mock function with given fields: fieldID

func (*MockSegment) ID

func (_m *MockSegment) ID() int64

ID provides a mock function with no fields

func (*MockSegment) Indexes

func (_m *MockSegment) Indexes() []*IndexedFieldInfo

Indexes provides a mock function with no fields

func (*MockSegment) Insert

func (_m *MockSegment) Insert(ctx context.Context, rowIDs []int64, timestamps []uint64, record *segcorepb.InsertRecord) error

Insert provides a mock function with given fields: ctx, rowIDs, timestamps, record

func (*MockSegment) InsertCount

func (_m *MockSegment) InsertCount() int64

InsertCount provides a mock function with no fields

func (*MockSegment) IsLazyLoad

func (_m *MockSegment) IsLazyLoad() bool

IsLazyLoad provides a mock function with no fields

func (*MockSegment) IsSorted

func (_m *MockSegment) IsSorted() bool

IsSorted provides a mock function with no fields

func (*MockSegment) LastDeltaTimestamp

func (_m *MockSegment) LastDeltaTimestamp() uint64

LastDeltaTimestamp provides a mock function with no fields

func (*MockSegment) Level

func (_m *MockSegment) Level() datapb.SegmentLevel

Level provides a mock function with no fields

func (*MockSegment) Load

func (_m *MockSegment) Load(ctx context.Context) error

Load provides a mock function with given fields: ctx

func (*MockSegment) LoadDeltaData

func (_m *MockSegment) LoadDeltaData(ctx context.Context, deltaData *storage.DeltaData) error

LoadDeltaData provides a mock function with given fields: ctx, deltaData

func (*MockSegment) LoadInfo

func (_m *MockSegment) LoadInfo() *querypb.SegmentLoadInfo

LoadInfo provides a mock function with no fields

func (*MockSegment) MayPkExist

func (_m *MockSegment) MayPkExist(lc *storage.LocationsCache) bool

MayPkExist provides a mock function with given fields: lc

func (*MockSegment) MemSize

func (_m *MockSegment) MemSize() int64

MemSize provides a mock function with no fields

func (*MockSegment) NeedUpdatedVersion

func (_m *MockSegment) NeedUpdatedVersion() int64

NeedUpdatedVersion provides a mock function with no fields

func (*MockSegment) Partition

func (_m *MockSegment) Partition() int64

Partition provides a mock function with no fields

func (*MockSegment) PinIfNotReleased

func (_m *MockSegment) PinIfNotReleased() error

PinIfNotReleased provides a mock function with no fields

func (*MockSegment) PkCandidateExist

func (_m *MockSegment) PkCandidateExist() bool

PkCandidateExist provides a mock function with no fields

func (*MockSegment) Refund

func (_m *MockSegment) Refund()

Refund provides a mock function with no fields

func (*MockSegment) Release

func (_m *MockSegment) Release(ctx context.Context, opts ...releaseOption)

Release provides a mock function with given fields: ctx, opts

func (*MockSegment) RemoveUnusedFieldFiles

func (_m *MockSegment) RemoveUnusedFieldFiles() error

RemoveUnusedFieldFiles provides a mock function with no fields

func (*MockSegment) Reopen

func (_m *MockSegment) Reopen(ctx context.Context, newLoadInfo *querypb.SegmentLoadInfo) error

Reopen provides a mock function with given fields: ctx, newLoadInfo

func (*MockSegment) ResetIndexesLazyLoad

func (_m *MockSegment) ResetIndexesLazyLoad(lazyState bool)

ResetIndexesLazyLoad provides a mock function with given fields: lazyState

func (*MockSegment) ResourceGroup

func (_m *MockSegment) ResourceGroup() string

ResourceGroup provides a mock function with no fields

func (*MockSegment) ResourceUsageEstimate

func (_m *MockSegment) ResourceUsageEstimate() ResourceUsage

ResourceUsageEstimate provides a mock function with no fields

func (*MockSegment) Retrieve

Retrieve provides a mock function with given fields: ctx, plan

func (*MockSegment) RetrieveByOffsets

RetrieveByOffsets provides a mock function with given fields: ctx, plan

func (*MockSegment) RowNum

func (_m *MockSegment) RowNum() int64

RowNum provides a mock function with no fields

func (*MockSegment) Search

func (_m *MockSegment) Search(ctx context.Context, searchReq *segcore.SearchRequest) (*segcore.SearchResult, error)

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

func (*MockSegment) SetPKCandidate

func (_m *MockSegment) SetPKCandidate(candidate pkoracle.Candidate)

SetPKCandidate provides a mock function with given fields: candidate

func (*MockSegment) Shard

func (_m *MockSegment) Shard() metautil.Channel

Shard provides a mock function with no fields

func (*MockSegment) StartPosition

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

StartPosition provides a mock function with no fields

func (*MockSegment) Stats

func (_m *MockSegment) Stats() *storage.PkStatistics

Stats provides a mock function with no fields

func (*MockSegment) Type

func (_m *MockSegment) Type() commonpb.SegmentState

Type provides a mock function with no fields

func (*MockSegment) Unpin

func (_m *MockSegment) Unpin()

Unpin provides a mock function with no fields

func (*MockSegment) UpdateBM25Stats

func (_m *MockSegment) UpdateBM25Stats(stats map[int64]*storage.BM25Stats)

UpdateBM25Stats provides a mock function with given fields: stats

func (*MockSegment) UpdatePkCandidate

func (_m *MockSegment) UpdatePkCandidate(pks []storage.PrimaryKey)

UpdatePkCandidate provides a mock function with given fields: pks

func (*MockSegment) Version

func (_m *MockSegment) Version() int64

Version provides a mock function with no fields

type MockSegmentManager

type MockSegmentManager struct {
	mock.Mock
}

MockSegmentManager is an autogenerated mock type for the SegmentManager type

func NewMockSegmentManager

func NewMockSegmentManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSegmentManager

NewMockSegmentManager creates a new instance of MockSegmentManager. 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 (*MockSegmentManager) AddLoadedBinlogSize

func (_m *MockSegmentManager) AddLoadedBinlogSize(size int64)

AddLoadedBinlogSize provides a mock function with given fields: size

func (*MockSegmentManager) AddLogicalResource

func (_m *MockSegmentManager) AddLogicalResource(usage ResourceUsage)

AddLogicalResource provides a mock function with given fields: usage

func (*MockSegmentManager) Clear

func (_m *MockSegmentManager) Clear(ctx context.Context)

Clear provides a mock function with given fields: ctx

func (*MockSegmentManager) EXPECT

func (*MockSegmentManager) Empty

func (_m *MockSegmentManager) Empty() bool

Empty provides a mock function with no fields

func (*MockSegmentManager) Exist

func (_m *MockSegmentManager) Exist(segmentID int64, typ commonpb.SegmentState) bool

Exist provides a mock function with given fields: segmentID, typ

func (*MockSegmentManager) Get

func (_m *MockSegmentManager) Get(segmentID int64) Segment

Get provides a mock function with given fields: segmentID

func (*MockSegmentManager) GetAndPin

func (_m *MockSegmentManager) GetAndPin(_a0 []int64, filters ...SegmentFilter) ([]Segment, error)

GetAndPin provides a mock function with given fields: _a0, filters

func (*MockSegmentManager) GetAndPinBy

func (_m *MockSegmentManager) GetAndPinBy(filters ...SegmentFilter) ([]Segment, error)

GetAndPinBy provides a mock function with given fields: filters

func (*MockSegmentManager) GetBy

func (_m *MockSegmentManager) GetBy(filters ...SegmentFilter) []Segment

GetBy provides a mock function with given fields: filters

func (*MockSegmentManager) GetGrowing

func (_m *MockSegmentManager) GetGrowing(segmentID int64) Segment

GetGrowing provides a mock function with given fields: segmentID

func (*MockSegmentManager) GetLoadedBinlogSize

func (_m *MockSegmentManager) GetLoadedBinlogSize() int64

GetLoadedBinlogSize provides a mock function with no fields

func (*MockSegmentManager) GetLogicalResource

func (_m *MockSegmentManager) GetLogicalResource() ResourceUsage

GetLogicalResource provides a mock function with no fields

func (*MockSegmentManager) GetSealed

func (_m *MockSegmentManager) GetSealed(segmentID int64) Segment

GetSealed provides a mock function with given fields: segmentID

func (*MockSegmentManager) GetWithType

func (_m *MockSegmentManager) GetWithType(segmentID int64, typ commonpb.SegmentState) Segment

GetWithType provides a mock function with given fields: segmentID, typ

func (*MockSegmentManager) Put

func (_m *MockSegmentManager) Put(ctx context.Context, segmentType commonpb.SegmentState, _a2 ...Segment)

Put provides a mock function with given fields: ctx, segmentType, _a2

func (*MockSegmentManager) Remove

func (_m *MockSegmentManager) Remove(ctx context.Context, segmentID int64, scope querypb.DataScope) (int, int)

Remove provides a mock function with given fields: ctx, segmentID, scope

func (*MockSegmentManager) RemoveBy

func (_m *MockSegmentManager) RemoveBy(ctx context.Context, filters ...SegmentFilter) (int, int)

RemoveBy provides a mock function with given fields: ctx, filters

func (*MockSegmentManager) SubLoadedBinlogSize

func (_m *MockSegmentManager) SubLoadedBinlogSize(size int64)

SubLoadedBinlogSize provides a mock function with given fields: size

func (*MockSegmentManager) SubLogicalResource

func (_m *MockSegmentManager) SubLogicalResource(usage ResourceUsage)

SubLogicalResource provides a mock function with given fields: usage

func (*MockSegmentManager) Unpin

func (_m *MockSegmentManager) Unpin(_a0 []Segment)

Unpin provides a mock function with given fields: _a0

func (*MockSegmentManager) UpdateBy

func (_m *MockSegmentManager) UpdateBy(action SegmentAction, filters ...SegmentFilter) int

UpdateBy provides a mock function with given fields: action, filters

type MockSegmentManager_AddLoadedBinlogSize_Call

type MockSegmentManager_AddLoadedBinlogSize_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_AddLoadedBinlogSize_Call) Return

func (*MockSegmentManager_AddLoadedBinlogSize_Call) Run

func (*MockSegmentManager_AddLoadedBinlogSize_Call) RunAndReturn

type MockSegmentManager_AddLogicalResource_Call

type MockSegmentManager_AddLogicalResource_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_AddLogicalResource_Call) Return

func (*MockSegmentManager_AddLogicalResource_Call) Run

func (*MockSegmentManager_AddLogicalResource_Call) RunAndReturn

type MockSegmentManager_Clear_Call

type MockSegmentManager_Clear_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_Clear_Call) Return

func (*MockSegmentManager_Clear_Call) Run

func (*MockSegmentManager_Clear_Call) RunAndReturn

type MockSegmentManager_Empty_Call

type MockSegmentManager_Empty_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_Empty_Call) Return

func (*MockSegmentManager_Empty_Call) Run

func (*MockSegmentManager_Empty_Call) RunAndReturn

type MockSegmentManager_Exist_Call

type MockSegmentManager_Exist_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_Exist_Call) Return

func (*MockSegmentManager_Exist_Call) Run

func (*MockSegmentManager_Exist_Call) RunAndReturn

type MockSegmentManager_Expecter

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

func (*MockSegmentManager_Expecter) AddLoadedBinlogSize

func (_e *MockSegmentManager_Expecter) AddLoadedBinlogSize(size interface{}) *MockSegmentManager_AddLoadedBinlogSize_Call

AddLoadedBinlogSize is a helper method to define mock.On call

  • size int64

func (*MockSegmentManager_Expecter) AddLogicalResource

func (_e *MockSegmentManager_Expecter) AddLogicalResource(usage interface{}) *MockSegmentManager_AddLogicalResource_Call

AddLogicalResource is a helper method to define mock.On call

  • usage ResourceUsage

func (*MockSegmentManager_Expecter) Clear

func (_e *MockSegmentManager_Expecter) Clear(ctx interface{}) *MockSegmentManager_Clear_Call

Clear is a helper method to define mock.On call

  • ctx context.Context

func (*MockSegmentManager_Expecter) Empty

Empty is a helper method to define mock.On call

func (*MockSegmentManager_Expecter) Exist

func (_e *MockSegmentManager_Expecter) Exist(segmentID interface{}, typ interface{}) *MockSegmentManager_Exist_Call

Exist is a helper method to define mock.On call

  • segmentID int64
  • typ commonpb.SegmentState

func (*MockSegmentManager_Expecter) Get

func (_e *MockSegmentManager_Expecter) Get(segmentID interface{}) *MockSegmentManager_Get_Call

Get is a helper method to define mock.On call

  • segmentID int64

func (*MockSegmentManager_Expecter) GetAndPin

func (_e *MockSegmentManager_Expecter) GetAndPin(_a0 interface{}, filters ...interface{}) *MockSegmentManager_GetAndPin_Call

GetAndPin is a helper method to define mock.On call

  • _a0 []int64
  • filters ...SegmentFilter

func (*MockSegmentManager_Expecter) GetAndPinBy

func (_e *MockSegmentManager_Expecter) GetAndPinBy(filters ...interface{}) *MockSegmentManager_GetAndPinBy_Call

GetAndPinBy is a helper method to define mock.On call

  • filters ...SegmentFilter

func (*MockSegmentManager_Expecter) GetBy

func (_e *MockSegmentManager_Expecter) GetBy(filters ...interface{}) *MockSegmentManager_GetBy_Call

GetBy is a helper method to define mock.On call

  • filters ...SegmentFilter

func (*MockSegmentManager_Expecter) GetGrowing

func (_e *MockSegmentManager_Expecter) GetGrowing(segmentID interface{}) *MockSegmentManager_GetGrowing_Call

GetGrowing is a helper method to define mock.On call

  • segmentID int64

func (*MockSegmentManager_Expecter) GetLoadedBinlogSize

GetLoadedBinlogSize is a helper method to define mock.On call

func (*MockSegmentManager_Expecter) GetLogicalResource

GetLogicalResource is a helper method to define mock.On call

func (*MockSegmentManager_Expecter) GetSealed

func (_e *MockSegmentManager_Expecter) GetSealed(segmentID interface{}) *MockSegmentManager_GetSealed_Call

GetSealed is a helper method to define mock.On call

  • segmentID int64

func (*MockSegmentManager_Expecter) GetWithType

func (_e *MockSegmentManager_Expecter) GetWithType(segmentID interface{}, typ interface{}) *MockSegmentManager_GetWithType_Call

GetWithType is a helper method to define mock.On call

  • segmentID int64
  • typ commonpb.SegmentState

func (*MockSegmentManager_Expecter) Put

func (_e *MockSegmentManager_Expecter) Put(ctx interface{}, segmentType interface{}, _a2 ...interface{}) *MockSegmentManager_Put_Call

Put is a helper method to define mock.On call

  • ctx context.Context
  • segmentType commonpb.SegmentState
  • _a2 ...Segment

func (*MockSegmentManager_Expecter) Remove

func (_e *MockSegmentManager_Expecter) Remove(ctx interface{}, segmentID interface{}, scope interface{}) *MockSegmentManager_Remove_Call

Remove is a helper method to define mock.On call

  • ctx context.Context
  • segmentID int64
  • scope querypb.DataScope

func (*MockSegmentManager_Expecter) RemoveBy

func (_e *MockSegmentManager_Expecter) RemoveBy(ctx interface{}, filters ...interface{}) *MockSegmentManager_RemoveBy_Call

RemoveBy is a helper method to define mock.On call

  • ctx context.Context
  • filters ...SegmentFilter

func (*MockSegmentManager_Expecter) SubLoadedBinlogSize

func (_e *MockSegmentManager_Expecter) SubLoadedBinlogSize(size interface{}) *MockSegmentManager_SubLoadedBinlogSize_Call

SubLoadedBinlogSize is a helper method to define mock.On call

  • size int64

func (*MockSegmentManager_Expecter) SubLogicalResource

func (_e *MockSegmentManager_Expecter) SubLogicalResource(usage interface{}) *MockSegmentManager_SubLogicalResource_Call

SubLogicalResource is a helper method to define mock.On call

  • usage ResourceUsage

func (*MockSegmentManager_Expecter) Unpin

func (_e *MockSegmentManager_Expecter) Unpin(_a0 interface{}) *MockSegmentManager_Unpin_Call

Unpin is a helper method to define mock.On call

  • _a0 []Segment

func (*MockSegmentManager_Expecter) UpdateBy

func (_e *MockSegmentManager_Expecter) UpdateBy(action interface{}, filters ...interface{}) *MockSegmentManager_UpdateBy_Call

UpdateBy is a helper method to define mock.On call

  • action SegmentAction
  • filters ...SegmentFilter

type MockSegmentManager_GetAndPinBy_Call

type MockSegmentManager_GetAndPinBy_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetAndPinBy_Call) Return

func (*MockSegmentManager_GetAndPinBy_Call) Run

func (*MockSegmentManager_GetAndPinBy_Call) RunAndReturn

type MockSegmentManager_GetAndPin_Call

type MockSegmentManager_GetAndPin_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetAndPin_Call) Return

func (*MockSegmentManager_GetAndPin_Call) Run

func (*MockSegmentManager_GetAndPin_Call) RunAndReturn

type MockSegmentManager_GetBy_Call

type MockSegmentManager_GetBy_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetBy_Call) Return

func (*MockSegmentManager_GetBy_Call) Run

func (*MockSegmentManager_GetBy_Call) RunAndReturn

type MockSegmentManager_GetGrowing_Call

type MockSegmentManager_GetGrowing_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetGrowing_Call) Return

func (*MockSegmentManager_GetGrowing_Call) Run

func (*MockSegmentManager_GetGrowing_Call) RunAndReturn

type MockSegmentManager_GetLoadedBinlogSize_Call

type MockSegmentManager_GetLoadedBinlogSize_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetLoadedBinlogSize_Call) Return

func (*MockSegmentManager_GetLoadedBinlogSize_Call) Run

func (*MockSegmentManager_GetLoadedBinlogSize_Call) RunAndReturn

type MockSegmentManager_GetLogicalResource_Call

type MockSegmentManager_GetLogicalResource_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetLogicalResource_Call) Return

func (*MockSegmentManager_GetLogicalResource_Call) Run

func (*MockSegmentManager_GetLogicalResource_Call) RunAndReturn

type MockSegmentManager_GetSealed_Call

type MockSegmentManager_GetSealed_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetSealed_Call) Return

func (*MockSegmentManager_GetSealed_Call) Run

func (*MockSegmentManager_GetSealed_Call) RunAndReturn

type MockSegmentManager_GetWithType_Call

type MockSegmentManager_GetWithType_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_GetWithType_Call) Return

func (*MockSegmentManager_GetWithType_Call) Run

func (*MockSegmentManager_GetWithType_Call) RunAndReturn

type MockSegmentManager_Get_Call

type MockSegmentManager_Get_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_Get_Call) Return

func (*MockSegmentManager_Get_Call) Run

func (_c *MockSegmentManager_Get_Call) Run(run func(segmentID int64)) *MockSegmentManager_Get_Call

func (*MockSegmentManager_Get_Call) RunAndReturn

type MockSegmentManager_Put_Call

type MockSegmentManager_Put_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_Put_Call) Return

func (*MockSegmentManager_Put_Call) Run

func (*MockSegmentManager_Put_Call) RunAndReturn

type MockSegmentManager_RemoveBy_Call

type MockSegmentManager_RemoveBy_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_RemoveBy_Call) Return

func (*MockSegmentManager_RemoveBy_Call) Run

func (*MockSegmentManager_RemoveBy_Call) RunAndReturn

type MockSegmentManager_Remove_Call

type MockSegmentManager_Remove_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_Remove_Call) Return

func (*MockSegmentManager_Remove_Call) Run

func (*MockSegmentManager_Remove_Call) RunAndReturn

type MockSegmentManager_SubLoadedBinlogSize_Call

type MockSegmentManager_SubLoadedBinlogSize_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_SubLoadedBinlogSize_Call) Return

func (*MockSegmentManager_SubLoadedBinlogSize_Call) Run

func (*MockSegmentManager_SubLoadedBinlogSize_Call) RunAndReturn

type MockSegmentManager_SubLogicalResource_Call

type MockSegmentManager_SubLogicalResource_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_SubLogicalResource_Call) Return

func (*MockSegmentManager_SubLogicalResource_Call) Run

func (*MockSegmentManager_SubLogicalResource_Call) RunAndReturn

type MockSegmentManager_Unpin_Call

type MockSegmentManager_Unpin_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_Unpin_Call) Return

func (*MockSegmentManager_Unpin_Call) Run

func (*MockSegmentManager_Unpin_Call) RunAndReturn

type MockSegmentManager_UpdateBy_Call

type MockSegmentManager_UpdateBy_Call struct {
	*mock.Call
}

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

func (*MockSegmentManager_UpdateBy_Call) Return

func (*MockSegmentManager_UpdateBy_Call) Run

func (*MockSegmentManager_UpdateBy_Call) RunAndReturn

type MockSegment_BatchPkExist_Call

type MockSegment_BatchPkExist_Call struct {
	*mock.Call
}

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

func (*MockSegment_BatchPkExist_Call) Return

func (*MockSegment_BatchPkExist_Call) Run

func (*MockSegment_BatchPkExist_Call) RunAndReturn

type MockSegment_CASVersion_Call

type MockSegment_CASVersion_Call struct {
	*mock.Call
}

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

func (*MockSegment_CASVersion_Call) Return

func (*MockSegment_CASVersion_Call) Run

func (*MockSegment_CASVersion_Call) RunAndReturn

type MockSegment_Charge_Call

type MockSegment_Charge_Call struct {
	*mock.Call
}

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

func (*MockSegment_Charge_Call) Return

func (*MockSegment_Charge_Call) Run

func (_c *MockSegment_Charge_Call) Run(run func()) *MockSegment_Charge_Call

func (*MockSegment_Charge_Call) RunAndReturn

func (_c *MockSegment_Charge_Call) RunAndReturn(run func()) *MockSegment_Charge_Call

type MockSegment_Collection_Call

type MockSegment_Collection_Call struct {
	*mock.Call
}

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

func (*MockSegment_Collection_Call) Return

func (*MockSegment_Collection_Call) Run

func (*MockSegment_Collection_Call) RunAndReturn

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

type MockSegment_DatabaseName_Call

type MockSegment_DatabaseName_Call struct {
	*mock.Call
}

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

func (*MockSegment_DatabaseName_Call) Return

func (*MockSegment_DatabaseName_Call) Run

func (*MockSegment_DatabaseName_Call) RunAndReturn

type MockSegment_Delete_Call

type MockSegment_Delete_Call struct {
	*mock.Call
}

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

func (*MockSegment_Delete_Call) Return

func (*MockSegment_Delete_Call) Run

func (_c *MockSegment_Delete_Call) Run(run func(ctx context.Context, primaryKeys storage.PrimaryKeys, timestamps []uint64)) *MockSegment_Delete_Call

func (*MockSegment_Delete_Call) RunAndReturn

type MockSegment_DropIndex_Call

type MockSegment_DropIndex_Call struct {
	*mock.Call
}

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

func (*MockSegment_DropIndex_Call) Return

func (*MockSegment_DropIndex_Call) Run

func (*MockSegment_DropIndex_Call) RunAndReturn

type MockSegment_ExistIndex_Call

type MockSegment_ExistIndex_Call struct {
	*mock.Call
}

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

func (*MockSegment_ExistIndex_Call) Return

func (*MockSegment_ExistIndex_Call) Run

func (*MockSegment_ExistIndex_Call) RunAndReturn

type MockSegment_Expecter

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

func (*MockSegment_Expecter) BatchPkExist

func (_e *MockSegment_Expecter) BatchPkExist(lc interface{}) *MockSegment_BatchPkExist_Call

BatchPkExist is a helper method to define mock.On call

  • lc *storage.BatchLocationsCache

func (*MockSegment_Expecter) CASVersion

func (_e *MockSegment_Expecter) CASVersion(_a0 interface{}, _a1 interface{}) *MockSegment_CASVersion_Call

CASVersion is a helper method to define mock.On call

  • _a0 int64
  • _a1 int64

func (*MockSegment_Expecter) Charge

Charge is a helper method to define mock.On call

func (*MockSegment_Expecter) Collection

Collection is a helper method to define mock.On call

func (*MockSegment_Expecter) DatabaseName

DatabaseName is a helper method to define mock.On call

func (*MockSegment_Expecter) Delete

func (_e *MockSegment_Expecter) Delete(ctx interface{}, primaryKeys interface{}, timestamps interface{}) *MockSegment_Delete_Call

Delete is a helper method to define mock.On call

  • ctx context.Context
  • primaryKeys storage.PrimaryKeys
  • timestamps []uint64

func (*MockSegment_Expecter) DropIndex

func (_e *MockSegment_Expecter) DropIndex(ctx interface{}, indexID interface{}) *MockSegment_DropIndex_Call

DropIndex is a helper method to define mock.On call

  • ctx context.Context
  • indexID int64

func (*MockSegment_Expecter) ExistIndex

func (_e *MockSegment_Expecter) ExistIndex(fieldID interface{}) *MockSegment_ExistIndex_Call

ExistIndex is a helper method to define mock.On call

  • fieldID int64

func (*MockSegment_Expecter) FlushData

func (_e *MockSegment_Expecter) FlushData(ctx interface{}, startOffset interface{}, endOffset interface{}, config interface{}) *MockSegment_FlushData_Call

FlushData is a helper method to define mock.On call

  • ctx context.Context
  • startOffset int64
  • endOffset int64
  • config *FlushConfig

func (*MockSegment_Expecter) GetBM25Stats

GetBM25Stats is a helper method to define mock.On call

func (*MockSegment_Expecter) GetFieldJSONIndexStats

func (_e *MockSegment_Expecter) GetFieldJSONIndexStats() *MockSegment_GetFieldJSONIndexStats_Call

GetFieldJSONIndexStats is a helper method to define mock.On call

func (*MockSegment_Expecter) GetIndex

func (_e *MockSegment_Expecter) GetIndex(fieldID interface{}) *MockSegment_GetIndex_Call

GetIndex is a helper method to define mock.On call

  • fieldID int64

func (*MockSegment_Expecter) GetIndexByID

func (_e *MockSegment_Expecter) GetIndexByID(indexID interface{}) *MockSegment_GetIndexByID_Call

GetIndexByID is a helper method to define mock.On call

  • indexID int64

func (*MockSegment_Expecter) GetMaxPk

GetMaxPk is a helper method to define mock.On call

func (*MockSegment_Expecter) GetMinPk

GetMinPk is a helper method to define mock.On call

func (*MockSegment_Expecter) HasRawData

func (_e *MockSegment_Expecter) HasRawData(fieldID interface{}) *MockSegment_HasRawData_Call

HasRawData is a helper method to define mock.On call

  • fieldID int64

func (*MockSegment_Expecter) ID

ID is a helper method to define mock.On call

func (*MockSegment_Expecter) Indexes

Indexes is a helper method to define mock.On call

func (*MockSegment_Expecter) Insert

func (_e *MockSegment_Expecter) Insert(ctx interface{}, rowIDs interface{}, timestamps interface{}, record interface{}) *MockSegment_Insert_Call

Insert is a helper method to define mock.On call

  • ctx context.Context
  • rowIDs []int64
  • timestamps []uint64
  • record *segcorepb.InsertRecord

func (*MockSegment_Expecter) InsertCount

InsertCount is a helper method to define mock.On call

func (*MockSegment_Expecter) IsLazyLoad

IsLazyLoad is a helper method to define mock.On call

func (*MockSegment_Expecter) IsSorted

IsSorted is a helper method to define mock.On call

func (*MockSegment_Expecter) LastDeltaTimestamp

LastDeltaTimestamp is a helper method to define mock.On call

func (*MockSegment_Expecter) Level

Level is a helper method to define mock.On call

func (*MockSegment_Expecter) Load

func (_e *MockSegment_Expecter) Load(ctx interface{}) *MockSegment_Load_Call

Load is a helper method to define mock.On call

  • ctx context.Context

func (*MockSegment_Expecter) LoadDeltaData

func (_e *MockSegment_Expecter) LoadDeltaData(ctx interface{}, deltaData interface{}) *MockSegment_LoadDeltaData_Call

LoadDeltaData is a helper method to define mock.On call

  • ctx context.Context
  • deltaData *storage.DeltaData

func (*MockSegment_Expecter) LoadInfo

LoadInfo is a helper method to define mock.On call

func (*MockSegment_Expecter) MayPkExist

func (_e *MockSegment_Expecter) MayPkExist(lc interface{}) *MockSegment_MayPkExist_Call

MayPkExist is a helper method to define mock.On call

  • lc *storage.LocationsCache

func (*MockSegment_Expecter) MemSize

MemSize is a helper method to define mock.On call

func (*MockSegment_Expecter) NeedUpdatedVersion

NeedUpdatedVersion is a helper method to define mock.On call

func (*MockSegment_Expecter) Partition

Partition is a helper method to define mock.On call

func (*MockSegment_Expecter) PinIfNotReleased

PinIfNotReleased is a helper method to define mock.On call

func (*MockSegment_Expecter) PkCandidateExist

PkCandidateExist is a helper method to define mock.On call

func (*MockSegment_Expecter) Refund

Refund is a helper method to define mock.On call

func (*MockSegment_Expecter) Release

func (_e *MockSegment_Expecter) Release(ctx interface{}, opts ...interface{}) *MockSegment_Release_Call

Release is a helper method to define mock.On call

  • ctx context.Context
  • opts ...releaseOption

func (*MockSegment_Expecter) RemoveUnusedFieldFiles

func (_e *MockSegment_Expecter) RemoveUnusedFieldFiles() *MockSegment_RemoveUnusedFieldFiles_Call

RemoveUnusedFieldFiles is a helper method to define mock.On call

func (*MockSegment_Expecter) Reopen

func (_e *MockSegment_Expecter) Reopen(ctx interface{}, newLoadInfo interface{}) *MockSegment_Reopen_Call

Reopen is a helper method to define mock.On call

  • ctx context.Context
  • newLoadInfo *querypb.SegmentLoadInfo

func (*MockSegment_Expecter) ResetIndexesLazyLoad

func (_e *MockSegment_Expecter) ResetIndexesLazyLoad(lazyState interface{}) *MockSegment_ResetIndexesLazyLoad_Call

ResetIndexesLazyLoad is a helper method to define mock.On call

  • lazyState bool

func (*MockSegment_Expecter) ResourceGroup

ResourceGroup is a helper method to define mock.On call

func (*MockSegment_Expecter) ResourceUsageEstimate

func (_e *MockSegment_Expecter) ResourceUsageEstimate() *MockSegment_ResourceUsageEstimate_Call

ResourceUsageEstimate is a helper method to define mock.On call

func (*MockSegment_Expecter) Retrieve

func (_e *MockSegment_Expecter) Retrieve(ctx interface{}, plan interface{}) *MockSegment_Retrieve_Call

Retrieve is a helper method to define mock.On call

  • ctx context.Context
  • plan *segcore.RetrievePlan

func (*MockSegment_Expecter) RetrieveByOffsets

func (_e *MockSegment_Expecter) RetrieveByOffsets(ctx interface{}, plan interface{}) *MockSegment_RetrieveByOffsets_Call

RetrieveByOffsets is a helper method to define mock.On call

  • ctx context.Context
  • plan *segcore.RetrievePlanWithOffsets

func (*MockSegment_Expecter) RowNum

RowNum is a helper method to define mock.On call

func (*MockSegment_Expecter) Search

func (_e *MockSegment_Expecter) Search(ctx interface{}, searchReq interface{}) *MockSegment_Search_Call

Search is a helper method to define mock.On call

  • ctx context.Context
  • searchReq *segcore.SearchRequest

func (*MockSegment_Expecter) SetPKCandidate

func (_e *MockSegment_Expecter) SetPKCandidate(candidate interface{}) *MockSegment_SetPKCandidate_Call

SetPKCandidate is a helper method to define mock.On call

  • candidate pkoracle.Candidate

func (*MockSegment_Expecter) Shard

Shard is a helper method to define mock.On call

func (*MockSegment_Expecter) StartPosition

StartPosition is a helper method to define mock.On call

func (*MockSegment_Expecter) Stats

Stats is a helper method to define mock.On call

func (*MockSegment_Expecter) Type

Type is a helper method to define mock.On call

func (*MockSegment_Expecter) Unpin

Unpin is a helper method to define mock.On call

func (*MockSegment_Expecter) UpdateBM25Stats

func (_e *MockSegment_Expecter) UpdateBM25Stats(stats interface{}) *MockSegment_UpdateBM25Stats_Call

UpdateBM25Stats is a helper method to define mock.On call

  • stats map[int64]*storage.BM25Stats

func (*MockSegment_Expecter) UpdatePkCandidate

func (_e *MockSegment_Expecter) UpdatePkCandidate(pks interface{}) *MockSegment_UpdatePkCandidate_Call

UpdatePkCandidate is a helper method to define mock.On call

  • pks []storage.PrimaryKey

func (*MockSegment_Expecter) Version

Version is a helper method to define mock.On call

type MockSegment_FlushData_Call

type MockSegment_FlushData_Call struct {
	*mock.Call
}

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

func (*MockSegment_FlushData_Call) Return

func (*MockSegment_FlushData_Call) Run

func (_c *MockSegment_FlushData_Call) Run(run func(ctx context.Context, startOffset int64, endOffset int64, config *FlushConfig)) *MockSegment_FlushData_Call

func (*MockSegment_FlushData_Call) RunAndReturn

type MockSegment_GetBM25Stats_Call

type MockSegment_GetBM25Stats_Call struct {
	*mock.Call
}

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

func (*MockSegment_GetBM25Stats_Call) Return

func (*MockSegment_GetBM25Stats_Call) Run

func (*MockSegment_GetBM25Stats_Call) RunAndReturn

type MockSegment_GetFieldJSONIndexStats_Call

type MockSegment_GetFieldJSONIndexStats_Call struct {
	*mock.Call
}

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

func (*MockSegment_GetFieldJSONIndexStats_Call) Return

func (*MockSegment_GetFieldJSONIndexStats_Call) Run

func (*MockSegment_GetFieldJSONIndexStats_Call) RunAndReturn

type MockSegment_GetIndexByID_Call

type MockSegment_GetIndexByID_Call struct {
	*mock.Call
}

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

func (*MockSegment_GetIndexByID_Call) Return

func (*MockSegment_GetIndexByID_Call) Run

func (*MockSegment_GetIndexByID_Call) RunAndReturn

type MockSegment_GetIndex_Call

type MockSegment_GetIndex_Call struct {
	*mock.Call
}

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

func (*MockSegment_GetIndex_Call) Return

func (*MockSegment_GetIndex_Call) Run

func (_c *MockSegment_GetIndex_Call) Run(run func(fieldID int64)) *MockSegment_GetIndex_Call

func (*MockSegment_GetIndex_Call) RunAndReturn

type MockSegment_GetMaxPk_Call

type MockSegment_GetMaxPk_Call struct {
	*mock.Call
}

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

func (*MockSegment_GetMaxPk_Call) Return

func (*MockSegment_GetMaxPk_Call) Run

func (*MockSegment_GetMaxPk_Call) RunAndReturn

type MockSegment_GetMinPk_Call

type MockSegment_GetMinPk_Call struct {
	*mock.Call
}

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

func (*MockSegment_GetMinPk_Call) Return

func (*MockSegment_GetMinPk_Call) Run

func (*MockSegment_GetMinPk_Call) RunAndReturn

type MockSegment_HasRawData_Call

type MockSegment_HasRawData_Call struct {
	*mock.Call
}

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

func (*MockSegment_HasRawData_Call) Return

func (*MockSegment_HasRawData_Call) Run

func (*MockSegment_HasRawData_Call) RunAndReturn

type MockSegment_ID_Call

type MockSegment_ID_Call struct {
	*mock.Call
}

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

func (*MockSegment_ID_Call) Return

func (*MockSegment_ID_Call) Run

func (_c *MockSegment_ID_Call) Run(run func()) *MockSegment_ID_Call

func (*MockSegment_ID_Call) RunAndReturn

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

type MockSegment_Indexes_Call

type MockSegment_Indexes_Call struct {
	*mock.Call
}

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

func (*MockSegment_Indexes_Call) Return

func (*MockSegment_Indexes_Call) Run

func (*MockSegment_Indexes_Call) RunAndReturn

func (_c *MockSegment_Indexes_Call) RunAndReturn(run func() []*IndexedFieldInfo) *MockSegment_Indexes_Call

type MockSegment_InsertCount_Call

type MockSegment_InsertCount_Call struct {
	*mock.Call
}

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

func (*MockSegment_InsertCount_Call) Return

func (*MockSegment_InsertCount_Call) Run

func (*MockSegment_InsertCount_Call) RunAndReturn

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

type MockSegment_Insert_Call

type MockSegment_Insert_Call struct {
	*mock.Call
}

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

func (*MockSegment_Insert_Call) Return

func (*MockSegment_Insert_Call) Run

func (_c *MockSegment_Insert_Call) Run(run func(ctx context.Context, rowIDs []int64, timestamps []uint64, record *segcorepb.InsertRecord)) *MockSegment_Insert_Call

func (*MockSegment_Insert_Call) RunAndReturn

type MockSegment_IsLazyLoad_Call

type MockSegment_IsLazyLoad_Call struct {
	*mock.Call
}

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

func (*MockSegment_IsLazyLoad_Call) Return

func (*MockSegment_IsLazyLoad_Call) Run

func (*MockSegment_IsLazyLoad_Call) RunAndReturn

func (_c *MockSegment_IsLazyLoad_Call) RunAndReturn(run func() bool) *MockSegment_IsLazyLoad_Call

type MockSegment_IsSorted_Call

type MockSegment_IsSorted_Call struct {
	*mock.Call
}

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

func (*MockSegment_IsSorted_Call) Return

func (*MockSegment_IsSorted_Call) Run

func (*MockSegment_IsSorted_Call) RunAndReturn

func (_c *MockSegment_IsSorted_Call) RunAndReturn(run func() bool) *MockSegment_IsSorted_Call

type MockSegment_LastDeltaTimestamp_Call

type MockSegment_LastDeltaTimestamp_Call struct {
	*mock.Call
}

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

func (*MockSegment_LastDeltaTimestamp_Call) Return

func (*MockSegment_LastDeltaTimestamp_Call) Run

func (*MockSegment_LastDeltaTimestamp_Call) RunAndReturn

type MockSegment_Level_Call

type MockSegment_Level_Call struct {
	*mock.Call
}

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

func (*MockSegment_Level_Call) Return

func (*MockSegment_Level_Call) Run

func (_c *MockSegment_Level_Call) Run(run func()) *MockSegment_Level_Call

func (*MockSegment_Level_Call) RunAndReturn

func (_c *MockSegment_Level_Call) RunAndReturn(run func() datapb.SegmentLevel) *MockSegment_Level_Call

type MockSegment_LoadDeltaData_Call

type MockSegment_LoadDeltaData_Call struct {
	*mock.Call
}

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

func (*MockSegment_LoadDeltaData_Call) Return

func (*MockSegment_LoadDeltaData_Call) Run

func (*MockSegment_LoadDeltaData_Call) RunAndReturn

type MockSegment_LoadInfo_Call

type MockSegment_LoadInfo_Call struct {
	*mock.Call
}

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

func (*MockSegment_LoadInfo_Call) Return

func (*MockSegment_LoadInfo_Call) Run

func (*MockSegment_LoadInfo_Call) RunAndReturn

type MockSegment_Load_Call

type MockSegment_Load_Call struct {
	*mock.Call
}

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

func (*MockSegment_Load_Call) Return

func (*MockSegment_Load_Call) Run

func (*MockSegment_Load_Call) RunAndReturn

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

type MockSegment_MayPkExist_Call

type MockSegment_MayPkExist_Call struct {
	*mock.Call
}

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

func (*MockSegment_MayPkExist_Call) Return

func (*MockSegment_MayPkExist_Call) Run

func (*MockSegment_MayPkExist_Call) RunAndReturn

type MockSegment_MemSize_Call

type MockSegment_MemSize_Call struct {
	*mock.Call
}

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

func (*MockSegment_MemSize_Call) Return

func (*MockSegment_MemSize_Call) Run

func (*MockSegment_MemSize_Call) RunAndReturn

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

type MockSegment_NeedUpdatedVersion_Call

type MockSegment_NeedUpdatedVersion_Call struct {
	*mock.Call
}

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

func (*MockSegment_NeedUpdatedVersion_Call) Return

func (*MockSegment_NeedUpdatedVersion_Call) Run

func (*MockSegment_NeedUpdatedVersion_Call) RunAndReturn

type MockSegment_Partition_Call

type MockSegment_Partition_Call struct {
	*mock.Call
}

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

func (*MockSegment_Partition_Call) Return

func (*MockSegment_Partition_Call) Run

func (*MockSegment_Partition_Call) RunAndReturn

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

type MockSegment_PinIfNotReleased_Call

type MockSegment_PinIfNotReleased_Call struct {
	*mock.Call
}

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

func (*MockSegment_PinIfNotReleased_Call) Return

func (*MockSegment_PinIfNotReleased_Call) Run

func (*MockSegment_PinIfNotReleased_Call) RunAndReturn

type MockSegment_PkCandidateExist_Call

type MockSegment_PkCandidateExist_Call struct {
	*mock.Call
}

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

func (*MockSegment_PkCandidateExist_Call) Return

func (*MockSegment_PkCandidateExist_Call) Run

func (*MockSegment_PkCandidateExist_Call) RunAndReturn

type MockSegment_Refund_Call

type MockSegment_Refund_Call struct {
	*mock.Call
}

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

func (*MockSegment_Refund_Call) Return

func (*MockSegment_Refund_Call) Run

func (_c *MockSegment_Refund_Call) Run(run func()) *MockSegment_Refund_Call

func (*MockSegment_Refund_Call) RunAndReturn

func (_c *MockSegment_Refund_Call) RunAndReturn(run func()) *MockSegment_Refund_Call

type MockSegment_Release_Call

type MockSegment_Release_Call struct {
	*mock.Call
}

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

func (*MockSegment_Release_Call) Return

func (*MockSegment_Release_Call) Run

func (_c *MockSegment_Release_Call) Run(run func(ctx context.Context, opts ...releaseOption)) *MockSegment_Release_Call

func (*MockSegment_Release_Call) RunAndReturn

func (_c *MockSegment_Release_Call) RunAndReturn(run func(context.Context, ...releaseOption)) *MockSegment_Release_Call

type MockSegment_RemoveUnusedFieldFiles_Call

type MockSegment_RemoveUnusedFieldFiles_Call struct {
	*mock.Call
}

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

func (*MockSegment_RemoveUnusedFieldFiles_Call) Return

func (*MockSegment_RemoveUnusedFieldFiles_Call) Run

func (*MockSegment_RemoveUnusedFieldFiles_Call) RunAndReturn

type MockSegment_Reopen_Call

type MockSegment_Reopen_Call struct {
	*mock.Call
}

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

func (*MockSegment_Reopen_Call) Return

func (*MockSegment_Reopen_Call) Run

func (*MockSegment_Reopen_Call) RunAndReturn

type MockSegment_ResetIndexesLazyLoad_Call

type MockSegment_ResetIndexesLazyLoad_Call struct {
	*mock.Call
}

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

func (*MockSegment_ResetIndexesLazyLoad_Call) Return

func (*MockSegment_ResetIndexesLazyLoad_Call) Run

func (*MockSegment_ResetIndexesLazyLoad_Call) RunAndReturn

type MockSegment_ResourceGroup_Call

type MockSegment_ResourceGroup_Call struct {
	*mock.Call
}

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

func (*MockSegment_ResourceGroup_Call) Return

func (*MockSegment_ResourceGroup_Call) Run

func (*MockSegment_ResourceGroup_Call) RunAndReturn

type MockSegment_ResourceUsageEstimate_Call

type MockSegment_ResourceUsageEstimate_Call struct {
	*mock.Call
}

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

func (*MockSegment_ResourceUsageEstimate_Call) Return

func (*MockSegment_ResourceUsageEstimate_Call) Run

func (*MockSegment_ResourceUsageEstimate_Call) RunAndReturn

type MockSegment_RetrieveByOffsets_Call

type MockSegment_RetrieveByOffsets_Call struct {
	*mock.Call
}

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

func (*MockSegment_RetrieveByOffsets_Call) Return

func (*MockSegment_RetrieveByOffsets_Call) Run

type MockSegment_Retrieve_Call

type MockSegment_Retrieve_Call struct {
	*mock.Call
}

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

func (*MockSegment_Retrieve_Call) Return

func (*MockSegment_Retrieve_Call) Run

func (*MockSegment_Retrieve_Call) RunAndReturn

type MockSegment_RowNum_Call

type MockSegment_RowNum_Call struct {
	*mock.Call
}

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

func (*MockSegment_RowNum_Call) Return

func (*MockSegment_RowNum_Call) Run

func (_c *MockSegment_RowNum_Call) Run(run func()) *MockSegment_RowNum_Call

func (*MockSegment_RowNum_Call) RunAndReturn

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

type MockSegment_Search_Call

type MockSegment_Search_Call struct {
	*mock.Call
}

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

func (*MockSegment_Search_Call) Return

func (*MockSegment_Search_Call) Run

func (*MockSegment_Search_Call) RunAndReturn

type MockSegment_SetPKCandidate_Call

type MockSegment_SetPKCandidate_Call struct {
	*mock.Call
}

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

func (*MockSegment_SetPKCandidate_Call) Return

func (*MockSegment_SetPKCandidate_Call) Run

func (*MockSegment_SetPKCandidate_Call) RunAndReturn

type MockSegment_Shard_Call

type MockSegment_Shard_Call struct {
	*mock.Call
}

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

func (*MockSegment_Shard_Call) Return

func (*MockSegment_Shard_Call) Run

func (_c *MockSegment_Shard_Call) Run(run func()) *MockSegment_Shard_Call

func (*MockSegment_Shard_Call) RunAndReturn

func (_c *MockSegment_Shard_Call) RunAndReturn(run func() metautil.Channel) *MockSegment_Shard_Call

type MockSegment_StartPosition_Call

type MockSegment_StartPosition_Call struct {
	*mock.Call
}

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

func (*MockSegment_StartPosition_Call) Return

func (*MockSegment_StartPosition_Call) Run

func (*MockSegment_StartPosition_Call) RunAndReturn

type MockSegment_Stats_Call

type MockSegment_Stats_Call struct {
	*mock.Call
}

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

func (*MockSegment_Stats_Call) Return

func (*MockSegment_Stats_Call) Run

func (_c *MockSegment_Stats_Call) Run(run func()) *MockSegment_Stats_Call

func (*MockSegment_Stats_Call) RunAndReturn

func (_c *MockSegment_Stats_Call) RunAndReturn(run func() *storage.PkStatistics) *MockSegment_Stats_Call

type MockSegment_Type_Call

type MockSegment_Type_Call struct {
	*mock.Call
}

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

func (*MockSegment_Type_Call) Return

func (*MockSegment_Type_Call) Run

func (_c *MockSegment_Type_Call) Run(run func()) *MockSegment_Type_Call

func (*MockSegment_Type_Call) RunAndReturn

func (_c *MockSegment_Type_Call) RunAndReturn(run func() commonpb.SegmentState) *MockSegment_Type_Call

type MockSegment_Unpin_Call

type MockSegment_Unpin_Call struct {
	*mock.Call
}

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

func (*MockSegment_Unpin_Call) Return

func (*MockSegment_Unpin_Call) Run

func (_c *MockSegment_Unpin_Call) Run(run func()) *MockSegment_Unpin_Call

func (*MockSegment_Unpin_Call) RunAndReturn

func (_c *MockSegment_Unpin_Call) RunAndReturn(run func()) *MockSegment_Unpin_Call

type MockSegment_UpdateBM25Stats_Call

type MockSegment_UpdateBM25Stats_Call struct {
	*mock.Call
}

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

func (*MockSegment_UpdateBM25Stats_Call) Return

func (*MockSegment_UpdateBM25Stats_Call) Run

func (*MockSegment_UpdateBM25Stats_Call) RunAndReturn

type MockSegment_UpdatePkCandidate_Call

type MockSegment_UpdatePkCandidate_Call struct {
	*mock.Call
}

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

func (*MockSegment_UpdatePkCandidate_Call) Return

func (*MockSegment_UpdatePkCandidate_Call) Run

func (*MockSegment_UpdatePkCandidate_Call) RunAndReturn

type MockSegment_Version_Call

type MockSegment_Version_Call struct {
	*mock.Call
}

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

func (*MockSegment_Version_Call) Return

func (*MockSegment_Version_Call) Run

func (*MockSegment_Version_Call) RunAndReturn

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

type OffsetSelection

type OffsetSelection struct {
	SegmentIndex   int                       // index into validSegments array
	Offset         int64                     // segcore offset for RetrieveByOffsets
	ElementIndices *segcorepb.ElementIndices // element indices for element-level query (nil for doc-level)
}

OffsetSelection tracks a row's origin segment and offset for later retrieval.

type ReleaseScope

type ReleaseScope int
const (
	ReleaseScopeAll ReleaseScope = iota
	ReleaseScopeData
)

type ResourceEstimate

type ResourceEstimate struct {
	MaxMemoryCost   uint64
	MaxDiskCost     uint64
	FinalMemoryCost uint64
	FinalDiskCost   uint64
	HasRawData      bool
}

func GetResourceEstimate

func GetResourceEstimate(estimate *C.LoadResourceRequest) ResourceEstimate

type ResourceUsage

type ResourceUsage struct {
	MemorySize         uint64
	DiskSize           uint64
	MmapFieldCount     int
	FieldGpuMemorySize []uint64
}

ResourceUsage is used to estimate the resource usage of a sealed segment.

type RetrievePlan

type RetrievePlan = segcore.RetrievePlan

type RetrieveSegmentResult

type RetrieveSegmentResult struct {
	Result  *segcorepb.RetrieveResults
	Segment Segment
}

type SearchCommonReduce

type SearchCommonReduce struct{}

func (*SearchCommonReduce) ReduceSearchResultData

func (scr *SearchCommonReduce) ReduceSearchResultData(ctx context.Context, searchResultData []*schemapb.SearchResultData, info *reduce.ResultInfo) (*schemapb.SearchResultData, error)

type SearchGroupByReduce

type SearchGroupByReduce struct{}

func (*SearchGroupByReduce) ReduceSearchResultData

func (sbr *SearchGroupByReduce) ReduceSearchResultData(ctx context.Context, searchResultData []*schemapb.SearchResultData, info *reduce.ResultInfo) (*schemapb.SearchResultData, error)

type SearchPlan

type SearchPlan = segcore.SearchPlan

type SearchReduce

type SearchReduce interface {
	ReduceSearchResultData(ctx context.Context, searchResultData []*schemapb.SearchResultData, info *reduce.ResultInfo) (*schemapb.SearchResultData, error)
}

func InitSearchReducer

func InitSearchReducer(info *reduce.ResultInfo) SearchReduce

type SearchRequest

type SearchRequest = segcore.SearchRequest

type SearchResult

type SearchResult = segcore.SearchResult

type Segment

type Segment interface {

	// Properties
	ID() int64
	DatabaseName() string
	ResourceGroup() string
	Collection() int64
	Partition() int64
	Shard() metautil.Channel
	Version() int64
	CASVersion(int64, int64) bool
	StartPosition() *msgpb.MsgPosition
	Type() SegmentType
	Level() datapb.SegmentLevel
	IsSorted() bool
	LoadInfo() *querypb.SegmentLoadInfo
	// PinIfNotReleased the segment to prevent it from being released
	PinIfNotReleased() error
	// Unpin the segment to allow it to be released
	Unpin()

	// Stats related
	// InsertCount returns the number of inserted rows, not effected by deletion
	InsertCount() int64
	// RowNum returns the number of rows, it's slow, so DO NOT call it in a loop
	RowNum() int64
	MemSize() int64
	// ResourceUsageEstimate returns the estimated resource usage of the segment
	ResourceUsageEstimate() ResourceUsage

	// Index related
	GetIndexByID(indexID int64) *IndexedFieldInfo
	GetIndex(fieldID int64) []*IndexedFieldInfo
	ExistIndex(fieldID int64) bool
	Indexes() []*IndexedFieldInfo
	HasRawData(fieldID int64) bool
	DropIndex(ctx context.Context, indexID int64) error

	// Modification related
	Insert(ctx context.Context, rowIDs []int64, timestamps []typeutil.Timestamp, record *segcorepb.InsertRecord) error
	Delete(ctx context.Context, primaryKeys storage.PrimaryKeys, timestamps []typeutil.Timestamp) error
	LoadDeltaData(ctx context.Context, deltaData *storage.DeltaData) error
	LastDeltaTimestamp() uint64
	Load(ctx context.Context) error
	Release(ctx context.Context, opts ...releaseOption)
	Reopen(ctx context.Context, newLoadInfo *querypb.SegmentLoadInfo) error

	// PK candidate related (BloomFilterSet for regular segments, ExternalSegmentCandidate for external)
	// Segment implements pkoracle.Candidate: MayPkExist, BatchPkExist, ID, Partition, Type,
	// PkCandidateExist, UpdatePkCandidate, Stats, Charge, Refund — with protective guards (e.g. skipGrowingBF).
	SetPKCandidate(candidate pkoracle.Candidate)
	PkCandidateExist() bool
	UpdatePkCandidate(pks []storage.PrimaryKey)
	Stats() *storage.PkStatistics
	Charge()
	Refund()
	MayPkExist(lc *storage.LocationsCache) bool
	BatchPkExist(lc *storage.BatchLocationsCache) []bool

	// Get min/max
	GetMinPk() *storage.PrimaryKey
	GetMaxPk() *storage.PrimaryKey

	// BM25 stats
	UpdateBM25Stats(stats map[int64]*storage.BM25Stats)
	GetBM25Stats() map[int64]*storage.BM25Stats

	// Read operations
	// Search executes a search on the segment.
	// If searchReq.FilterOnly() is true, only executes the filter and returns valid_count (Stage 1 of two-stage search).
	Search(ctx context.Context, searchReq *segcore.SearchRequest) (*segcore.SearchResult, error)
	Retrieve(ctx context.Context, plan *segcore.RetrievePlan) (*segcorepb.RetrieveResults, error)
	RetrieveByOffsets(ctx context.Context, plan *segcore.RetrievePlanWithOffsets) (*segcorepb.RetrieveResults, error)

	// FlushData flushes data from segment memory directly to storage via C++ milvus-storage.
	// This is a unified interface that combines data extraction and writing:
	//   - C++ side extracts data directly from ConcurrentVector (no query engine overhead)
	//   - C++ side writes data to storage (TEXT fields via TextColumnWriter, others via PackedWriter)
	//   - Returns binlog paths and metadata (all processing in C++ side)
	// Go layer only provides thin wrapper for FFI call - no business logic.
	// TODO: Implement C++ FlushData interface (Phase 1.3, 1.4, 2.3)
	FlushData(ctx context.Context, startOffset, endOffset int64, config *FlushConfig) (*FlushResult, error)
	IsLazyLoad() bool
	ResetIndexesLazyLoad(lazyState bool)

	// lazy load related
	NeedUpdatedVersion() int64
	RemoveUnusedFieldFiles() error

	GetFieldJSONIndexStats() map[int64]*querypb.JsonStatsInfo
}

Segment is the interface of a segment implementation. Some methods can not apply to all segment types,such as LoadInfo, ResourceUsageEstimate. Add more interface to represent different segment types is a better implementation.

func NewL0Segment

func NewL0Segment(collection *Collection,
	segmentType SegmentType,
	version int64,
	loadInfo *querypb.SegmentLoadInfo,
) (Segment, error)

func NewSegment

func NewSegment(ctx context.Context,
	collection *Collection,
	manager SegmentManager,
	segmentType SegmentType,
	version int64,
	loadInfo *querypb.SegmentLoadInfo,
) (Segment, error)

func RetrieveStream

func RetrieveStream(ctx context.Context, manager *Manager, plan *RetrievePlan, req *querypb.QueryRequest, srv streamrpc.QueryStreamServer) ([]Segment, error)

retrieveStreaming will retrieve all the validate target segments and return by stream

type SegmentAction

type SegmentAction func(segment Segment) bool

func IncreaseVersion

func IncreaseVersion(version int64) SegmentAction

type SegmentFilter

type SegmentFilter interface {
	Match(segment Segment) bool
	AddFilter(*segmentCriterion)
}

SegmentFilter is the interface for segment selection criteria.

func WithChannel

func WithChannel(channel string) SegmentFilter

func WithID

func WithID(id int64) SegmentFilter

func WithIDs

func WithIDs(ids ...int64) SegmentFilter

func WithLevel

func WithLevel(level datapb.SegmentLevel) SegmentFilter

func WithPartition

func WithPartition(partitionID typeutil.UniqueID) SegmentFilter

func WithSkipEmpty

func WithSkipEmpty() SegmentFilter

func WithType

func WithType(typ SegmentType) SegmentFilter

func WithoutLevel

func WithoutLevel(level datapb.SegmentLevel) SegmentFilter

WithoutLevel is the segment filter for without segment level.

type SegmentFilterFunc

type SegmentFilterFunc func(segment Segment) bool

SegmentFilterFunc is a type wrapper for `func(Segment) bool` to SegmentFilter.

func (SegmentFilterFunc) AddFilter

func (f SegmentFilterFunc) AddFilter(c *segmentCriterion)

func (SegmentFilterFunc) Match

func (f SegmentFilterFunc) Match(segment Segment) bool

type SegmentIDFilter

type SegmentIDFilter int64

SegmentIDFilter is the specific segment filter for SegmentID only.

func (SegmentIDFilter) AddFilter

func (f SegmentIDFilter) AddFilter(c *segmentCriterion)

func (SegmentIDFilter) Match

func (f SegmentIDFilter) Match(segment Segment) bool

type SegmentIDsFilter

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

func (SegmentIDsFilter) AddFilter

func (f SegmentIDsFilter) AddFilter(c *segmentCriterion)

func (SegmentIDsFilter) Match

func (f SegmentIDsFilter) Match(segment Segment) bool

type SegmentManager

type SegmentManager interface {
	// Put puts the given segments in,
	// and increases the ref count of the corresponding collection,
	// dup segments will not increase the ref count
	Put(ctx context.Context, segmentType SegmentType, segments ...Segment)
	UpdateBy(action SegmentAction, filters ...SegmentFilter) int
	Get(segmentID typeutil.UniqueID) Segment
	GetWithType(segmentID typeutil.UniqueID, typ SegmentType) Segment
	GetBy(filters ...SegmentFilter) []Segment
	// Get segments and acquire the read locks
	GetAndPinBy(filters ...SegmentFilter) ([]Segment, error)
	GetAndPin(segments []int64, filters ...SegmentFilter) ([]Segment, error)
	Unpin(segments []Segment)

	GetSealed(segmentID typeutil.UniqueID) Segment
	GetGrowing(segmentID typeutil.UniqueID) Segment
	Empty() bool

	// Remove removes the given segment,
	// and decreases the ref count of the corresponding collection,
	// will not decrease the ref count if the given segment not exists
	Remove(ctx context.Context, segmentID typeutil.UniqueID, scope querypb.DataScope) (int, int)
	RemoveBy(ctx context.Context, filters ...SegmentFilter) (int, int)
	Clear(ctx context.Context)

	// Deprecated: quick fix critical issue: #30857
	// TODO: All Segment assigned to querynode should be managed by SegmentManager, including loading or releasing to perform a transaction.
	Exist(segmentID typeutil.UniqueID, typ SegmentType) bool

	AddLogicalResource(usage ResourceUsage)
	SubLogicalResource(usage ResourceUsage)
	GetLogicalResource() ResourceUsage

	AddLoadedBinlogSize(size int64)
	SubLoadedBinlogSize(size int64)
	GetLoadedBinlogSize() int64
}

type SegmentStats

type SegmentStats struct {
	SegmentID int64
	RowCount  int64
}

SegmentStats struct for segment statistics.

type SegmentType

type SegmentType = commonpb.SegmentState

type SegmentTypeFilter

type SegmentTypeFilter SegmentType

func (SegmentTypeFilter) AddFilter

func (f SegmentTypeFilter) AddFilter(c *segmentCriterion)

func (SegmentTypeFilter) Match

func (f SegmentTypeFilter) Match(segment Segment) bool

type TimestampedRetrieveResult

type TimestampedRetrieveResult[T interface {
	typeutil.ResultWithID
	GetFieldsData() []*schemapb.FieldData
}] struct {
	Result     T
	Timestamps []int64
}

func NewTimestampedRetrieveResult

func NewTimestampedRetrieveResult[T interface {
	typeutil.ResultWithID
	GetFieldsData() []*schemapb.FieldData
}](result T) (*TimestampedRetrieveResult[T], error)

func (*TimestampedRetrieveResult[T]) GetHasMoreResult

func (r *TimestampedRetrieveResult[T]) GetHasMoreResult() bool

func (*TimestampedRetrieveResult[T]) GetIds

func (r *TimestampedRetrieveResult[T]) GetIds() *schemapb.IDs

func (*TimestampedRetrieveResult[T]) GetTimestamps

func (r *TimestampedRetrieveResult[T]) GetTimestamps() []int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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