Class FileGraphCorpus
RoleRagBinding registers the
documents it already loaded so GRAPH construction does not walk the
filesystem a second time. Tests and standalone providers may register a
corpus directly.
- Since:
- 0.14.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne ingested FILE chunk.static final recordComplete source-configuration and lifecycle identity for one binding.static final classExact-owner lifecycle handle for one registered corpus. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<FileGraphCorpus.Document> Returns the registered corpus, or an empty list when none was stored.static voidenter(FileGraphCorpus.Key key) Pins the binding identity for provideropenon this thread.static voidDrops one exact corpus registration without retiring another binding on the same Role class.static voidDrops every corpus for a Role class.static voidleave()Clears the thread-local binding identity.static voidregister(FileGraphCorpus.Key key, List<FileGraphCorpus.Document> documents) Registers the FILE corpus for one binding identity.static voidregister(Class<?> roleClass, List<FileGraphCorpus.Document> documents) Registers the FILE corpus associated with a Role class.static FileGraphCorpus.RegistrationregisterOwned(FileGraphCorpus.Key key, List<FileGraphCorpus.Document> documents) Registers a corpus and returns its exact-owner lifecycle handle.static FileGraphCorpus.RegistrationregisterOwnedSuperseding(FileGraphCorpus.Key key, List<FileGraphCorpus.Document> documents) Registers a corpus in place of the one registered for the same key, and returns its exact-owner lifecycle handle.
-
Method Details
-
register
Registers the FILE corpus associated with a Role class.This compatibility overload replaces an earlier corpus for the same key. Standalone callers that need exact-owner lifecycle cleanup should use
registerOwned(Key, List).- Parameters:
roleClass- Role runtime classdocuments- ingested FILE chunks
-
register
Registers the FILE corpus for one binding identity.This compatibility overload replaces an earlier corpus for the same key. The replaced corpus is retired before this method returns.
- Parameters:
key- Role class plus complete binding identitydocuments- ingested FILE chunks
-
registerOwned
public static FileGraphCorpus.Registration registerOwned(FileGraphCorpus.Key key, List<FileGraphCorpus.Document> documents) Registers a corpus and returns its exact-owner lifecycle handle.The handle removes only the corpus instance created by this call. A delayed or repeated close therefore cannot delete a later registration that happens to reuse the same logical key.
- Parameters:
key- complete binding identitydocuments- immutable binding-time FILE chunks- Returns:
- exact-owner registration handle
- Since:
- 0.15.0
-
registerOwnedSuperseding
public static FileGraphCorpus.Registration registerOwnedSuperseding(FileGraphCorpus.Key key, List<FileGraphCorpus.Document> documents) Registers a corpus in place of the one registered for the same key, and returns its exact-owner lifecycle handle.The replaced corpus is not retired here. Its own registration still retires it when closed, and that close leaves this corpus registered. A reloaded binding uses this while the binding it replaces still serves calls that started before the reload.
- Parameters:
key- complete binding identitydocuments- immutable binding-time FILE chunks- Returns:
- exact-owner registration handle
- Since:
- 0.18.0
-
forget
Drops every corpus for a Role class.- Parameters:
roleClass- Role runtime class
-
forget
Drops one exact corpus registration without retiring another binding on the same Role class.- Parameters:
key- complete corpus identity- Since:
- 0.17.4
-
documents
Returns the registered corpus, or an empty list when none was stored.When a binding scope is active for
roleClass, that binding's documents are returned. Otherwise the empty-fingerprint registration is used.- Parameters:
roleClass- Role runtime class- Returns:
- immutable chunk list
-
enter
Pins the binding identity for provideropenon this thread.- Parameters:
key- binding identity
-
leave
public static void leave()Clears the thread-local binding identity.
-