Interface TinkerGraph
- All Superinterfaces:
AutoCloseable,Graph,Host
- All Known Implementing Classes:
AbstractTinkerGraph,TinkerMemoryGraph,TinkerStorageGraph
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)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumA default set ofTinkerGraph.IdManagerimplementations for common identifier types.static interfaceTinkerGraph will use an implementation of this interface to generate identifiers when a user does not supply them and to handle identifier conversions when querying to provide better flexibility with respect to handling different data types that mean the same thing.Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Graph
Graph.Exceptions, Graph.Features, Graph.Hidden, Graph.Index, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringSelects the pluggable storage engine used byTinkerStorageGraphto durably persist transactions to theGREMLIN_TINKERGRAPH_STORAGE_DIRECTORYdirectory.static final StringThe size in bytes at which aTinkerStorageGraphstorage 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.static final StringThe filesystem directory that aTinkerStorageGraphstorage engine uses for its durable data.static final StringWhether aTinkerStorageGraphstorage engine persists vertex-property ids so they are stable across a close and reopen.static final StringWhether aTinkerStorageGraphopens a damaged store by recovering what it can rather than failing.static final StringThe durability mode aTinkerStorageGraphstorage engine applies on commit.static final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear internal graph data.voidclose()TinkerGraph implementations do not throw checked exceptions onclose().<E extends Element>
voidcreateIndex(String key, Class<E> elementClass) <E extends Element>
voidgetIndexedKeys(Class<E> elementClass) Gets the registry of service factories forcall()steps.static TinkerGraphopen()Open a newTinkerMemoryGraphinstance.static TinkerGraphopen(org.apache.commons.configuration2.Configuration configuration) Open a newTinkerMemoryGraphinstance with the specified configuration.
-
Field Details
-
GREMLIN_TINKERGRAPH_VERTEX_ID_MANAGER
- See Also:
-
GREMLIN_TINKERGRAPH_EDGE_ID_MANAGER
- See Also:
-
GREMLIN_TINKERGRAPH_VERTEX_PROPERTY_ID_MANAGER
- See Also:
-
GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY
- See Also:
-
GREMLIN_TINKERGRAPH_STORAGE
Selects the pluggable storage engine used byTinkerStorageGraphto durably persist transactions to theGREMLIN_TINKERGRAPH_STORAGE_DIRECTORYdirectory. The value is either aorg.apache.tinkerpop.gremlin.tinkergraph.structure.storage.DefaultStorageenum name (e.g.graphbinary) or the fully-qualified class name of aorg.apache.tinkerpop.gremlin.tinkergraph.structure.storage.TinkerStorageimplementation. When unset, the graph holds data only in memory. Ignored byTinkerMemoryGraph, which logs a warning when this or any othergremlin.tinkergraph.storage.*key is set.- See Also:
-
GREMLIN_TINKERGRAPH_STORAGE_DIRECTORY
The filesystem directory that aTinkerStorageGraphstorage engine uses for its durable data. Ignored, with a warning, byTinkerMemoryGraph, which is purely in-memory. Only meaningful whenGREMLIN_TINKERGRAPH_STORAGEis also set.- See Also:
-
GREMLIN_TINKERGRAPH_STORAGE_SYNC
The durability mode aTinkerStorageGraphstorage engine applies on commit. Eithercommit(default) tofsyncevery commit so acknowledged commits survive an OS crash or power loss, orosto 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 whenGREMLIN_TINKERGRAPH_STORAGEis set. Seeorg.apache.tinkerpop.gremlin.tinkergraph.structure.storage.SyncMode.- See Also:
-
GREMLIN_TINKERGRAPH_STORAGE_COMPACT_THRESHOLD
The size in bytes at which aTinkerStorageGraphstorage 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 to0to disable automatic compaction and rely onclose()or an explicitcompact(). Only meaningful whenGREMLIN_TINKERGRAPH_STORAGEis set.- See Also:
-
GREMLIN_TINKERGRAPH_STORAGE_PRESERVE_VP_IDS
Whether aTinkerStorageGraphstorage engine persists vertex-property ids so they are stable across a close and reopen. Defaults tofalse: 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 whenGREMLIN_TINKERGRAPH_STORAGEis set.- See Also:
-
GREMLIN_TINKERGRAPH_STORAGE_RECOVER
Whether aTinkerStorageGraphopens a damaged store by recovering what it can rather than failing. Defaults tofalse. 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 withg.io()into a new storage directory. Only meaningful whenGREMLIN_TINKERGRAPH_STORAGEis set.- See Also:
-
GREMLIN_TINKERGRAPH_ALLOW_NULL_PROPERTY_VALUES
- See Also:
-
GREMLIN_TINKERGRAPH_SERVICE
- See Also:
-
GREMLIN_TINKERGRAPH_VERTEX_LABEL_CARDINALITY
- See Also:
-
-
Method Details
-
open
Open a newTinkerMemoryGraphinstance. -
open
Open a newTinkerMemoryGraphinstance with the specified configuration. This method is the one used byGraphFactoryto instantiateGraphinstances when thegremlin.graphconfiguration key names this interface.- Parameters:
configuration- the configuration for the instance- Returns:
- a newly opened
Graph
-
createIndex
Create an index for said element class (VertexorEdge) 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 indexelementClass- the element class to index
-
dropIndex
- Type Parameters:
E- The type of the element class- Parameters:
key- the property key to stop indexingelementClass- the element class of the index to drop
-
getIndexedKeys
- 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 onclose().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceGraph
-
getServiceRegistry
TinkerServiceRegistry getServiceRegistry()Gets the registry of service factories forcall()steps.- Specified by:
getServiceRegistryin interfaceGraph- Returns:
- The registry of callable services
-