Class OrientConfigurableGraph

java.lang.Object
com.tinkerpop.blueprints.impls.orient.OrientConfigurableGraph
Direct Known Subclasses:
OrientBaseGraph, OrientGraphFactory

public abstract class OrientConfigurableGraph extends Object
Base class to manage graph settings.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com) (http://orientdb.com)
  • 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

      protected static final OrientConfigurableGraph.THREAD_MODE 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

      public abstract void declareIntent(OIntent iIntent)
    • isUseLightweightEdges

      public boolean isUseLightweightEdges()
      Returns true if is using lightweight edges, otherwise false.
    • setUseLightweightEdges

      public OrientConfigurableGraph setUseLightweightEdges(boolean useDynamicEdges)
      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

      public OrientConfigurableGraph setTxRequiredForSQLGraphOperations(boolean useTransaction)
      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

      public OrientConfigurableGraph setAutoScaleEdgeType(boolean autoScaleEdgeType)
      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

      public OrientConfigurableGraph setSaveOriginalIds(boolean saveIds)
      Changes the setting about usage of lightweight edges.
    • isKeepInMemoryReferences

      public boolean isKeepInMemoryReferences()
      Returns true if the references are kept in memory.
    • setKeepInMemoryReferences

      public OrientConfigurableGraph setKeepInMemoryReferences(boolean useReferences)
      Changes the setting about using references in memory.
    • isUseClassForEdgeLabel

      public boolean isUseClassForEdgeLabel()
      Returns true if the class are use for Edge labels.
    • setUseClassForEdgeLabel

      public OrientConfigurableGraph setUseClassForEdgeLabel(boolean useCustomClassesForEdges)
      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

      public OrientConfigurableGraph setStandardElementConstraints(boolean allowsPropertyValueNull)
      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

      public OrientConfigurableGraph setStandardExceptions(boolean stdExceptions)
      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

      public OrientConfigurableGraph setWarnOnForceClosingTx(boolean warnOnSchemaChangeInTx)
      Changes the setting to generate a warning if the graph closing has been forced.
    • getThreadMode

      public OrientConfigurableGraph.THREAD_MODE 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

      public OrientConfigurableGraph setUseLog(boolean useLog)
    • getConnectionStrategy

      public String getConnectionStrategy()
    • setConnectionStrategy

      public void setConnectionStrategy(String connectionStrategy)
    • 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

      protected abstract Object setProperty(String iName, Object iValue)
    • getProperty

      protected abstract Object getProperty(String iName)
    • getProperties

      protected abstract Map<String,Object> getProperties()