Class OrientConfigurableGraph
java.lang.Object
com.tinkerpop.blueprints.impls.orient.OrientConfigurableGraph
- Direct Known Subclasses:
OrientBaseGraph,OrientGraphFactory
Base class to manage graph settings.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com) (http://orientdb.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final booleanprotected static final booleanprotected static final intprotected static final intprotected static final booleanprotected static final booleanprotected static final booleanprotected OrientConfigurableGraph.Settingsprotected static final booleanprotected static final booleanprotected static final intprotected static final booleanprotected static final OrientConfigurableGraph.THREAD_MODEprotected static final booleanprotected static final booleanprotected static final booleanprotected static final booleanprotected static final booleanprotected static final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddeclareIntent(OIntent iIntent) intReturns the minimum number of edges for edge containers to transform the underlying structure from embedded to tree.intReturns the minimum number of edges for edge containers to transform the underlying structure from tree to embedded.intReturns the maximum number of retries in case of auto managed OConcurrentModificationException (like addEdge).protected abstract ObjectgetProperty(String iName) Returns the current thread mode: MANUAL the user has to manually invoke the current database in Thread Local: ODatabaseRecordThreadLocal.instance().set(graph.getRawGraph()); AUTOSET_IFNULL (default) each call assures the current graph instance is set in the Thread Local only if no one was set before ALWAYS_AUTOSET each call assures the current graph instance is set in the Thread Localprotected voidinit(org.apache.commons.configuration.Configuration configuration) Builds a OrientGraph instance passing a configuration.booleanReturns true if is using auto scale edge type, otherwise false.booleanTells if a transaction is started automatically when the graph is changed.booleanReturns true if the references are kept in memory.booleanbooleanReturns true if it saves the original Id, otherwise false.booleanReturns true if Blueprints standard constraints are applied to elements.booleanReturns true if Blueprints standard exceptions are used: IllegalStateException instead of ORecordNotFoundException when the record was not foundbooleanReturns true if usage of transactions is needed on graph modification for SQL commands (create/remove vertex, create/remove edge).booleanReturns true if the class are use for Edge labels.booleanReturns true if the class are use for Vertex labels.booleanReturns true if is using lightweight edges, otherwise false.booleanReturns true if the out/in fields in vertex are post-fixed with edge labels.booleanReturns true if the warning is generated on force the graph closing.setAutoScaleEdgeType(boolean autoScaleEdgeType) Changes the setting about usage of auto scale edge type.voidsetAutoStartTx(boolean autoStartTx) If enabled auto starts a new transaction right before the graph is changed.voidsetConnectionStrategy(String connectionStrategy) setEdgeContainerEmbedded2TreeThreshold(int edgeContainerEmbedded2TreeThreshold) Changes the minimum number of edges for edge containers to transform the underlying structure from embedded to tree.setEdgeContainerTree2EmbeddedThreshold(int edgeContainerTree2EmbeddedThreshold) Changes the minimum number of edges for edge containers to transform the underlying structure from tree to embedded.setKeepInMemoryReferences(boolean useReferences) Changes the setting about using references in memory.voidsetMaxRetries(int maxRetries) Changes the maximum number of retries in case of auto managed OConcurrentModificationException (like addEdge).protected abstract ObjectsetProperty(String iName, Object iValue) voidsetRequireTransaction(boolean requireTransaction) setSaveOriginalIds(boolean saveIds) Changes the setting about usage of lightweight edges.setStandardElementConstraints(boolean allowsPropertyValueNull) Changes the setting to apply the Blueprints standard constraints against elements.setStandardExceptions(boolean stdExceptions) Changes the setting to throw Blueprints standard exceptions: IllegalStateException instead of ORecordNotFoundException when the record was not foundChanges the thread mode: MANUAL the user has to manually invoke the current database in Thread Local: ODatabaseRecordThreadLocal.instance().set(graph.getRawGraph()); AUTOSET_IFNULL (default) each call assures the current graph instance is set in the Thread Local only if no one was set before ALWAYS_AUTOSET each call assures the current graph instance is set in the Thread LocalsetTxRequiredForSQLGraphOperations(boolean useTransaction) Changes the setting about usage of transactions on graph modification for SQL commands (create/remove vertex, create/remove edge).setUseClassForEdgeLabel(boolean useCustomClassesForEdges) Changes the setting to use the Edge class for Edge labels.setUseClassForVertexLabel(boolean useCustomClassesForVertex) Deprecated.setUseLightweightEdges(boolean useDynamicEdges) Changes the setting about usage of lightweight edges.setUseLog(boolean useLog) setUseVertexFieldsForEdgeLabels(boolean useVertexFieldsForEdgeLabels) Deprecated.setWarnOnForceClosingTx(boolean warnOnSchemaChangeInTx) Changes the setting to generate a warning if the graph closing has been forced.
-
Field Details
-
settings
-
USE_LIGHTWEIGHT_EDGES_DEFAULT
protected static final boolean USE_LIGHTWEIGHT_EDGES_DEFAULT- See Also:
-
USE_CLASS_FOR_EDGE_LABEL_DEFAULT
protected static final boolean USE_CLASS_FOR_EDGE_LABEL_DEFAULT- See Also:
-
USE_CLASS_FOR_VERTEX_LABEL_DEFAULT
protected static final boolean USE_CLASS_FOR_VERTEX_LABEL_DEFAULT- See Also:
-
KEEP_IN_MEMORY_REFERENCES_DEFAULT
protected static final boolean KEEP_IN_MEMORY_REFERENCES_DEFAULT- See Also:
-
USE_VERTEX_FIELDS_FOR_EDGE_LABELS
protected static final boolean USE_VERTEX_FIELDS_FOR_EDGE_LABELS- See Also:
-
SAVE_ORIGINAL_IDS_DEFAULT
protected static final boolean SAVE_ORIGINAL_IDS_DEFAULT- See Also:
-
STANDARD_ELEMENT_CONSTRAINTS_DEFAULT
protected static final boolean STANDARD_ELEMENT_CONSTRAINTS_DEFAULT- See Also:
-
STANDARD_EXCEPTIONS
protected static final boolean STANDARD_EXCEPTIONS- See Also:
-
WARN_ON_FORCE_CLOSING_TX_DEFAULT
protected static final boolean WARN_ON_FORCE_CLOSING_TX_DEFAULT- See Also:
-
AUTO_SCALE_EDGE_TYPE_DEFAULT
protected static final boolean AUTO_SCALE_EDGE_TYPE_DEFAULT- See Also:
-
USE_LOG_DEFAULT
protected static final boolean USE_LOG_DEFAULT- See Also:
-
EDGE_CONTAINER_EMBEDDED_2_TREE_THRESHOLD_DEFAULT
protected static final int EDGE_CONTAINER_EMBEDDED_2_TREE_THRESHOLD_DEFAULT- See Also:
-
EDGE_CONTAINER_TREE_2_EMBEDDED_THRESHOLD_DEFAULT
protected static final int EDGE_CONTAINER_TREE_2_EMBEDDED_THRESHOLD_DEFAULT- See Also:
-
THREAD_MODE_DEFAULT
-
AUTO_START_TX_DEFAULT
protected static final boolean AUTO_START_TX_DEFAULT- See Also:
-
REQUIRE_TRANSACTION_DEFAULT
protected static final boolean REQUIRE_TRANSACTION_DEFAULT- See Also:
-
STANDARD_TX_REQUIRE_FOR_SQL_OPERATIONS
protected static final boolean STANDARD_TX_REQUIRE_FOR_SQL_OPERATIONS- See Also:
-
STANDARD_MAX_RETRIES
protected static final int STANDARD_MAX_RETRIES- See Also:
-
-
Constructor Details
-
OrientConfigurableGraph
protected OrientConfigurableGraph()
-
-
Method Details
-
declareIntent
-
isUseLightweightEdges
public boolean isUseLightweightEdges()Returns true if is using lightweight edges, otherwise false. -
setUseLightweightEdges
Changes the setting about usage of lightweight edges. -
isTxRequiredForSQLGraphOperations
public boolean isTxRequiredForSQLGraphOperations()Returns true if usage of transactions is needed on graph modification for SQL commands (create/remove vertex, create/remove edge).- Since:
- v2.2.0
-
setTxRequiredForSQLGraphOperations
Changes the setting about usage of transactions on graph modification for SQL commands (create/remove vertex, create/remove edge).- Since:
- v2.2.0
-
isAutoScaleEdgeType
public boolean isAutoScaleEdgeType()Returns true if is using auto scale edge type, otherwise false. -
setAutoScaleEdgeType
Changes the setting about usage of auto scale edge type. -
getEdgeContainerEmbedded2TreeThreshold
public int getEdgeContainerEmbedded2TreeThreshold()Returns the minimum number of edges for edge containers to transform the underlying structure from embedded to tree. -
setEdgeContainerEmbedded2TreeThreshold
public OrientConfigurableGraph setEdgeContainerEmbedded2TreeThreshold(int edgeContainerEmbedded2TreeThreshold) Changes the minimum number of edges for edge containers to transform the underlying structure from embedded to tree. Use -1 to disable transformation. -
getEdgeContainerTree2EmbeddedThreshold
public int getEdgeContainerTree2EmbeddedThreshold()Returns the minimum number of edges for edge containers to transform the underlying structure from tree to embedded. -
setEdgeContainerTree2EmbeddedThreshold
public OrientConfigurableGraph setEdgeContainerTree2EmbeddedThreshold(int edgeContainerTree2EmbeddedThreshold) Changes the minimum number of edges for edge containers to transform the underlying structure from tree to embedded. Use -1 to disable transformation. -
isAutoStartTx
public boolean isAutoStartTx()Tells if a transaction is started automatically when the graph is changed. This affects only when a transaction hasn't been started. Default is true.- Returns:
-
setAutoStartTx
public void setAutoStartTx(boolean autoStartTx) If enabled auto starts a new transaction right before the graph is changed. This affects only when a transaction hasn't been started. Default is true.- Parameters:
autoStartTx-
-
isRequireTransaction
public boolean isRequireTransaction() -
setRequireTransaction
public void setRequireTransaction(boolean requireTransaction) -
isSaveOriginalIds
public boolean isSaveOriginalIds()Returns true if it saves the original Id, otherwise false. -
setSaveOriginalIds
Changes the setting about usage of lightweight edges. -
isKeepInMemoryReferences
public boolean isKeepInMemoryReferences()Returns true if the references are kept in memory. -
setKeepInMemoryReferences
Changes the setting about using references in memory. -
isUseClassForEdgeLabel
public boolean isUseClassForEdgeLabel()Returns true if the class are use for Edge labels. -
setUseClassForEdgeLabel
Changes the setting to use the Edge class for Edge labels. -
isUseClassForVertexLabel
public boolean isUseClassForVertexLabel()Returns true if the class are use for Vertex labels. -
setUseClassForVertexLabel
@Deprecated public OrientConfigurableGraph setUseClassForVertexLabel(boolean useCustomClassesForVertex) Deprecated.Changes the setting to use the Vertex class for Vertex labels. -
isUseVertexFieldsForEdgeLabels
public boolean isUseVertexFieldsForEdgeLabels()Returns true if the out/in fields in vertex are post-fixed with edge labels. This improves traversal time by partitioning edges on different collections, one per Edge's class. -
setUseVertexFieldsForEdgeLabels
@Deprecated public OrientConfigurableGraph setUseVertexFieldsForEdgeLabels(boolean useVertexFieldsForEdgeLabels) Deprecated.Changes the setting to postfix vertices fields with edge labels. This improves traversal time by partitioning edges on different collections, one per Edge's class. -
isStandardElementConstraints
public boolean isStandardElementConstraints()Returns true if Blueprints standard constraints are applied to elements. -
setStandardElementConstraints
Changes the setting to apply the Blueprints standard constraints against elements. -
isStandardExceptions
public boolean isStandardExceptions()Returns true if Blueprints standard exceptions are used:-
IllegalStateException instead of ORecordNotFoundException when the record was not found
-
setStandardExceptions
Changes the setting to throw Blueprints standard exceptions:-
IllegalStateException instead of ORecordNotFoundException when the record was not found
-
isWarnOnForceClosingTx
public boolean isWarnOnForceClosingTx()Returns true if the warning is generated on force the graph closing. -
setWarnOnForceClosingTx
Changes the setting to generate a warning if the graph closing has been forced. -
getThreadMode
Returns the current thread mode:- MANUAL the user has to manually invoke the current database in Thread Local: ODatabaseRecordThreadLocal.instance().set(graph.getRawGraph());
- AUTOSET_IFNULL (default) each call assures the current graph instance is set in the Thread Local only if no one was set before
- ALWAYS_AUTOSET each call assures the current graph instance is set in the Thread Local
- Returns:
- Current Graph instance to allow calls in chain (fluent interface)
- See Also:
-
setThreadMode
Changes the thread mode:- MANUAL the user has to manually invoke the current database in Thread Local: ODatabaseRecordThreadLocal.instance().set(graph.getRawGraph());
- AUTOSET_IFNULL (default) each call assures the current graph instance is set in the Thread Local only if no one was set before
- ALWAYS_AUTOSET each call assures the current graph instance is set in the Thread Local
- Parameters:
iControl- Value to set- Returns:
- Current Graph instance to allow calls in chain (fluent interface)
- See Also:
-
setUseLog
-
getConnectionStrategy
-
setConnectionStrategy
-
getMaxRetries
public int getMaxRetries()Returns the maximum number of retries in case of auto managed OConcurrentModificationException (like addEdge). -
setMaxRetries
public void setMaxRetries(int maxRetries) Changes the maximum number of retries in case of auto managed OConcurrentModificationException (like addEdge). -
init
protected void init(org.apache.commons.configuration.Configuration configuration) Builds a OrientGraph instance passing a configuration. Supported configuration settings are:Name Description Default value blueprints.orientdb.url Database URL - blueprints.orientdb.username User name admin blueprints.orientdb.password User password admin blueprints.orientdb.saveOriginalIds Saves the original element IDs by using the property origId. This could be useful on import of graph to preserve original ids false blueprints.orientdb.keepInMemoryReferences Avoid to keep records in memory but only RIDs false blueprints.orientdb.useCustomClassesForEdges Use Edge's label as OrientDB class. If doesn't exist create it under the hood true blueprints.orientdb.useCustomClassesForVertex Use Vertex's label as OrientDB class. If doesn't exist create it under the hood true blueprints.orientdb.useVertexFieldsForEdgeLabels Store the edge relationships in vertex by using the Edge's class. This allow to use multiple fields and make faster traversal by edge's label (class) true blueprints.orientdb.lightweightEdges Uses lightweight edges. This avoid to create a physical document per edge. Documents are created only when they have properties true blueprints.orientdb.autoScaleEdgeType Set auto scale of edge type. True means one edge is managed as LINK, 2 or more are managed with a LINKBAG false blueprints.orientdb.edgeContainerEmbedded2TreeThreshold Changes the minimum number of edges for edge containers to transform the underlying structure from embedded to tree. Use -1 to disable transformation -1 blueprints.orientdb.edgeContainerTree2EmbeddedThreshold Changes the minimum number of edges for edge containers to transform the underlying structure from tree to embedded. Use -1 to disable transformation -1 - Parameters:
configuration- of graph
-
setProperty
-
getProperty
-
getProperties
-