class JanusGraphDB extends GraphDB
Constructor and Description |
---|
JanusGraphDB() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.tinkerpop.gremlin.structure.Graph |
connectGraphDBImpl(org.apache.commons.configuration.Configuration configuration)
Obtain a graph DB with the connection details specified in the given
Configuration . |
protected void |
createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db,
java.lang.String key,
java.lang.Class<?> datatype,
boolean element,
boolean uniq)
Create a single-property index in the given graph DB.
|
private boolean |
reindex(org.janusgraph.core.JanusGraph graph,
org.janusgraph.core.schema.JanusGraphManagement mgmt,
java.lang.String idx)
Attempt to reindex the specified index (which was newly created).
|
createIndex, obtainGraphDB
protected org.apache.tinkerpop.gremlin.structure.Graph connectGraphDBImpl(org.apache.commons.configuration.Configuration configuration)
Configuration
.connectGraphDBImpl
in class GraphDB
configuration
- The connection details.protected void createIndexImpl(org.apache.tinkerpop.gremlin.structure.Graph db, java.lang.String key, java.lang.Class<?> datatype, boolean element, boolean uniq)
TODO: multiple properties and custom index backends. At this time the custom backend option does not support unique indexes so this has been avoided.
createIndexImpl
in class GraphDB
db
- The graph DB.key
- The property key name to be indexed. This will also be the index name.datatype
- The key's type.element
- true
if the vertex element should be indexed, otherwise the edge element
will be indexed.uniq
- true
if the index should enforce uniqueness of the given key.private boolean reindex(org.janusgraph.core.JanusGraph graph, org.janusgraph.core.schema.JanusGraphManagement mgmt, java.lang.String idx)
graph
- The graph database instance.mgmt
- The current management object in which the index was created.idx
- The name of the index.true
if the reindexing was successful, false
otherwise.