Class IndexDefinitions
java.lang.Object
org.apache.tinkerpop.gremlin.tinkergraph.structure.storage.IndexDefinitions
The set of property keys a persistent graph indexes, held in a small file beside the storage engine's own files.
Index definitions are deliberately kept out of the transactional log. An index is purely an optimization, so losing
a definition to a crash costs a rebuild rather than any data: a crash between
createIndex and the write here
drops a definition the caller can recreate, and one after dropIndex resurrects an index that is dropped
again. Neither can change a query result, which is what makes a file outside the write-ahead log an honest place to
keep this. Nothing that affects correctness may be stored this way.
The file is line oriented and readable, one record per line: V or E, a tab, then the property key
with backslash, tab, newline and carriage return escaped, so a key containing any of them survives a round trip.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedgeKeys()booleanisEmpty()static IndexDefinitionsRead the definitions recorded indirectory, or an empty set if none have been recorded.voidReplace the definitions recorded indirectory.
-
Constructor Details
-
IndexDefinitions
-
-
Method Details
-
vertexKeys
-
edgeKeys
-
isEmpty
public boolean isEmpty() -
read
Read the definitions recorded indirectory, or an empty set if none have been recorded. A file that cannot be read is reported and treated as empty rather than raised. The graph then opens with no indexes, which is exactly how it behaved before definitions were recorded at all, so an unreadable file can never make a store less openable than the data it holds. -
write
Replace the definitions recorded indirectory. Written to a temporary file, forced to the device and renamed into place, so a crash leaves either the previous set or the new one and never a partial file.
-