Documentation
¶
Index ¶
- Variables
- func GetGarbageCollectionCommits(ctx context.Context, startingPointIterator *GCStartingPointIterator, ...) (iter.Seq2[graveler.CommitID, MetaRangeIDOrError], error)
- type CommitNode
- func (*CommitNode) Descriptor() ([]byte, []int)deprecated
- func (x *CommitNode) GetCreationUsecs() int64
- func (x *CommitNode) GetMainParent() string
- func (x *CommitNode) GetMetaRangeID() string
- func (*CommitNode) ProtoMessage()
- func (x *CommitNode) ProtoReflect() protoreflect.Message
- func (x *CommitNode) Reset()
- func (x *CommitNode) String() string
- type CommitsMap
- type GCRefManager
- type GCStartingPoint
- type GCStartingPointIterator
- type GarbageCollectionManager
- func (m *GarbageCollectionManager) GetAddressesLocation(storageID graveler.StorageID, sn graveler.StorageNamespace) (string, error)
- func (m *GarbageCollectionManager) GetCommitsCSVLocation(runID string, storageID graveler.StorageID, sn graveler.StorageNamespace) (string, error)
- func (m *GarbageCollectionManager) GetRules(ctx context.Context, storageID graveler.StorageID, ...) (*graveler.GarbageCollectionRules, error)
- func (m *GarbageCollectionManager) GetUncommittedLocation(runID string, storageID graveler.StorageID, sn graveler.StorageNamespace) (string, error)
- func (m *GarbageCollectionManager) NewID() string
- func (m *GarbageCollectionManager) SaveGarbageCollectionCommits(ctx context.Context, repository *graveler.RepositoryRecord, ...) (string, error)
- func (m *GarbageCollectionManager) SaveGarbageCollectionUncommitted(ctx context.Context, repository *graveler.RepositoryRecord, ...) error
- func (m *GarbageCollectionManager) SaveRules(ctx context.Context, storageID graveler.StorageID, ...) error
- type MetaRangeIDOrError
- type RepositoryCommitGetter
- type RepositoryCommitGetterAdapter
Constants ¶
This section is empty.
Variables ¶
var (
ErrBadCommitID = errors.New("bad format commit ID")
)
var File_graveler_retention_commits_proto protoreflect.FileDescriptor
Functions ¶
func GetGarbageCollectionCommits ¶
func GetGarbageCollectionCommits(ctx context.Context, startingPointIterator *GCStartingPointIterator, commitGetter RepositoryCommitGetter, rules *graveler.GarbageCollectionRules, fsPrefix string) (iter.Seq2[graveler.CommitID, MetaRangeIDOrError], 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.
Types ¶
type CommitNode ¶ added in v0.96.0
type CommitNode struct {
// Microseconds-since-epoch (takes ~2x less space than a Timestamp).
CreationUsecs int64 `protobuf:"varint,1,opt,name=CreationUsecs,proto3" json:"CreationUsecs,omitempty"`
// CommitID of main-branch ("first", on any non-ancient commit) parent.
MainParent string `protobuf:"bytes,2,opt,name=MainParent,proto3" json:"MainParent,omitempty"`
// MetaRangeID of this commit.
MetaRangeID string `protobuf:"bytes,3,opt,name=MetaRangeID,proto3" json:"MetaRangeID,omitempty"`
// contains filtered or unexported fields
}
func (*CommitNode) Descriptor
deprecated
added in
v1.76.0
func (*CommitNode) Descriptor() ([]byte, []int)
Deprecated: Use CommitNode.ProtoReflect.Descriptor instead.
func (*CommitNode) GetCreationUsecs ¶ added in v1.76.0
func (x *CommitNode) GetCreationUsecs() int64
func (*CommitNode) GetMainParent ¶ added in v1.76.0
func (x *CommitNode) GetMainParent() string
func (*CommitNode) GetMetaRangeID ¶ added in v1.76.0
func (x *CommitNode) GetMetaRangeID() string
func (*CommitNode) ProtoMessage ¶ added in v1.76.0
func (*CommitNode) ProtoMessage()
func (*CommitNode) ProtoReflect ¶ added in v1.76.0
func (x *CommitNode) ProtoReflect() protoreflect.Message
func (*CommitNode) Reset ¶ added in v1.76.0
func (x *CommitNode) Reset()
func (*CommitNode) String ¶ added in v1.76.0
func (x *CommitNode) String() string
type CommitsMap ¶ added in v1.39.0
type CommitsMap struct {
Log logging.Logger
NumMisses int64
CommitGetter RepositoryCommitGetter
Store kv.Store
Cleanup func()
// 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, store kv.Store, cleanup func()) (CommitsMap, error)
NewCommitsMap creates a new CommitMap to use commitGetter. It uses store to cache all commits, and calls cleanup when closed.
func (*CommitsMap) Close ¶ added in v1.76.0
func (c *CommitsMap) Close()
func (*CommitsMap) Get ¶ added in v1.39.0
func (c *CommitsMap) Get(ctx context.Context, id graveler.CommitID) (*CommitNode, error)
Get gets a commit. If the commit has not been Set it uses CommitGetter to read it.
func (*CommitsMap) Set ¶ added in v1.39.0
func (c *CommitsMap) Set(ctx context.Context, id graveler.CommitID, node *CommitNode) error
Set sets a commit. It will not be looked up again in CommitGetter.
type GCRefManager ¶ added in v1.74.0
type GCRefManager interface {
graveler.GCRefManager
graveler.CommitReader
}
type GCStartingPoint ¶ added in v0.45.1
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
func (sp *GCStartingPointIterator) Value() *GCStartingPoint
type GarbageCollectionManager ¶
type GarbageCollectionManager struct {
// contains filtered or unexported fields
}
func NewGarbageCollectionManager ¶
func NewGarbageCollectionManager(blockAdapter block.Adapter, refManager GCRefManager, committedBlockStoragePrefix string) *GarbageCollectionManager
func (*GarbageCollectionManager) GetAddressesLocation ¶ added in v0.44.0
func (m *GarbageCollectionManager) GetAddressesLocation(storageID graveler.StorageID, sn graveler.StorageNamespace) (string, error)
func (*GarbageCollectionManager) GetCommitsCSVLocation ¶ added in v0.44.0
func (m *GarbageCollectionManager) GetCommitsCSVLocation(runID string, storageID graveler.StorageID, sn graveler.StorageNamespace) (string, error)
func (*GarbageCollectionManager) GetRules ¶
func (m *GarbageCollectionManager) GetRules(ctx context.Context, storageID graveler.StorageID, storageNamespace graveler.StorageNamespace) (*graveler.GarbageCollectionRules, error)
func (*GarbageCollectionManager) GetUncommittedLocation ¶ added in v0.85.0
func (m *GarbageCollectionManager) GetUncommittedLocation(runID string, storageID graveler.StorageID, 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 ¶
func (m *GarbageCollectionManager) SaveRules(ctx context.Context, storageID graveler.StorageID, storageNamespace graveler.StorageNamespace, rules *graveler.GarbageCollectionRules) error
type MetaRangeIDOrError ¶ added in v1.76.0
type MetaRangeIDOrError struct {
ID graveler.MetaRangeID
Err error
}
type RepositoryCommitGetter ¶
type RepositoryCommitGetterAdapter ¶ added in v1.74.0
type RepositoryCommitGetterAdapter struct {
RefManager GCRefManager
Repository *graveler.RepositoryRecord
}
func (*RepositoryCommitGetterAdapter) List ¶ added in v1.74.0
func (r *RepositoryCommitGetterAdapter) List(ctx context.Context) (graveler.CommitIterator, error)