fileflatdb

package
v0.0.0-...-f5f0bdb Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SlotBranch = 1

SlotBranch ...

View Source
var SlotEmpty = 0

SlotEmpty ...

View Source
var SlotLeaf = 2

SlotLeaf ...

Functions

This section is empty.

Types

type Cache

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

Cache ...

func NewCache

func NewCache(file *File) *Cache

NewCache ...

func (*Cache) CacheBranch

func (c *Cache) CacheBranch(branchAt int64, branch []byte)

CacheBranch ...

func (*Cache) CacheData

func (c *Cache) CacheData(dataAt int64, data []byte)

CacheData ...

func (*Cache) GetCachedBranch

func (c *Cache) GetCachedBranch(branchAt int64) []byte

GetCachedBranch ...

func (*Cache) GetCachedData

func (c *Cache) GetCachedData(dataAt int64, length int64) []byte

GetCachedData ...

type Compact

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

Compact ...

func NewCompact

func NewCompact(file string) *Compact

NewCompact ...

func (*Compact) Compact

func (c *Compact) Compact(fn db.ProgressCB, newFd, oldFd uintptr) int

Compact ...

func (*Compact) CompactReadEntry

func (c *Compact) CompactReadEntry(fd uintptr, at int, index int) []byte

CompactReadEntry ...

func (*Compact) CompactReadKey

func (c *Compact) CompactReadKey(fd uintptr, at int64) ([]byte, []byte)

CompactReadKey ...

func (c *Compact) CompactUpdateLink(fd uintptr, at int, index int, pointer int64, kind int)

CompactUpdateLink ...

func (*Compact) CompactWriteHeader

func (c *Compact) CompactWriteHeader(fd uintptr, at int, index int) int64

CompactWriteHeader ...

func (*Compact) CompactWriteKey

func (c *Compact) CompactWriteKey(fd uintptr, key, value []byte) int64

CompactWriteKey ...

func (*Compact) Maintain

func (c *Compact) Maintain(fn *db.ProgressCB)

Maintain ...

func (*Compact) Open

func (c *Compact) Open(file string, startEmpty bool) uintptr

Open ...

type File

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

File ...

func NewFile

func NewFile(base, file string, options *db.BaseDBOptions) *File

NewFile ...

func (*File) AssertOpen

func (f *File) AssertOpen(open bool)

AssertOpen ...

func (*File) Close

func (f *File) Close()

Close ...

func (*File) Open

func (f *File) Open(filepath string, startEmpty bool)

Open ...

type FileFlatDB

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

FileFlatDB ...

func NewFileFlatDB

func NewFileFlatDB(base, file string) *FileFlatDB

NewFileFlatDB ...

func (*FileFlatDB) Close

func (f *FileFlatDB) Close()

Close ...

func (*FileFlatDB) Del

func (f *FileFlatDB) Del(key []uint8)

Del ...

func (*FileFlatDB) Drop

func (f *FileFlatDB) Drop()

Drop ...

func (*FileFlatDB) Empty

func (f *FileFlatDB) Empty()

Empty ...

func (*FileFlatDB) FindKey

func (f *FileFlatDB) FindKey(key *NibbleBuffer, doCreate bool) *Key

FindKey ...

func (*FileFlatDB) Get

func (f *FileFlatDB) Get(key []uint8) []uint8

Get ...

func (*FileFlatDB) Maintain

func (f *FileFlatDB) Maintain(fn *db.ProgressCB) error

Maintain ...

func (*FileFlatDB) Open

func (f *FileFlatDB) Open()

Open ...

func (*FileFlatDB) Put

func (f *FileFlatDB) Put(key, value []uint8)

Put ...

func (*FileFlatDB) ReadValue

func (f *FileFlatDB) ReadValue(key *Key) *Value

ReadValue ...

func (*FileFlatDB) Rename

func (f *FileFlatDB) Rename(base, file string)

Rename ...

func (*FileFlatDB) Size

func (f *FileFlatDB) Size() int

