freelist

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CIDSizePrefix = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type FreeList

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

A primary storage that is CID aware.

func Open added in v0.3.0

func Open(path string) (*FreeList, error)

func (*FreeList) Close

func (cp *FreeList) Close() error

Close calls Flush to write work and data to the freelist file, and then closes the file.

func (*FreeList) Flush

func (cp *FreeList) Flush() (types.Work, error)

Flush writes outstanding work and buffered data to the freelist file.

func (*FreeList) Iter

func (cp *FreeList) Iter() (*Iterator, error)

func (*FreeList) OutstandingWork

func (cp *FreeList) OutstandingWork() types.Work

func (*FreeList) Put

func (cp *FreeList) Put(blk types.Block) error

func (*FreeList) StorageSize added in v0.2.0

func (fl *FreeList) StorageSize() (int64, error)

StorageSize returns bytes of storage used by the freelist.

func (*FreeList) Sync

func (cp *FreeList) Sync() error

Sync commits the contents of the freelist file to disk. Flush should be called before calling Sync.

func (*FreeList) ToGC added in v0.3.0

func (cp *FreeList) ToGC() (string, error)

ToGC moves the current freelist file into a ".gc" file and creates a new freelist file. This allows the garbage collector to then process the .gc freelist file while allowing the freelist to continue to operate on a new file.

type Iterator added in v0.3.0

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

func NewIterator added in v0.3.0

func NewIterator(reader io.Reader) *Iterator

func (*Iterator) Next added in v0.3.0

func (cpi *Iterator) Next() (*types.Block, error)

Jump to

Keyboard shortcuts

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