Documentation
¶
Index ¶
- type Entry
- type Registry
- func (r *Registry) Delete(rgdName string, revision int64)
- func (r *Registry) DeleteAll(rgdName string)
- func (r *Registry) DeleteRevisionsBefore(rgdName string, minRevision int64)
- func (r *Registry) Get(rgdName string, revision int64) (Entry, bool)
- func (r *Registry) HasAll(rgdName string, revisions []int64) bool
- func (r *Registry) Latest(rgdName string) (Entry, bool)
- func (r *Registry) Put(entry Entry)
- func (r *Registry) ResolverForRGD(rgdName string) rgdResolver
- type RevisionState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// RGDName is the logical ownership key. Revisions are grouped by name so a
// re-created RGD can still reuse existing GraphRevisions.
RGDName string
// Revision is the monotonic revision number under RGDName.
Revision int64
// SpecHash is copied from GraphRevision spec and used by callers for
// issuance decisions.
SpecHash string
// State is the runtime readiness signal for this entry.
State RevisionState
// CompiledGraph is populated for active revisions.
// Registry writes enforce that Active never exists without a graph.
CompiledGraph *graph.Graph
}
Entry is a single cached revision record for an RGD name.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is an in-memory cache shared by reconcilers.
The API server remains the source of truth. This cache exists to avoid recompiling graphs and to coordinate revision readiness between controllers.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry creates an empty registry for compiled graph revisions.
func (*Registry) Delete ¶
Delete removes one revision entry for rgdName.
The method is idempotent and safe to call for absent buckets/revisions.
func (*Registry) DeleteAll ¶
DeleteAll removes every revision entry for rgdName.
This is used during RGD deletion to eagerly evict all cached revisions so that a recreated RGD with the same name cannot resolve stale compiled graphs.
func (*Registry) DeleteRevisionsBefore ¶
DeleteRevisionsBefore removes all entries with revision strictly lower than minRevision.
This is used by retention GC to keep only recent revisions per RGD.
func (*Registry) HasAll ¶
HasAll returns true when all listed revision numbers are present for rgdName.
This is a membership check only. Callers handle entry state separately.
func (*Registry) Latest ¶
Latest returns the highest revision entry for rgdName.
It returns false when there is no bucket, no latest marker, or if bucket metadata points to a missing entry.
func (*Registry) Put ¶
Put inserts or replaces a revision entry.
Behavior: - idempotent overwrite for the same (RGDName, Revision) - advances latest pointer only when a strictly newer revision is written
Contract: - Callers always provide explicit State
func (*Registry) ResolverForRGD ¶
ResolverForRGD returns a resolver scoped to a single RGD name.
type RevisionState ¶
type RevisionState string
RevisionState is the runtime status of a revision in the in-memory cache.
These values are internal scheduling signals between controllers. They are intentionally separate from GraphRevision API status, which is conditions-only.
const ( // RevisionStatePending means the GraphRevision object exists but compilation // has not completed yet. RevisionStatePending RevisionState = "Pending" // RevisionStateActive means compilation succeeded and CompiledGraph is ready // for direct consumption by reconcilers. RevisionStateActive RevisionState = "Active" // RevisionStateFailed means compilation failed for this revision. RevisionStateFailed RevisionState = "Failed" )