Class DriverFileStore
driver.file. data source options into files on the local
filesystem, so that a driver which takes a path can be given one.
The content itself lives in the data source definition, which is replicated to every node and re-read whenever a data source is loaded, so the files here are derived state: each node writes its own copy, and the directory is cleared on startup rather than relied on to persist. That is what lets a data source configured this way work on a node that has never seen the files.
A data source's files are written into a directory named for the data source and a hash of the content, so updating a data source materializes its new content alongside the old rather than over it, and a version still in use by an open connection pool stays intact.
The content is secret, certificates and keystores among it, and nothing here restricts the permissions it is written with. It is protected the way everything else Stardog writes is: by the permissions on Stardog's home directory, which is the only place these files live.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDirectory, relative to Stardog home, holding the materialized content. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Removes everything this store has materialized, along with the directory holding it.voidremove(String dataSourceName, Properties closedOptions, Properties retainedOptions) Removes the files materialized for a data source that is gone, either because it was removed or because it was replaced.resolve(String dataSourceName, Properties options) Returns the data source options to configure the driver with: the supplied options with thedriver.file.options replaced by theext.options naming the files they were materialized into.root()The directory the content is materialized into.
-
Field Details
-
HOME_SUBDIRECTORY
Directory, relative to Stardog home, holding the materialized content. Owned entirely by this class: its contents are removed on startup.- See Also:
-
-
Constructor Details
-
DriverFileStore
-
-
Method Details
-
root
The directory the content is materialized into. -
destroy
public void destroy()Removes everything this store has materialized, along with the directory holding it. For a store whose lifetime is shorter than the process that created it. -
resolve
Returns the data source options to configure the driver with: the supplied options with thedriver.file.options replaced by theext.options naming the files they were materialized into. Returns the supplied options unchanged when there are nodriver.file.options.The result is a copy. The caller's options are what gets persisted to the registry, and must keep the content and stay free of the paths, which are local to this node.
- Parameters:
dataSourceName- the data source the options belong to, used to name the directoryoptions- the data source options as supplied by the client
-
remove
public void remove(String dataSourceName, Properties closedOptions, @Nullable Properties retainedOptions) Removes the files materialized for a data source that is gone, either because it was removed or because it was replaced.A data source is replaced by building the replacement and closing the old one afterwards, so by the time this is called the replacement's content has already been materialized. When an update leaves the driver files alone, that content is the very same directory, which is what
retainedOptionsis for.- Parameters:
dataSourceName- the data source the options belong to, as it was passed toresolve(java.lang.String, java.util.Properties)closedOptions- the options of the data source that is gone, as they were passed toresolve(java.lang.String, java.util.Properties)retainedOptions- the options of the data source that replaced it, ornullif it was removed
-