gc

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotDeleteSomeBlocks = errors.New("garbage collection incomplete: could not delete some blocks")
View Source
var ErrCannotFetchAllLinks = errors.New("garbage collection aborted: could not retrieve some links")

Functions

func ColoredSet

func ColoredSet(ctx context.Context, pn pin.Pinner, ls dag.LinkService, bestEffortRoots []*cid.Cid, output chan<- Result) (*cid.Set, error)

ColoredSet computes the set of nodes in the graph that are pinned by the pins in the given pinner.

func Descendants

func Descendants(ctx context.Context, getLinks dag.GetLinks, set *cid.Set, roots []*cid.Cid) error

func GC

func GC(ctx context.Context, bs bstore.GCBlockstore, ls dag.LinkService, pn pin.Pinner, bestEffortRoots []*cid.Cid) <-chan Result

GC performs a mark and sweep garbage collection of the blocks in the blockstore first, it creates a 'marked' set and adds to it the following: - all recursively pinned blocks, plus all of their descendants (recursively) - bestEffortRoots, plus all of its descendants (recursively) - all directly pinned blocks - all blocks utilized internally by the pinner

The routine then iterates over every block in the blockstore and deletes any block that is not found in the marked set.

Types

type CannotDeleteBlockError added in v0.4.8

type CannotDeleteBlockError struct {
	Key *cid.Cid
	Err error
}

func (*CannotDeleteBlockError) Error added in v0.4.8

func (e *CannotDeleteBlockError) Error() string

type CannotFetchLinksError added in v0.4.8

type CannotFetchLinksError struct {
	Key *cid.Cid
	Err error
}

func (*CannotFetchLinksError) Error added in v0.4.8

func (e *CannotFetchLinksError) Error() string

type Result added in v0.4.8

type Result struct {
	KeyRemoved *cid.Cid
	Error      error
}

Result represents an incremental output from a garbage collection run. It contains either an error, or the cid of a removed object.

Jump to

Keyboard shortcuts

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