Documentation
¶
Overview ¶
Package refgraph stores the garbage collection ownership graph as plain records in a transactional key-value store.
Index ¶
- type Graph
- func (g *Graph) AddBlockRef(ctx context.Context, source, target *block.BlockRef) error
- func (g *Graph) AddObjectRoot(ctx context.Context, objectKey string, ref *block.BlockRef) error
- func (g *Graph) AddRef(ctx context.Context, subject, object string) error
- func (g *Graph) AddRoot(ctx context.Context, node string) error
- func (g *Graph) ApplyRefBatch(ctx context.Context, adds, removes []block_gc.RefEdge) error
- func (g *Graph) Close() error
- func (g *Graph) GetIncomingRefs(ctx context.Context, node string) ([]string, error)
- func (g *Graph) GetOutgoingRefs(ctx context.Context, node string) ([]string, error)
- func (g *Graph) GetRootNodes(ctx context.Context) ([]string, error)
- func (g *Graph) GetUnreferencedNodes(ctx context.Context) ([]string, error)
- func (g *Graph) HasIncomingRefs(ctx context.Context, node string) (bool, error)
- func (g *Graph) HasIncomingRefsExcluding(ctx context.Context, node string, excluded ...string) (bool, error)
- func (g *Graph) IterateNodes(ctx context.Context) ([]string, error)
- func (g *Graph) RemoveNode(ctx context.Context, node string) error
- func (g *Graph) RemoveNodeRefs(ctx context.Context, node string, markOrphaned bool) ([]string, error)
- func (g *Graph) RemoveObjectRoot(ctx context.Context, objectKey string, ref *block.BlockRef) error
- func (g *Graph) RemoveRef(ctx context.Context, subject, object string) error
- func (g *Graph) RemoveRoot(ctx context.Context, node string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph stores graph records in one transactional key/value namespace.
func (*Graph) AddBlockRef ¶
AddBlockRef preserves the collector's canonical block identity vocabulary.
func (*Graph) AddObjectRoot ¶
AddObjectRoot links an object identity to its current content root.
func (*Graph) AddRef ¶
AddRef atomically inserts both edge directions and endpoint inventory records.
func (*Graph) ApplyRefBatch ¶
ApplyRefBatch commits a bounded ownership transition atomically. Larger transitions commit slices in add-before-remove order and report an exact uncommitted suffix if a later slice fails.
func (*Graph) GetIncomingRefs ¶
GetIncomingRefs returns all current owners of one complete target identity.
func (*Graph) GetOutgoingRefs ¶
GetOutgoingRefs returns all current targets of one complete source identity.
func (*Graph) GetRootNodes ¶
GetRootNodes supplies the collector's registered roots.
func (*Graph) GetUnreferencedNodes ¶
GetUnreferencedNodes returns nodes tracked for collector reconsideration.
func (*Graph) HasIncomingRefs ¶
HasIncomingRefs ignores the bookkeeping edge from the unreferenced root.
func (*Graph) HasIncomingRefsExcluding ¶
func (g *Graph) HasIncomingRefsExcluding(ctx context.Context, node string, excluded ...string) (bool, error)
HasIncomingRefsExcluding stops at the first owner outside the caller's exclusions.
func (*Graph) IterateNodes ¶
IterateNodes supplies the explicit full node inventory requested by marking.
func (*Graph) RemoveNode ¶
RemoveNode removes inventory after the collector has handled its edges.
func (*Graph) RemoveNodeRefs ¶
func (g *Graph) RemoveNodeRefs(ctx context.Context, node string, markOrphaned bool) ([]string, error)
RemoveNodeRefs removes the observed outgoing targets in bounded transactions. New unrelated edges may be added after this operation's initial snapshot.
func (*Graph) RemoveObjectRoot ¶
RemoveObjectRoot removes an exact object-to-block ownership edge.