Class StorageSettings
java.lang.Object
org.apache.tinkerpop.gremlin.tinkergraph.structure.storage.StorageSettings
The settings a storage directory was created with, recorded in
SETTINGS_FILE beside the engine's own files.
Some settings shape the data itself: the id managers decide the type of every stored id, the cardinalities and
null handling decide how stored properties read back, and whether vertex-property ids are preserved decides whether
the store holds them at all, since every compaction rewrites the store with the setting it was opened with. A store is only ever read with the settings that wrote it, so
these are fixed when the store is created. Changing one is a migration: export the graph with g.io() and
import it into a new store. The record is written once, holding the effective value of each such setting (defaults
included), and never rewritten.
On open, a setting the configuration leaves unset takes the recorded value, so a store opens with nothing but its
storage engine and directory and the original configuration can be lost without harm. A setting that is set to a
different value fails the open. Settings that only affect how the engine runs, such as the sync mode or compaction
threshold, are not recorded and may change freely.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.configuration2.ConfigurationReconcileconfigwith the settings recorded indirectory, returning the configuration the graph should use.static voidremoveIfOnlySettings(File directory) Remove the settings file a failed first open recorded, and the version marker if the engine had written one, when the directory holds nothing else of a store, so that the next open is a first open again and can record the settings it is given.
-
Field Details
-
SETTINGS_FILE
- See Also:
-
-
Method Details
-
reconcile
public static org.apache.commons.configuration2.Configuration reconcile(org.apache.commons.configuration2.Configuration config, File directory) Reconcileconfigwith the settings recorded indirectory, returning the configuration the graph should use. The supplied configuration is not modified. A new store records the effective settings now. An existing one fills in each unset fixed setting from the record and fails on any that differ. A recovery open changes nothing on disk and reads with the recorded settings, warning where the configuration disagrees.- Parameters:
config- the configuration the graph was opened withdirectory- the storage directory, already locked by the opening graph- Returns:
- a copy of
configwith the store's fixed settings applied
-
removeIfOnlySettings
Remove the settings file a failed first open recorded, and the version marker if the engine had written one, when the directory holds nothing else of a store, so that the next open is a first open again and can record the settings it is given. Call only for an open that found no settings file when it began, which means the store did not exist before it and the marker, too, is that open's.- Parameters:
directory- the storage directory
-