refmap

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBucketPageSize = 65536
View Source
const MinBucketPageSize = 16
View Source
const MinKeyBucketBatchSize = 8 // min batch size for multi-batch buckets (except the last batch)

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketResolveFunc

type BucketResolveFunc func(uint32) (*reference.Local, BucketState)

type BucketSortFunc

type BucketSortFunc func(i, j *reference.Local) bool

type BucketState

type BucketState uint32

type BucketValueSelector

type BucketValueSelector struct {
	ValueSelector
	State BucketState
}

type KeyIndexGetterFunc

type KeyIndexGetterFunc func(index int) *bucketKey

type ReadOnlyMapToInt63

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

implements READ-ONLY map[Holder]uint63 with external lazy load & memory-mapping support

func NewReadOnlyMapToInt63

func NewReadOnlyMapToInt63(expectedKeyCount int, bucketCount int) ReadOnlyMapToInt63

func (*ReadOnlyMapToInt63) GetHashSeed

func (p *ReadOnlyMapToInt63) GetHashSeed() uint32

func (*ReadOnlyMapToInt63) GetLocator

func (p *ReadOnlyMapToInt63) GetLocator(bucketIndex int) int64

func (*ReadOnlyMapToInt63) GetValueOrBucket

func (p *ReadOnlyMapToInt63) GetValueOrBucket(ref reference.PtrHolder) (int64, bool)

result = ( N, true ) - item was found, N = map[ref], N = [0..maxInt64] result = ( <0, false ) - item was not found result = ( B>=0, false) - item presence is unknown, bucket is missing, B is bucket number

func (*ReadOnlyMapToInt63) LoadBucket

func (p *ReadOnlyMapToInt63) LoadBucket(bucketIndex, bucketKeyL0Count, bucketKeyL1Count int, chunks []longbits.ByteString) error

func (*ReadOnlyMapToInt63) SetBigBucketMinSize

func (p *ReadOnlyMapToInt63) SetBigBucketMinSize(bigBucketSize int)

func (*ReadOnlyMapToInt63) SetHashSeed

func (p *ReadOnlyMapToInt63) SetHashSeed(hashSeed uint32)

func (*ReadOnlyMapToInt63) SetLocator

func (p *ReadOnlyMapToInt63) SetLocator(bucketIndex int, locator int64)

func (*ReadOnlyMapToInt63) SetSortedBuckets

func (p *ReadOnlyMapToInt63) SetSortedBuckets(sortedBuckets bool)

type RefLocatorMap

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

func NewRefLocatorMap

func NewRefLocatorMap() RefLocatorMap

func (*RefLocatorMap) Contains

func (m *RefLocatorMap) Contains(ref reference.PtrHolder) bool

func (*RefLocatorMap) Delete

func (m *RefLocatorMap) Delete(ref reference.PtrHolder)

func (*RefLocatorMap) FillLocatorBuckets

func (m *RefLocatorMap) FillLocatorBuckets(config WriteBucketerConfig) WriteBucketer

func (*RefLocatorMap) Get

func (*RefLocatorMap) Intern

func (*RefLocatorMap) Len

func (m *RefLocatorMap) Len() int

func (*RefLocatorMap) Put

func (m *RefLocatorMap) Put(ref reference.PtrHolder, v ValueLocator) (internedRef reference.Holder)

type UpdateableKeyMap

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

func NewUpdateableKeyMap

func NewUpdateableKeyMap() UpdateableKeyMap

func NewUpdateableKeyMapExt

func NewUpdateableKeyMapExt(pageSize int) UpdateableKeyMap

func (*UpdateableKeyMap) Find

func (*UpdateableKeyMap) GetHashSeed

func (m *UpdateableKeyMap) GetHashSeed() uint32

func (*UpdateableKeyMap) GetInterned

func (m *UpdateableKeyMap) GetInterned(bucketIndex uint32) (*reference.Local, BucketState)

func (*UpdateableKeyMap) Intern

func (m *UpdateableKeyMap) Intern(ref *reference.Local) *reference.Local

func (*UpdateableKeyMap) InternHolder

func (m *UpdateableKeyMap) InternHolder(ref reference.PtrHolder) reference.Holder

func (*UpdateableKeyMap) InternedKeyCount

func (m *UpdateableKeyMap) InternedKeyCount() int

func (*UpdateableKeyMap) SetHashSeed

func (m *UpdateableKeyMap) SetHashSeed(hashSeed uint32)

func (*UpdateableKeyMap) TryPut

func (m *UpdateableKeyMap) TryPut(key reference.PtrHolder,
	valueFn func(internedKey reference.Holder, selector BucketValueSelector) BucketState,
) bool

func (*UpdateableKeyMap) TryTouch

func (m *UpdateableKeyMap) TryTouch(key reference.PtrHolder,
	valueFn func(selector BucketValueSelector) BucketState,
) bool

type ValueLocator

type ValueLocator int64

type ValueSelector

type ValueSelector struct {
	LocalId uint32 // BucketId
	BaseId  uint32
}

type ValueSelectorLocator

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

type WriteBucketer

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

func NewWriteBucketer

func NewWriteBucketer(keyMap *UpdateableKeyMap, valueCount int, config WriteBucketerConfig) WriteBucketer

func (*WriteBucketer) AddValue

func (p *WriteBucketer) AddValue(selector ValueSelector, locator ValueLocator)

func (*WriteBucketer) AdjustedBucketSize

func (p *WriteBucketer) AdjustedBucketSize() int

func (*WriteBucketer) BucketCount

func (p *WriteBucketer) BucketCount() int

func (*WriteBucketer) GetBucketed

func (p *WriteBucketer) GetBucketed(bucketNo int) []ValueSelectorLocator

type WriteBucketerConfig

type WriteBucketerConfig struct {
	ExpectedPerBucket int
	UsePrimes         bool
}

Jump to

Keyboard shortcuts

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