Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RepoWork ¶ added in v0.33.0
type RepoWork struct {
Org string
Repo string
Weight int // event count for sharding weight; 0 = new repo
Tenants []TenantRef
}
RepoWork represents a unique repo to import, with all tenants that track it.
func BuildWorkList ¶ added in v0.33.0
func BuildWorkList(rows []tenant.ImportWorkRow) []RepoWork
BuildWorkList deduplicates tenant_repo rows by (org, repo), grouping tenant refs under each unique repo. Preserves exact org/repo casing.
func ShardRepos ¶ added in v0.33.0
ShardRepos deterministically assigns repos to a task shard using greedy bin-packing by weight. Heavy repos are spread across tasks to balance cumulative import cost. Ties broken by lower task index for determinism. Guarantees: union of all shards == input, no gaps, no overlaps.
Click to show internal directories.
Click to hide internal directories.