Size ...

func (*FileFlatDB) WriteValue

func (f *FileFlatDB) WriteValue(key *Key, value []byte) *Value

WriteValue ...

type Impl

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

Impl ...

func NewImpl

func NewImpl(cache *Cache) *Impl

NewImpl ...

func (*Impl) ExtractValueInfo

func (i *Impl) ExtractValueInfo(keyValue []byte) *ValueInfo

ExtractValueInfo ...

func (*Impl) FindKey

func (i *Impl) FindKey(key *NibbleBuffer, doCreate bool, keyIndex, branchAt int64) *Key

FindKey ...

func (*Impl) GetKeyValue

func (i *Impl) GetKeyValue(keyAt int64) []byte

GetKeyValue ...

func (*Impl) ReadValue

func (i *Impl) ReadValue(keyValue []byte) *Value

ReadValue ...

func (*Impl) RetrieveBranch

func (i *Impl) RetrieveBranch(doCreate bool, branch []byte, entryIndex int, keyIndex int, key *NibbleBuffer) *Key

RetrieveBranch ...

func (*Impl) RetrieveEmpty

func (i *Impl) RetrieveEmpty(doCreate bool, branch []byte, branchAt int64, entryIndex int64, key *NibbleBuffer) *Key

RetrieveEmpty ...

func (*Impl) RetrieveLeaf

func (i *Impl) RetrieveLeaf(doCreate bool, branch []byte, branchAt int, entryIndex int, keyIndex int, key *NibbleBuffer) *Key

RetrieveLeaf ...

func (*Impl) WriteNewBranch

func (i *Impl) WriteNewBranch(branch []byte, branchAt int64, entryIndex int64, key *NibbleBuffer, prevAt int64, prevKey *NibbleBuffer, matchIndex uint64, depth int64) *Key

WriteNewBranch ...

func (*Impl) WriteNewBuffer

func (i *Impl) WriteNewBuffer(buffer []byte, withCache bool) int64

WriteNewBuffer ...

func (*Impl) WriteNewBuffers

func (i *Impl) WriteNewBuffers(buffers [][]byte) int64

WriteNewBuffers ...

func (*Impl) WriteNewKey

func (i *Impl) WriteNewKey(key *NibbleBuffer) *Key

WriteNewKey ...

func (*Impl) WriteNewLeaf

func (i *Impl) WriteNewLeaf(branch []byte, branchAt int64, entryIndex int64, key *NibbleBuffer) *Key

WriteNewLeaf ...

func (*Impl) WriteUpdatedBuffer

func (i *Impl) WriteUpdatedBuffer(buffer []byte, bufferAt int64) int64

WriteUpdatedBuffer ...

func (*Impl) WriteValue

func (i *Impl) WriteValue(keyAt int, keyValue []byte, value []byte) *Value

WriteValue ...

type Key

type Key struct {
	Key      *NibbleBuffer
	KeyAt    int64
	KeyValue []byte
}

Key ...

type LruMap

type LruMap map[int64][]byte

LruMap ...

type NibbleBuffer

type NibbleBuffer struct {
	Buffer  []byte
	Nibbles []uint8
}

NibbleBuffer ...

type Serializer

type Serializer struct {
	IsCompressed bool
}

Serializer ...

func NewSerializer

func NewSerializer() *Serializer

NewSerializer ...

func (*Serializer) DeserializeValue

func (s *Serializer) DeserializeValue(value []byte) []uint8

DeserializeValue ...

func (*Serializer) SerializeKey

func (s *Serializer) SerializeKey(value []uint8) *NibbleBuffer

SerializeKey ...

func (*Serializer) SerializeValue

func (s *Serializer) SerializeValue(value []uint8) []byte

SerializeValue ...

type Value

type Value struct {
	Value   []byte
	ValueAt int64
}

Value ...

type ValueInfo

type ValueInfo struct {
	ValueLength int64
	ValueAt     int64
}

ValueInfo ...

Jump to

Keyboard shortcuts

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