java.lang.Object
org.apache.tinkerpop.gremlin.tinkergraph.structure.storage.StorageSettings

public final class StorageSettings extends Object
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
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.commons.configuration2.Configuration
    reconcile(org.apache.commons.configuration2.Configuration config, File directory)
    Reconcile config with the settings recorded in directory, returning the configuration the graph should use.
    static void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • reconcile

      public static org.apache.commons.configuration2.Configuration reconcile(org.apache.commons.configuration2.Configuration config, File directory)
      Reconcile config with the settings recorded in directory, 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 with
      directory - the storage directory, already locked by the opening graph
      Returns:
      a copy of config with the store's fixed settings applied
    • removeIfOnlySettings

      public static void removeIfOnlySettings(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. 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