scanner

package
v0.0.0-...-f584327 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// CompactKey is internal key to store the compact state
	CompactKey []byte

	// Tombstone is the value bytes used to mark delete
	Tombstone []byte

	// TTL is the time that key written with ttl will live
	TTL time.Duration
}

Config is the configuration of scanner

type Scanner

type Scanner interface {

	// Range run scan in partitions concurrently
	Range(ctx context.Context, start []byte, end []byte, revision uint64, limit int64) ([]*proto.KeyValue, error)

	// RangeStream run scan in partitions concurrently and returns value by stream
	RangeStream(ctx context.Context, start []byte, end []byte, revision uint64) chan *proto.StreamRangeResponse

	// Count run scan in partitions concurrently and returns the count of user key
	Count(ctx context.Context, start []byte, end []byte, revision uint64) (int, error)

	// Compact will gc the kvs which are too old
	Compact(ctx context.Context, start []byte, end []byte, revision uint64)
}

Scanner is used to control concurrent range in partitions for list or compact

func NewScanner

func NewScanner(store storage.KvStorage, coder coder.Coder, config Config, metricCli metrics.Metrics) Scanner

NewScanner create a Scanner

Jump to

Keyboard shortcuts

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