Class IncrementalRegistry
java.lang.Object
network.ike.docs.plugin.registry.IncrementalRegistry
The blob-keyed incremental registry (
dev-adoc-packages,
IKE-Network/ike-issues#1341). Every entry records the blob id of the
content it was parsed from, and a run decides each file by one rule
against the registry it wrote last time:
- same path and same blob: keep the entry, without opening the file;
- same blob at a path that is gone, a rename: re-key the entry to the new path, without opening the file;
- a new or changed blob: parse the file;
- a path that is gone: drop the entry.
Files that are not topics get an entry too, with their blob, so they
are not opened again either. What is derived across files is derived
again on every run from the entries: the duplicate-id findings, the
counts, the domain grouping and the order. The result has the shape of
TopicRegistry.model(List, Path, Instant), so it reads back through
TopicRegistry.load(Path) and serves as the previous registry of the
next run. A first run, or a run after the previous registry was
deleted, parses everything.
- Since:
- 136
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat one update did. -
Field Summary
Fields -
Method Summary
-
Field Details
-
VERSION
Theregistry-versionof a registry whose entries carry blobs.- See Also:
-
-
Method Details
-
update
public static IncrementalRegistry.Outcome update(Map<String, Object> previous, Path root, BlobIndex index, Path base, Instant now) throws IOExceptionUpdate a registry against the files a blob index lists.- Parameters:
previous- the registry written last time, fromTopicRegistry.load(Path), ornullfor a first runroot- the registry root the index paths are relative toindex- every.adocfile under the root with its blob idbase- the directory the root is shown relative to (the module base directory)now- the generation instant- Returns:
- the outcome, with the new model
- Throws:
IOException- if a file that must be parsed cannot be read
-