Class Configuration.Builder

  • Enclosing class:
    Configuration

    public static class Configuration.Builder
    extends Object
    Configuration builder.

    Note that this class is not thread-safe.

    • Method Detail

      • build

        public Configuration build()
        Builds the configuration.
        Returns:
        the configuration
      • nodeIdType

        public Configuration.Builder nodeIdType​(Class nodeIdType)
        Sets the node id type.

        Only simple types such as primitives, wrappers and String are supported.

        Default is String.class.

        Parameters:
        nodeIdType - node id type
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if the type isn't supported
      • edgeIdType

        public Configuration.Builder edgeIdType​(Class edgeIdType)
        Sets the edge id type.

        Only simple types such as primitives, wrappers and String are supported.

        Default is String.class.

        Parameters:
        edgeIdType - edge id type
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if the type isn't supported
      • edgeLabelType

        public Configuration.Builder edgeLabelType​(Class edgeLabelType)
        Sets the edge label type.

        Only simple types such as primitives, wrappers and String are supported.

        Default is String.class.

        Parameters:
        edgeLabelType - edge label type
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if the type isn't supported
      • edgeWeightType

        public Configuration.Builder edgeWeightType​(Class edgeWeightType)
        Sets the edge weight type.

        Double, IntervalDoubleMap and TimestampDoubleMap are supported.

        Default is Double.class.

        Parameters:
        edgeWeightType - edge weight type
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if the type isn't supported
      • timeRepresentation

        public Configuration.Builder timeRepresentation​(TimeRepresentation timeRepresentation)
        Sets the time representation.

        Default is TIMESTAMP.

        Parameters:
        timeRepresentation - time representation
        Returns:
        this builder
      • edgeWeightColumn

        public Configuration.Builder edgeWeightColumn​(boolean edgeWeightColumn)
        Sets whether to create an edge weight column.

        Default is true.

        Parameters:
        edgeWeightColumn - edge weight column
        Returns:
        this builder
      • enableObservers

        public Configuration.Builder enableObservers​(boolean enableObservers)
        Sets whether to enable observers on tables and columns.

        Default is true.

        Parameters:
        enableObservers - enable observers
        Returns:
        this builder
      • enableAutoEdgeTypeRegistration

        public Configuration.Builder enableAutoEdgeTypeRegistration​(boolean enableAutoEdgeTypeRegistration)
        Sets whether to enable auto edge type registration.

        If enabled, edge types are automatically registered when edges are added. If disabled, one needs to call GraphModel.addEdgeType(Object) explicitly for each type.

        Default is true.

        Parameters:
        enableAutoEdgeTypeRegistration - enable auto edge type registration
        Returns:
        this builder
      • enableNodeProperties

        public Configuration.Builder enableNodeProperties​(boolean enableNodeProperties)
        Sets whether to enable node properties.

        If enabled, NodeProperties are created for each node. If those properties aren't needed, disabling them can save memory.

        Default is true.

        Parameters:
        enableNodeProperties - enable node properties
        Returns:
        this builder
      • enableEdgeProperties

        public Configuration.Builder enableEdgeProperties​(boolean enableEdgeProperties)
        Sets whether to enable edge properties.

        If enabled, EdgeProperties are created for each edge. If those properties aren't needed, disabling them can save memory.

        Default is true.

        Parameters:
        enableEdgeProperties - enable edge properties
        Returns:
        this builder
      • enableSpatialIndex

        public Configuration.Builder enableSpatialIndex​(boolean enableSpatialIndex)
        Sets whether to enable the SpatialIndex.

        If enabled, the spatial index is updated while node positions are updated. If unused, disabling it is recommended as it adds some overhead.

        The spatial index can be retrieved from Graph.getSpatialIndex().

        Default is false.

        Parameters:
        enableSpatialIndex - enable edge properties
        Returns:
        this builder
      • enableIndexNodes

        public Configuration.Builder enableIndexNodes​(boolean enableIndexNodes)
        Sets whether to enable the reverse indexing of node attributes.

        If enabled, the reverse index is updated while node attributes are updated. This powers GraphModel.getNodeIndex() but has a negative impact on memory usage (as any reverse index does). When disabled, the features of Index are still available but need to iterate over all nodes to return results.

        Default is true.

        Parameters:
        enableIndexNodes - enable node attribute indexing
        Returns:
        this builder
      • enableIndexEdges

        public Configuration.Builder enableIndexEdges​(boolean enableIndexEdges)
        Sets whether to enable the reverse indexing of edge attributes.

        If enabled, the reverse index is updated while node attributes are updated. This powers GraphModel.getEdgeIndex() but has a negative impact on memory usage (as any reverse index does). When disabled, the features of Index are still available but need to iterate over all nodes to return results.

        Default is true.

        Parameters:
        enableIndexEdges - enable edge attribute indexing
        Returns:
        this builder
      • enableIndexTime

        public Configuration.Builder enableIndexTime​(boolean enableIndexTime)
        Sets whether to enable the reverse indexing of timestamps and intervals.

        If enabled, the reverse index is updated while element's time set is updated. This powers GraphModel.getNodeTimeIndex() and GraphModel.getEdgeTimeIndex() ()} but has a negative impact on memory usage (as any reverse index does).

        Default is true.

        Parameters:
        enableIndexTime - enable time indexing
        Returns:
        this builder
      • enableParallelEdgesSameType

        public Configuration.Builder enableParallelEdgesSameType​(boolean enableParallelEdgesSameType)
        Sets whether to enable multiple edges of the same type between two nodes.

        If disabled, only a single edge of a given type can exist between two nodes.

        Default is false.

        Parameters:
        enableParallelEdgesSameType - enable parallel edges of the same type
        Returns:
        this builder
      • enableAutoLocking

        public Configuration.Builder enableAutoLocking​(boolean enableAutoLocking)
        Sets whether to enable auto locking when using read/write APIs.

        If disabled, the client is responsible for handling multithreading themselves or calling methods such as Graph.readLock() or Graph.writeLock(). If enabled, each read methods (including iterators) handle locking. Similarly, each write method handle locking.

        Default is true.

        Parameters:
        enableAutoLocking - enable auto locking for read/write operations
        Returns:
        this builder
        See Also:
        GraphLock