All Superinterfaces:
AutoCloseable, Graph, Host
All Known Implementing Classes:
AbstractTinkerGraph, TinkerMemoryGraph, TinkerStorageGraph

public interface TinkerGraph extends Graph
TinkerPop's reference property graph, provided in two implementations: TinkerMemoryGraph, the in-memory graph without transaction support, and TinkerStorageGraph, the transactional graph. The static open() methods on this interface construct the in-memory implementation, which preserves the historical behavior of TinkerGraph.open(). GraphFactory may be given the name of this interface or of either implementation for the gremlin.graph configuration key.
Author:
Stephen Mallette (http://stephen.genoprime.com)
  • Field Details

    • GREMLIN_TINKERGRAPH_VERTEX_ID_MANAGER

      static final String GREMLIN_TINKERGRAPH_VERTEX_ID_MANAGER
      See Also:
    • GREMLIN_TINKERGRAPH_EDGE_ID_MANAGER

      static final String GREMLIN_TINKERGRAPH_EDGE_ID_MANAGER
      See Also:
    • GREMLIN_TINKERGRAPH_VERTEX_PROPERTY_ID_MANAGER

      static final String GREMLIN_TINKERGRAPH_VERTEX_PROPERTY_ID_MANAGER
      See Also:
    • GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY

      static final String GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY
      See Also:
    • GREMLIN_TINKERGRAPH_STORAGE

      static final String GREMLIN_TINKERGRAPH_STORAGE
      Selects the pluggable storage engine used by TinkerStorageGraph to durably persist transactions to the GREMLIN_TINKERGRAPH_STORAGE_DIRECTORY directory. The value is either a org.apache.tinkerpop.gremlin.tinkergraph.structure.storage.DefaultStorage enum name (e.g. graphbinary) or the fully-qualified class name of a org.apache.tinkerpop.gremlin.tinkergraph.structure.storage.TinkerStorage implementation. When unset, the graph holds data only in memory. Ignored by TinkerMemoryGraph, which logs a warning when this or any other gremlin.tinkergraph.storage.* key is set.
      See Also:
    • GREMLIN_TINKERGRAPH_STORAGE_DIRECTORY

      static final String GREMLIN_TINKERGRAPH_STORAGE_DIRECTORY
      The filesystem directory that a TinkerStorageGraph storage engine uses for its durable data. Ignored, with a warning, by TinkerMemoryGraph, which is purely in-memory. Only meaningful when GREMLIN_TINKERGRAPH_STORAGE is also set.
      See Also:
    • GREMLIN_TINKERGRAPH_STORAGE_SYNC

      static final String GREMLIN_TINKERGRAPH_STORAGE_SYNC
      The durability mode a TinkerStorageGraph storage engine applies on commit. Either commit (default) to fsync every commit so acknowledged commits survive an OS crash or power loss, or os to only flush to the operating system so commits survive a JVM process crash but may be lost on OS crash or power loss. Only meaningful when GREMLIN_TINKERGRAPH_STORAGE is set. See org.apache.tinkerpop.gremlin.tinkergraph.structure.storage.SyncMode.
      See Also:
    • GREMLIN_TINKERGRAPH_STORAGE_COMPACT_THRESHOLD

      static final String GREMLIN_TINKERGRAPH_STORAGE_COMPACT_THRESHOLD
      The size in bytes at which a TinkerStorageGraph storage engine automatically compacts its append log on commit, bounding the log growth (and restart replay cost) of a long-running graph that is never explicitly closed. Defaults to 67108864 (64 MB). Set to 0 to disable automatic compaction and rely on close() or an explicit compact(). Only meaningful when GREMLIN_TINKERGRAPH_STORAGE is set.
      See Also:
    • GREMLIN_TINKERGRAPH_STORAGE_PRESERVE_VP_IDS

      static final String GREMLIN_TINKERGRAPH_STORAGE_PRESERVE_VP_IDS
      Whether a TinkerStorageGraph storage engine persists vertex-property ids so they are stable across a close and reopen. Defaults to false: every vertex-property id, whether generated or given explicitly, is regenerated on load, which keeps the store smaller. Vertex and edge ids are always preserved regardless of this setting. Fixed when the store is created, like the other settings that shape stored data, since every compaction rewrites the store under the setting it was opened with. Only meaningful when GREMLIN_TINKERGRAPH_STORAGE is set.
      See Also:
    • GREMLIN_TINKERGRAPH_STORAGE_RECOVER

      static final String GREMLIN_TINKERGRAPH_STORAGE_RECOVER
      Whether a TinkerStorageGraph opens a damaged store by recovering what it can rather than failing. Defaults to false. When enabled, damaged records are skipped where that is safe, the graph is read-only, and nothing in the storage directory is changed, so the recovered graph can be exported with g.io() into a new storage directory. Only meaningful when GREMLIN_TINKERGRAPH_STORAGE is set.
      See Also:
    • GREMLIN_TINKERGRAPH_ALLOW_NULL_PROPERTY_VALUES

      static final String GREMLIN_TINKERGRAPH_ALLOW_NULL_PROPERTY_VALUES
      See Also:
    • GREMLIN_TINKERGRAPH_SERVICE

      static final String GREMLIN_TINKERGRAPH_SERVICE
      See Also:
    • GREMLIN_TINKERGRAPH_VERTEX_LABEL_CARDINALITY

      static final String GREMLIN_TINKERGRAPH_VERTEX_LABEL_CARDINALITY
      See Also:
  • Method Details

    • open

      static TinkerGraph open()
      Open a new TinkerMemoryGraph instance.
    • open

      static TinkerGraph open(org.apache.commons.configuration2.Configuration configuration)
      Open a new TinkerMemoryGraph instance with the specified configuration. This method is the one used by GraphFactory to instantiate Graph instances when the gremlin.graph configuration key names this interface.
      Parameters:
      configuration - the configuration for the instance
      Returns:
      a newly opened Graph
    • createIndex

      <E extends Element> void createIndex(String key, Class<E> elementClass)
      Create an index for said element class (Vertex or Edge) and said property key. Whenever an element has the specified key mutated, the index is updated. When the index is created, all existing elements are indexed to ensure that they are captured by the index.
      Type Parameters:
      E - The type of the element class
      Parameters:
      key - the property key to index
      elementClass - the element class to index
    • dropIndex

      <E extends Element> void dropIndex(String key, Class<E> elementClass)
      Drop the index for the specified element class (Vertex or Edge) and key.
      Type Parameters:
      E - The type of the element class
      Parameters:
      key - the property key to stop indexing
      elementClass - the element class of the index to drop
    • getIndexedKeys

      <E extends Element> Set<String> getIndexedKeys(Class<E> elementClass)
      Return all the keys currently being index for said element class (Vertex or Edge).
      Type Parameters:
      E - The type of the element class
      Parameters:
      elementClass - the element class to get the indexed keys for
      Returns:
      the set of keys currently being indexed
    • clear

      void clear()
      Clear internal graph data.
    • close

      void close()
      TinkerGraph implementations do not throw checked exceptions on close().
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Graph
    • getServiceRegistry

      TinkerServiceRegistry getServiceRegistry()
      Gets the registry of service factories for call() steps.
      Specified by:
      getServiceRegistry in interface Graph
      Returns:
      The registry of callable services