bptree

package
v0.0.0-...-66aa405 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BLOCKSIZE int64 = 4096

Size in bytes of data blocks read/written from/to the file system.

View Source
const BufferSize uint = 4096

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryFile

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

BinaryFile type represents an open binary file.

func CreateBinaryFileByPRNG

func CreateBinaryFileByPRNG(path string, size int64) *BinaryFile

func CreateBinaryFileByRandomSampling

func CreateBinaryFileByRandomSampling(path string, size int64, sourceFile *BinaryFile, keySize int) *BinaryFile

func CreateBinaryFileFromReader

func CreateBinaryFileFromReader(path, suffix string, size int64, reader io.Reader) *BinaryFile

func OpenBinaryFile

func OpenBinaryFile(path string) *BinaryFile

func (*BinaryFile) Close

func (f *BinaryFile) Close()

func (*BinaryFile) Name

func (f *BinaryFile) Name() string

func (*BinaryFile) NewReader

func (f *BinaryFile) NewReader() *bufio.Reader

func (*BinaryFile) Size

func (f *BinaryFile) Size() int64

type Felt

type Felt uint64

func (*Felt) Binary

func (v *Felt) Binary() []byte

type KeyBinaryFactory

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

func (*KeyBinaryFactory) NewUniqueKeyValues

func (factory *KeyBinaryFactory) NewUniqueKeyValues(reader *bufio.Reader) KeyValues

func (*KeyBinaryFactory) NewUniqueKeys

func (factory *KeyBinaryFactory) NewUniqueKeys(reader *bufio.Reader) Keys

type KeyFactory

type KeyFactory interface {
	NewUniqueKeyValues(reader *bufio.Reader) KeyValues
	NewUniqueKeys(reader *bufio.Reader) Keys
}

func NewKeyBinaryFactory

func NewKeyBinaryFactory(keySize int) KeyFactory

type KeyValues

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

func (KeyValues) Len

func (kv KeyValues) Len() int

func (KeyValues) Less

func (kv KeyValues) Less(i, j int) bool

func (KeyValues) String

func (kv KeyValues) String() string

func (KeyValues) Swap

func (kv KeyValues) Swap(i, j int)

type Keys

type Keys []Felt

func (Keys) Contains

func (keys Keys) Contains(key Felt) bool

func (Keys) Len

func (keys Keys) Len() int

func (Keys) Less

func (keys Keys) Less(i, j int) bool

func (Keys) String

func (keys Keys) String() string

func (Keys) Swap

func (keys Keys) Swap(i, j int)

type Node23

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

func (*Node23) String

func (n *Node23) String() string

type Node23Graph

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

func NewGraph

func NewGraph(node *Node23) *Node23Graph

type RandomBinaryReader

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

RandomBinaryReader reads data chuncks randomly from a binary file.

func (RandomBinaryReader) Read

func (r RandomBinaryReader) Read(b []byte) (n int, err error)

type Stats

type Stats struct {
	ExposedCount  uint
	RehashedCount uint
	CreatedCount  uint
	UpdatedCount  uint
	DeletedCount  uint
	OpeningHashes uint
	ClosingHashes uint
}

type Tree23

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

func NewEmptyTree23

func NewEmptyTree23() *Tree23

func NewTree23

func NewTree23(kvItems KeyValues) *Tree23

func (*Tree23) Delete

func (t *Tree23) Delete(keyToDelete []Felt) *Tree23

func (*Tree23) DeleteWithStats

func (t *Tree23) DeleteWithStats(keysToDelete []Felt, stats *Stats) *Tree23

func (*Tree23) Graph

func (t *Tree23) Graph(filename string, debug bool)

func (*Tree23) GraphAndPicture

func (t *Tree23) GraphAndPicture(filename string) error

func (*Tree23) GraphAndPictureDebug

func (t *Tree23) GraphAndPictureDebug(filename string) error

func (*Tree23) Height

func (t *Tree23) Height() int

func (*Tree23) IsValid

func (t *Tree23) IsValid() (bool, error)

func (*Tree23) KeysInLevelOrder

func (t *Tree23) KeysInLevelOrder() []Felt

func (*Tree23) RootHash

func (t *Tree23) RootHash() []byte

func (*Tree23) Size

func (t *Tree23) Size() int

func (*Tree23) String

func (t *Tree23) String() string

func (*Tree23) Upsert

func (t *Tree23) Upsert(kvItems KeyValues) *Tree23

func (*Tree23) UpsertWithStats

func (t *Tree23) UpsertWithStats(kvItems KeyValues, stats *Stats) *Tree23

func (*Tree23) WalkKeysPostOrder

func (t *Tree23) WalkKeysPostOrder() []Felt

func (*Tree23) WalkPostOrder

func (t *Tree23) WalkPostOrder(w Walker) []interface{}

type Walker

type Walker func(*Node23) interface{}

Jump to

Keyboard shortcuts

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