MCPcopy
hub / github.com/kopia/kopia / committedState

Method committedState

internal/epoch/epoch_manager.go:774–792  ·  view source on GitHub ↗
(ctx context.Context, ensureMinTime time.Duration)

Source from the content-addressed store, hash-verified

772}
773
774func (e *Manager) committedState(ctx context.Context, ensureMinTime time.Duration) (CurrentSnapshot, error) {
775 e.mu.Lock()
776 defer e.mu.Unlock()
777
778 if now := e.timeFunc().Add(ensureMinTime); now.After(e.lastKnownState.ValidUntil) {
779 contentlog.Log2(
780 ctx, e.log,
781 "refreshing committed state because it's no longer valid",
782 logparam.Time("now", now),
783 logparam.Time("validUntil", e.lastKnownState.ValidUntil),
784 )
785
786 if err := e.refreshLocked(ctx); err != nil {
787 return CurrentSnapshot{}, err
788 }
789 }
790
791 return e.lastKnownState, nil
792}
793
794// GetCompleteIndexSet returns the set of blobs forming a complete index set up to the provided epoch number.
795func (e *Manager) GetCompleteIndexSet(ctx context.Context, maxEpoch int) ([]blob.Metadata, time.Time, error) {

Callers 9

CurrentMethod · 0.95
CleanupMarkersMethod · 0.95
GetCompleteIndexSetMethod · 0.95
WriteIndexMethod · 0.95
forceAdvanceEpochMethod · 0.95

Calls 7

refreshLockedMethod · 0.95
Log2Function · 0.92
TimeFunction · 0.92
AfterMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
AddMethod · 0.45

Tested by 1

forceAdvanceEpochMethod · 0.76