db

package
v0.0.62 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("db: key not found")

Functions

func Timestamps

func Timestamps(r arrow.Record) (lo, hi int64)

Types

type KV

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

func NewKV

func NewKV(path string) (*KV, error)

func (*KV) Close

func (kv *KV) Close() error

func (*KV) GC

func (kv *KV) GC() error

func (*KV) Get

func (kv *KV) Get(key []byte, value func([]byte) error) error

func (*KV) Set

func (kv *KV) Set(key, value []byte, ttl time.Duration) error

type PrefixStore

type PrefixStore struct {
	Storage
	// contains filtered or unexported fields
}

func (*PrefixStore) Get

func (p *PrefixStore) Get(key []byte, value func([]byte) error) error

func (*PrefixStore) Set

func (p *PrefixStore) Set(key, value []byte, ttl time.Duration) error

type Scanner

type Scanner interface {
	Scan(
		ctx context.Context,
		start, end int64,
		fs *v1.Filters,
	) (arrow.Record, error)
}

type Storage

type Storage interface {
	Set(key, value []byte, ttl time.Duration) error
	Get(key []byte, value func([]byte) error) error
	GC() error
	Close() error
}

func NewPrefix

func NewPrefix(store Storage, prefix string) Storage

type Store

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

func NewStore

func NewStore(db Storage, mem memory.Allocator, resource string, ttl time.Duration) *Store

func (*Store) Save

func (s *Store) Save(r arrow.Record, idx index.Full) (*v1.Granule, error)

func (*Store) SaveRecord

func (s *Store) SaveRecord(buf *buffers.BytesBuffer, base []byte, r arrow.Record) (n uint64, err error)

Jump to

Keyboard shortcuts

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