ontometer_corpus.store.ops¶
Exchange between the local store and a remote: status, push, pull, tag, gc.
Presence is decided by content hash (the first 64 characters of a file name),
never by the exact path. Every object is hash-checked before it is uploaded
and after it is downloaded; a download lands in the staging directory and is
renamed into objects/ only once its hash matches, so an interrupted pull
never leaves a partial object behind.
Attributes¶
BATCH = 100
module-attribute
¶
TAG_PATTERN = 'corpus-*'
module-attribute
¶
Classes¶
StoreError
¶
Status
dataclass
¶
What each side lacks for an index; remote_bad disagrees in size or hash.
Source code in ontometer_corpus/store/ops.py
PushReport
dataclass
¶
Source code in ontometer_corpus/store/ops.py
Attributes¶
uploaded = field(default_factory=list)
class-attribute
instance-attribute
¶
corrupt = field(default_factory=list)
class-attribute
instance-attribute
¶
missing_locally = field(default_factory=list)
class-attribute
instance-attribute
¶
Methods:¶
__init__(uploaded=list(), corrupt=list(), missing_locally=list())
¶
PullReport
dataclass
¶
Source code in ontometer_corpus/store/ops.py
Attributes¶
downloaded = field(default_factory=list)
class-attribute
instance-attribute
¶
rejected = field(default_factory=list)
class-attribute
instance-attribute
¶
unavailable = field(default_factory=list)
class-attribute
instance-attribute
¶
Methods:¶
__init__(downloaded=list(), rejected=list(), unavailable=list())
¶
GcReport
dataclass
¶
Objects no tagged index (nor the working index) references. Listed, never deleted.
Source code in ontometer_corpus/store/ops.py
Functions:¶
remote_objects(remote, revision=None)
¶
The remote's objects, by content hash.
Source code in ontometer_corpus/store/ops.py
status(paths, remote, entries, revision=None)
¶
Compare an index with the local store and the remote, by hash and size.
Source code in ontometer_corpus/store/ops.py
push(paths, remote, entries, *, limit=None, allow_public=False)
¶
Upload the indexed objects the remote lacks, after checking each one's hash.
Raises:
| Type | Description |
|---|---|
StoreError
|
the remote is a public release copy (unless |
Source code in ontometer_corpus/store/ops.py
move_into_place(staged, target)
¶
Rename staged onto target atomically, also across filesystems.
Source code in ontometer_corpus/store/ops.py
pull(paths, remote, entries, *, revision=None, limit=None)
¶
Download the indexed objects the local store lacks, keeping only hash matches.
Source code in ontometer_corpus/store/ops.py
push_caches(paths, remote)
¶
Upload cache files of the current producer versions the remote lacks.
Source code in ontometer_corpus/store/ops.py
pull_caches(paths, remote)
¶
Download cache files of the current producer versions the local store lacks.
Source code in ontometer_corpus/store/ops.py
tag(paths, remote, name)
¶
Tag the remote with name once it holds every object git tag name indexes.
Raises:
| Type | Description |
|---|---|
ReleaseError
|
the tag's |
StoreError
|
the remote lacks or disagrees on some object. |
Source code in ontometer_corpus/store/ops.py
gc(paths, remote=None)
¶
List local and remote objects referenced by no tagged index and not by the working one.