block

package
v0.0.0-...-0559e4b Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LengthTypeSize = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

func (*Block) Data

func (block *Block) Data() []byte

func (*Block) Decode

func (block *Block) Decode(data []byte)

func (*Block) Encode

func (block *Block) Encode() []byte

func (*Block) EntryNum

func (block *Block) EntryNum() int

func (*Block) Iterator

func (block *Block) Iterator() *Iterator

func (*Block) Offset

func (block *Block) Offset() []int16

type BlockBuilder

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

func NewBlockBuilder

func NewBlockBuilder(maxBlockSize int) *BlockBuilder

func (*BlockBuilder) Add

func (builder *BlockBuilder) Add(key, value []byte) bool

func (*BlockBuilder) BuildBlock

func (builder *BlockBuilder) BuildBlock() *Block

func (*BlockBuilder) Empty

func (builder *BlockBuilder) Empty() bool

func (*BlockBuilder) EstimateEncodedSize

func (builder *BlockBuilder) EstimateEncodedSize() int

blcok size is (entries byte buffer) * (sizeof(int16) * number of offset) * (sizeof(int16))

func (*BlockBuilder) MaxBlockSize

func (builder *BlockBuilder) MaxBlockSize() int

type BlockMeta

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

func DecodeBlockMetasFromByte

func DecodeBlockMetasFromByte(data []byte) []BlockMeta

func NewBlockMeta

func NewBlockMeta(offset int16, fistKey []byte) BlockMeta

func (*BlockMeta) Encode

func (meta *BlockMeta) Encode() []byte

func (*BlockMeta) FirstKey

func (meta *BlockMeta) FirstKey() []byte

func (*BlockMeta) Offset

func (meta *BlockMeta) Offset() int16

type Iterator

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

func (*Iterator) Key

func (iter *Iterator) Key() string

func (*Iterator) Next

func (iter *Iterator) Next() *Iterator

func (*Iterator) Value

func (iter *Iterator) Value() []byte

Jump to

Keyboard shortcuts

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