Class OrientGraph
java.lang.Object
org.apache.tinkerpop.gremlin.orientdb.OrientGraph
- All Implemented Interfaces:
AutoCloseable,OGraph,org.apache.tinkerpop.gremlin.structure.Graph,org.apache.tinkerpop.gremlin.structure.util.Host
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Graph
org.apache.tinkerpop.gremlin.structure.Graph.Exceptions, org.apache.tinkerpop.gremlin.structure.Graph.Features, org.apache.tinkerpop.gremlin.structure.Graph.Hidden, org.apache.tinkerpop.gremlin.structure.Graph.OptIn, org.apache.tinkerpop.gremlin.structure.Graph.OptIns, org.apache.tinkerpop.gremlin.structure.Graph.OptOut, org.apache.tinkerpop.gremlin.structure.Graph.OptOuts, org.apache.tinkerpop.gremlin.structure.Graph.Variables -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final org.apache.commons.configuration2.Configurationprotected ODatabaseDocumentprotected OElementFactoryprotected OrientGraphBaseFactoryprotected final org.apache.tinkerpop.gremlin.structure.Graph.Featuresprotected final Stringprotected booleanprotected OrientTransactionprotected final StringFields inherited from interface org.apache.tinkerpop.gremlin.structure.Graph
GRAPH -
Constructor Summary
ConstructorsConstructorDescriptionOrientGraph(OrientGraphBaseFactory factory, ODatabaseDocument database, org.apache.commons.configuration2.Configuration configuration, String user, String password) OrientGraph(OrientGraphBaseFactory factory, org.apache.commons.configuration2.Configuration configuration) OrientGraph(OrientGraphBaseFactory factory, org.apache.commons.configuration2.Configuration configuration, boolean closeFactory) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.tinkerpop.gremlin.structure.Vertexvoidbegin()classNameToLabel(String className) Convert a orientdb class name to labelvoidclose()voidcommit()org.apache.tinkerpop.gremlin.process.computer.GraphComputercompute()<C extends org.apache.tinkerpop.gremlin.process.computer.GraphComputer>
Corg.apache.commons.configuration2.Configurationprotected ObjectconvertValue(OIndex idx, Object iValue) voidcreateClass(String className, OClass superClass) voidcreateClass(String className, String superClassName) createEdgeClass(String label) <E extends org.apache.tinkerpop.gremlin.structure.Element>
voidcreateEdgeIndex(String key, String label, org.apache.commons.configuration2.Configuration configuration) protected static ORIDcreateRecordId(Object id) createVertexClass(String label) <E extends org.apache.tinkerpop.gremlin.structure.Element>
voidcreateVertexIndex(String key, String label, org.apache.commons.configuration2.Configuration configuration) database()voiddrop()(Blueprints Extension) Drops the databaseIterator<org.apache.tinkerpop.gremlin.structure.Edge>protected <A extends org.apache.tinkerpop.gremlin.structure.Element>
Iterator<A><RET> RETexecute(OCallable<RET, OrientGraph> iCallable, String... iOperationStrings) executeSql(String sql, Object... params) executeSql(String sql, Map params) <T> TexecuteWithRetry(int nRetries, Function<OrientGraph, T> function) Tries to execute a lambda in a transaction, retrying it if an ONeedRetryException is thrown.booleanexistClass(String label) org.apache.tinkerpop.gremlin.structure.Graph.Featuresfeatures()protected <E> StringgetClassName(Class<org.apache.tinkerpop.gremlin.structure.T> elementClass) getEdgeIndexedKeys(String label) getIndexedEdges(OIndex index, Iterator<Object> valueIter) getIndexedKeys(Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementClass) getIndexedKeys(Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementClass, String label) getIndexedKeys(String className) getIndexedVertices(OIndex index, Iterator<Object> valueIter) protected OElementgetRawDocument(ORecord record) protected ORecordgetVertexIndexedKeys(String label) <I extends org.apache.tinkerpop.gremlin.structure.io.Io>
Iio(org.apache.tinkerpop.gremlin.structure.io.Io.Builder<I> builder) booleanisClosed()Checks if the Graph has been closed.protected booleanlabelToClassName(String label, String prefix) Convert a label to orientdb class namevoidstatic OrientGraphopen()static OrientGraphstatic OrientGraphstatic OrientGraphopen(org.apache.commons.configuration2.Configuration config) protected voidprepareIndexConfiguration(org.apache.commons.configuration2.Configuration config) voidrollback()voidsetElementFactory(OElementFactory elementFactory) toString()tx()org.apache.tinkerpop.gremlin.structure.Graph.VariablesIterator<org.apache.tinkerpop.gremlin.structure.Vertex>Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tinkerpop.gremlin.structure.Graph
addVertex, getServiceRegistry, traversal, traversal, tx
-
Field Details
-
CONFIG_URL
- See Also:
-
CONFIG_DB_NAME
- See Also:
-
CONFIG_DB_TYPE
- See Also:
-
CONFIG_USER
- See Also:
-
CONFIG_PASS
- See Also:
-
CONFIG_CREATE
- See Also:
-
CONFIG_OPEN
- See Also:
-
CONFIG_TRANSACTIONAL
- See Also:
-
CONFIG_POOL_SIZE
- See Also:
-
CONFIG_MAX_PARTITION_SIZE
- See Also:
-
CONFIG_LABEL_AS_CLASSNAME
- See Also:
-
database
-
features
protected final org.apache.tinkerpop.gremlin.structure.Graph.Features features -
configuration
protected final org.apache.commons.configuration2.Configuration configuration -
user
-
password
-
factory
-
shouldCloseFactory
protected boolean shouldCloseFactory -
elementFactory
-
tx
-
-
Constructor Details
-
OrientGraph
public OrientGraph(OrientGraphBaseFactory factory, ODatabaseDocument database, org.apache.commons.configuration2.Configuration configuration, String user, String password) -
OrientGraph
public OrientGraph(OrientGraphBaseFactory factory, org.apache.commons.configuration2.Configuration configuration) -
OrientGraph
public OrientGraph(OrientGraphBaseFactory factory, org.apache.commons.configuration2.Configuration configuration, boolean closeFactory)
-
-
Method Details
-
open
-
open
-
open
-
open
-
features
public org.apache.tinkerpop.gremlin.structure.Graph.Features features()- Specified by:
featuresin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
database
-
makeActive
public void makeActive() -
addVertex
- Specified by:
addVertexin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
executeSql
-
executeSql
- Specified by:
executeSqlin interfaceOGraph
-
querySql
-
querySql
-
execute
-
compute
public <C extends org.apache.tinkerpop.gremlin.process.computer.GraphComputer> C compute(Class<C> graphComputerClass) throws IllegalArgumentException - Specified by:
computein interfaceorg.apache.tinkerpop.gremlin.structure.Graph- Throws:
IllegalArgumentException
-
compute
public org.apache.tinkerpop.gremlin.process.computer.GraphComputer compute() throws IllegalArgumentException- Specified by:
computein interfaceorg.apache.tinkerpop.gremlin.structure.Graph- Throws:
IllegalArgumentException
-
elementFactory
- Specified by:
elementFactoryin interfaceOGraph
-
vertices
- Specified by:
verticesin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
labelToClassName
Convert a label to orientdb class name- Specified by:
labelToClassNamein interfaceOGraph
-
classNameToLabel
Convert a orientdb class name to label- Specified by:
classNameToLabelin interfaceOGraph
-
executeWithRetry
Tries to execute a lambda in a transaction, retrying it if an ONeedRetryException is thrown.If the Graph has an active transaction, then the transaction has to be empty (no operations executed yet) and after the execution you will be in a new transaction.
- Type Parameters:
T- the return type of the lambda- Parameters:
nRetries- the maximum number of retries (> 0)function- a lambda containing application code to execute in a commit/retry loop- Returns:
- The result of the execution of the lambda
- Throws:
IllegalStateException- if there are operations in the current transactionONeedRetryException- if the maximum number of retries is executed and all failed with an ONeedRetryExceptionIllegalArgumentException- if nRetries is <= 0UnsupportedOperationException- if this type of graph does not support automatic commit/retry or does not support transactions
-
convertValue
-
getIndexedVertices
- Specified by:
getIndexedVerticesin interfaceOGraph
-
getIndexedEdges
- Specified by:
getIndexedEdgesin interfaceOGraph
-
getIndexedKeys
-
getIndexedKeys
public Set<String> getIndexedKeys(Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementClass, String label) - Specified by:
getIndexedKeysin interfaceOGraph
-
getIndexedKeys
-
getVertexIndexedKeys
-
getEdgeIndexedKeys
-
edges
- Specified by:
edgesin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
elements
-
getRecord
-
createRecordId
-
getRawDocument
-
tx
- Specified by:
txin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
drop
public void drop()(Blueprints Extension) Drops the database -
isClosed
public boolean isClosed()Checks if the Graph has been closed.- Returns:
- True if it is closed, otherwise false
-
begin
public void begin() -
commit
public void commit() -
rollback
public void rollback() -
variables
public org.apache.tinkerpop.gremlin.structure.Graph.Variables variables()- Specified by:
variablesin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
configuration
public org.apache.commons.configuration2.Configuration configuration()- Specified by:
configurationin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
createVertexClass
- Specified by:
createVertexClassin interfaceOGraph
-
createEdgeClass
- Specified by:
createEdgeClassin interfaceOGraph
-
createClass
-
existClass
- Specified by:
existClassin interfaceOGraph
-
createClass
-
getRawDatabase
- Specified by:
getRawDatabasein interfaceOGraph
-
getClassName
-
prepareIndexConfiguration
protected void prepareIndexConfiguration(org.apache.commons.configuration2.Configuration config) -
createVertexIndex
-
createEdgeIndex
-
execute
public <RET> RET execute(OCallable<RET, OrientGraph> iCallable, String... iOperationStrings) throws RuntimeException- Throws:
RuntimeException
-
io
public <I extends org.apache.tinkerpop.gremlin.structure.io.Io> I io(org.apache.tinkerpop.gremlin.structure.io.Io.Builder<I> builder) - Specified by:
ioin interfaceorg.apache.tinkerpop.gremlin.structure.Graph
-
toString
-
isTransactionActive
protected boolean isTransactionActive() -
setElementFactory
-