ads

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KeptEntriesToActiveEntriesRatio = 2

	BucketCount = 64
	JobChanSize = 256

	MinDeactiveEntries = 100 //minimum deactived entry count in each round of compaction
	MinKeptTwigs       = 10  //minimum kept twig count in each shard
)
View Source
const (
	DefaultHPFileSize  int   = 1024 * 1024 * 1024
	StartReapThres     int64 = 1000 * 1000
	HPFileBufferSize   int   = datatree.BufferSize
	RootCacheSizeLimit int   = 1024 * 1024
)

Variables

View Source
var DebugPanicNumber int //not used
View Source
var NewOverOldFile *os.File = nil
View Source
var Phase1n2Time, Phase1Time, Phase2Time, Phase3Time, Phase4Time, Phase0Time uint64

Functions

This section is empty.

Types

type ADS

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

func NewADS

func NewADS(dirName string, canQueryHistory bool, startEndKeys [][]byte) (*ADS, error)

func NewADS4Mock

func NewADS4Mock(startEndKeys [][]byte) *ADS

func (*ADS) ActiveCount

func (mads *ADS) ActiveCount() int

func (*ADS) BeginWrite

func (mads *ADS) BeginWrite(height int64)

func (*ADS) CheckConsistency

func (mads *ADS) CheckConsistency()

func (*ADS) CheckHashConsistency

func (mads *ADS) CheckHashConsistency()

func (*ADS) Close

func (mads *ADS) Close()

func (*ADS) DeactivateEntry added in v0.6.2

func (mads *ADS) DeactivateEntry(shardID int, sn int64)

func (*ADS) Delete

func (mads *ADS) Delete(key []byte)

Delete a KV pair. It is shard-safe

func (*ADS) EndWrite

func (mads *ADS) EndWrite()

func (*ADS) GetCurrHeight

func (mads *ADS) GetCurrHeight() int64

func (*ADS) GetEntry

func (mads *ADS) GetEntry(k []byte) *Entry

func (*ADS) GetEntryAtHeight

func (mads *ADS) GetEntryAtHeight(k []byte, height uint64) *Entry

func (*ADS) GetProof

func (mads *ADS) GetProof(k []byte) (entryBz, proofBz []byte, err error)

func (*ADS) GetRootHash

func (mads *ADS) GetRootHash() []byte

func (*ADS) PrepareForDeletion

func (mads *ADS) PrepareForDeletion(k []byte) (findIt bool)

func (*ADS) PrepareForUpdate

func (mads *ADS) PrepareForUpdate(k []byte)

func (*ADS) PrintIdxTree

func (mads *ADS) PrintIdxTree()

func (*ADS) PrintMetaInfo

func (mads *ADS) PrintMetaInfo()

func (*ADS) PruneBeforeHeight

func (mads *ADS) PruneBeforeHeight(height int64)

func (*ADS) ScanAll

func (mads *ADS) ScanAll(fn func(key, value []byte))

func (*ADS) Set

func (mads *ADS) Set(key, value []byte)

Modify a KV pair. It is shard-safe

type BucketMap

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

func NewBucketMap

func NewBucketMap(sizeList []int) *BucketMap

func (*BucketMap) GetSizes

func (bm *BucketMap) GetSizes() []int

func (*BucketMap) Load

func (bm *BucketMap) Load(key string) (value *HotEntry, ok bool)

func (*BucketMap) Store

func (bm *BucketMap) Store(key string, value *HotEntry)

type BucketSet

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

func NewBucketSet

func NewBucketSet(sizeList []int) *BucketSet

func (*BucketSet) GetSizes

func (bs *BucketSet) GetSizes() []int

func (*BucketSet) Store

func (bs *BucketSet) Store(key string)

type Entry

type Entry = types.Entry

type HotEntry

type HotEntry = types.HotEntry

Jump to

Keyboard shortcuts

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