extent

package
v0.0.0-...-e603270 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 14 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)

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 []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, error)

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) ([]block, []uint32, uint32, error)

func (*Extent) ReadLastBlock

func (ex *Extent) ReadLastBlock() ([]block, []uint32, uint32, error)

return data, offset, end, error

func (*Extent) RecoveryData

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

func (*Extent) ResetWriter

func (ex *Extent) ResetWriter()

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() error

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