retention

package
v1.47.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGarbageCollectionCommits

func GetGarbageCollectionCommits(ctx context.Context, startingPointIterator *GCStartingPointIterator, commitGetter RepositoryCommitGetter, rules *graveler.GarbageCollectionRules) (map[graveler.CommitID]graveler.MetaRangeID, error)

GetGarbageCollectionCommits returns the sets of active commits, according to the repository's garbage collection rules. See https://github.com/treeverse/lakeFS/issues/1932 for more details. Upon completion, the given startingPointIterator is closed.

Types

type CommitNode added in v0.96.0

type CommitNode struct {
	CreationDate time.Time
	MainParent   graveler.CommitID
	MetaRangeID  graveler.MetaRangeID
}

type CommitsMap added in v1.39.0

type CommitsMap struct {
	Log          logging.Logger
	NumMisses    int64
	CommitGetter RepositoryCommitGetter
	Map          map[graveler.CommitID]CommitNode
	// contains filtered or unexported fields
}

CommitsMap is an immutable cache of commits. Each commit can be set once, and will be read if needed. It is *not* thread-safe.

func NewCommitsMap added in v1.39.0

func NewCommitsMap(ctx context.Context, commitGetter RepositoryCommitGetter) (CommitsMap, error)

func (*CommitsMap) Get added in v1.39.0

Get gets a commit. If the commit has not been Set it uses CommitGetter to read it.

func (*CommitsMap) GetMap added in v1.39.0

func (c *CommitsMap) GetMap() map[graveler.CommitID]CommitNode

GetMap returns the entire map of commits. It is probably incorrect to modify it.

func (*CommitsMap) Set added in v1.39.0

func (c *CommitsMap) Set(id graveler.CommitID, node CommitNode)

Set sets a commit. It will not be looked up again in CommitGetter.

type GCStartingPoint added in v0.45.1

type GCStartingPoint struct {
	BranchID graveler.BranchID
	CommitID graveler.CommitID
}

A GCStartingPoint represents a commit from which the GC algorithm should start scanning. It could be either a branch HEAD, or a dangling commit. The CommitID field is always set, while BranchID is set only if the commit is a branch HEAD.

type GCStartingPointIterator added in v0.45.1

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

GCStartingPointIterator combines a branch iterator and a commit iterator. Both are assumed to be sorted and to contain no duplicates. Each returned GCStartingPoint object contains the commit id. If the entry came from the branch iterator, it also contains the branch id. Commits appearing in both iterators appear only once and include the branch id. Closing this iterator will close the two internal iterators.

func NewGCStartingPointIterator added in v0.45.1

func NewGCStartingPointIterator(commitIterator graveler.CommitIterator, branchIterator graveler.BranchIterator) *GCStartingPointIterator

func (*GCStartingPointIterator) Close added in v0.45.1

func (sp *GCStartingPointIterator) Close()

func (*GCStartingPointIterator) Err added in v0.45.1

func (sp *GCStartingPointIterator) Err() error

func (*GCStartingPointIterator) Next added in v0.45.1

func (sp *GCStartingPointIterator) Next() bool

func (*GCStartingPointIterator) Value added in v0.45.1

type GarbageCollectionManager

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

func NewGarbageCollectionManager

func NewGarbageCollectionManager(blockAdapter block.Adapter, refManager graveler.RefManager, committedBlockStoragePrefix string) *GarbageCollectionManager

func (*GarbageCollectionManager) GetAddressesLocation added in v0.44.0

func (m *GarbageCollectionManager) GetAddressesLocation(sn graveler.StorageNamespace) (string, error)

func (*GarbageCollectionManager) GetCommitsCSVLocation added in v0.44.0

func (m *GarbageCollectionManager) GetCommitsCSVLocation(runID string, sn graveler.StorageNamespace) (string, error)

func (*GarbageCollectionManager) GetRules

func (*GarbageCollectionManager) GetUncommittedLocation added in v0.85.0

func (m *GarbageCollectionManager) GetUncommittedLocation(runID string, sn graveler.StorageNamespace) (string, error)

GetUncommittedLocation return full path to underlying storage path to store uncommitted information

func (*GarbageCollectionManager) NewID added in v0.85.0

func (m *GarbageCollectionManager) NewID() string

func (*GarbageCollectionManager) SaveGarbageCollectionCommits

func (m *GarbageCollectionManager) SaveGarbageCollectionCommits(ctx context.Context, repository *graveler.RepositoryRecord, rules *graveler.GarbageCollectionRules) (string, error)

func (*GarbageCollectionManager) SaveGarbageCollectionUncommitted added in v0.85.0

func (m *GarbageCollectionManager) SaveGarbageCollectionUncommitted(ctx context.Context, repository *graveler.RepositoryRecord, filename, runID string) error

func (*GarbageCollectionManager) SaveRules

type RepositoryCommitGetter

type RepositoryCommitGetter interface {
	List(ctx context.Context) (graveler.CommitIterator, error)
	Get(ctx context.Context, id graveler.CommitID) (*graveler.Commit, error)
}

Jump to

Keyboard shortcuts

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