block

package
v0.0.0-...-40627cf Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandleLength         = 2 * 8 // 一个blockHandle的实际大小 16B
	MaxBlockHandleLength = 20    // 序列化blockHandle所需要的最大空间 = 20B
)

Variables

View Source
var ErrBlockFinished = errors.New("unable to perform actions on finished block")

Functions

func NewIter

func NewIter(blk *Block) common.Iterator

Types

type Block

type Block struct {
	Content        slice.Slice // all data in the block
	NumRestarts    uint32
	RestartsOffset uint32
}

func New

func New(content slice.Slice) *Block

type Handle

type Handle struct {
	Offset uint64
	Size   uint64
}

Handle : represents a specific block space in a file

func NewHandle

func NewHandle(bytes []byte) *Handle

func (*Handle) ToSlice

func (b *Handle) ToSlice() slice.Slice

type Writer

type Writer interface {
	AddEntry(k, v slice.Slice) error
	Finish() slice.Slice
	Reset()
	Size() int
}

func NewWriter

func NewWriter() Writer

NewWriter: create a concrete instance of Writer interface

Jump to

Keyboard shortcuts

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