extent

package
v0.0.0-...-6aa601a Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XATTRMETA = "user.EXTENTMETA"
	XATTRSEAL = "user.XATTRSEAL"
	XATTRREV  = "user.REV"
)

Variables

This section is empty.

Functions

func CreateCopyExtent

func CreateCopyExtent(fileName string, ID uint64) (string, error)

func ExtractEntryInfo

func ExtractEntryInfo(b *pb.Block, extentID uint64, offset uint32, replay bool) (*pb.EntryInfo, error)

Types

type Extent

type Extent struct {
	//sync.Mutex //only one AppendBlocks could be called at a time
	utils.SafeMutex

	ID uint64
	// contains filtered or unexported fields
}

func CreateExtent

func CreateExtent(fileName string, ID uint64) (*Extent, error)

func OpenExtent

func OpenExtent(fileName string) (*Extent, error)

func (*Extent) AppendBlocks

func (ex *Extent) AppendBlocks(blocks []*pb.Block, doSync bool) ([]uint32, uint32, error)

func (*Extent) Close

func (ex *Extent) Close()

Close requeset LOCK

func (*Extent) CommitLength

func (ex *Extent) CommitLength() uint32

func (*Extent) GetRawWriter

func (ex *Extent) GetRawWriter() *rawWriter

fixWriter is used to fill gaps between

func (*Extent) GetReader

func (ex *Extent) GetReader() *extentReader

func (*Extent) HasLock

func (ex *Extent) HasLock(revision int64) bool

func (*Extent) IsSeal

func (ex *Extent) IsSeal() bool

func (*Extent) ReadBlocks

func (ex *Extent) ReadBlocks(offset uint32, maxNumOfBlocks uint32, maxTotalSize uint32) ([]*pb.Block, []uint32, uint32, error)

func (*Extent) ReadEntries

func (ex *Extent) ReadEntries(offset uint32, maxTotalSize uint32, replay bool) ([]*pb.EntryInfo, uint32, error)

helper function, block could be pb.Entries, support ReadEntries ReadEntries can only be called on replicated extent node_service will never call this function, this function is only for test

func (*Extent) RecoveryData

func (ex *Extent) RecoveryData(start uint32, rev int64, blocks []*pb.Block) error

func (*Extent) ResetWriter

func (ex *Extent) ResetWriter() error

func (*Extent) Seal

func (ex *Extent) Seal(commit uint32) error

Seal requires LOCK if commit is bigger than currentLength, return error

func (*Extent) Sync

func (ex *Extent) Sync()

func (*Extent) Truncate

func (ex *Extent) Truncate(length uint32) error

func (*Extent) ValidAllBlocks

func (ex *Extent) ValidAllBlocks(start int64) (uint32, error)

ValidAllBlocks表示从start,就存在一个合法的数据block(不是64KB BLOCK)

Directories

Path Synopsis
Package record reads and writes sequences of records.
Package record reads and writes sequences of records.

Jump to

Keyboard shortcuts

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