graflo.hq.sync.group¶
Group folded rows by owner, and give every owner vertex its sync hash.
Runs after the fold, on the staging directory. For each owned vertex type it
writes owners/<slot>.jsonl.zst: one row per folded owner vertex, in key
order, with the owner's document and every edge it owns. The owner's sync hash
is set on that document and on the folded vertex row, so a bulk load writes it
and a sync run compares it.
Attributes¶
OWNERS = 'owners'
module-attribute
¶
RUNS = 'runs.json'
module-attribute
¶
Classes¶
OwnerRun
¶
Bases: BaseModel
One owned vertex type's grouped rows.
Source code in graflo/hq/sync/group.py
Functions:¶
group_owners(staging_dir, counts, hash_fields)
¶
Group every owned type of hash_fields and set its owners' hashes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
staging_dir
|
Path
|
A folded staging directory whose edge rows carry |
required |
counts
|
FoldCounts
|
Its fold counts. |
required |
hash_fields
|
Mapping[str, str]
|
Owned vertex type -> its |
required |
Source code in graflo/hq/sync/group.py
grouped_owners(staging_dir)
¶
The owner runs :func:group_owners wrote, for a resumed run.