abstract class NodeDb extends Node
Holds node properties and edges to adjacent nodes (including edge properties).
Each {NodeRef
} refers to exactly one NodeDb instance, and if required can set that instance to null
, thus
freeing up memory, e.g. if heap memory is low. While {NodeRef
} instances are very small (they will never be
garbage collected), NodeDb instances consume a bit more space.
Adjacent nodes and edge properties are stored in a flat array (adjacentNodesWithEdgeProperties). Edges only exist virtually and are created on request. This allows for a small memory footprint, especially given that most graph domains have magnitudes more edges than nodes.
All write operations are synchronized using synchronized(this)
, in order to avoid race conditions when updating the adjacent nodes.
Read operations are not locked, i.e. they are fast because they do not wait, but they may read outdated data.
- Alphabetic
- By Inheritance
- NodeDb
- Node
- NodeOrDetachedNode
- Element
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new NodeDb(ref: NodeRef)
- Attributes
- protected[overflowdb]
Abstract Value Members
- abstract def layoutInformation(): NodeLayoutInformation
- abstract def property(key: String): AnyRef
- Definition Classes
- Element
- abstract def removeSpecificProperty(key: String): Unit
- Attributes
- protected[overflowdb]
- abstract def updateSpecificProperty(key: String, value: AnyRef): Unit
- Attributes
- protected[overflowdb]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def _initializeFromDetached(data: DetachedNodeData, mapper: Function[DetachedNodeData, Node]): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- Node
- def addEdgeImpl(label: String, inNode: Node, keyValues: Map[String, AnyRef]): Edge
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Node
- Annotations
- @Override()
- def addEdgeImpl(label: String, inNode: Node, keyValues: <repeated...>[AnyRef]): Edge
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Node
- Annotations
- @Override()
- def addEdgeSilentImpl(label: String, inNode: Node, keyValues: Map[String, AnyRef]): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Node
- Annotations
- @Override()
- def addEdgeSilentImpl(label: String, inNode: Node, keyValues: <repeated...>[AnyRef]): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Node
- Annotations
- @Override()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def blockLength(adjacentNodesTmp: AdjacentNodes, offsetPosition: Int): Int
Returns the length of an edge type block in the adjacentNodesWithEdgeProperties array.
Returns the length of an edge type block in the adjacentNodesWithEdgeProperties array. Length means number of index positions.
- final def blockOffsetToOccurrence(direction: Direction, label: String, otherNode: NodeRef, blockOffset: Int): Int
If there are multiple edges between the same two nodes with the same label, we use the
occurrence
to differentiate between those edges.If there are multiple edges between the same two nodes with the same label, we use the
occurrence
to differentiate between those edges. Both nodes use the same occurrence index for the same edge.- returns
the occurrence for a given edge, calculated by counting the number times the given adjacent node occurred between the start of the edge-specific block and the blockOffset
- Attributes
- protected[overflowdb]
- def both(edgeLabels: <repeated...>[String]): Iterator[Node]
- def both(): Iterator[Node]
- def bothE(edgeLabels: <repeated...>[String]): Iterator[Edge]
- def bothE(): Iterator[Edge]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def createAdjacentNodeIteratorByOffSet[A <: Node](offsetPos: Int): Iterator[A]
- final def createAdjacentNodeScalaIteratorByOffSet[A <: Node](offsetPos: Int): Iterator[A]
- def edgeProperty[P](direction: Direction, edge: Edge, blockOffset: Int, key: String): P
- def edgePropertyMap(direction: Direction, edge: Edge, blockOffset: Int): Map[String, AnyRef]
returns a Map of all explicitly set properties of an edge, i.e.
returns a Map of all explicitly set properties of an edge, i.e. does not contain the properties which have the default value
- def edgePropertyOption[V](direction: Direction, edge: Edge, blockOffset: Int, key: String): Optional[V]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(obj: AnyRef): Boolean
- Definition Classes
- NodeDb → AnyRef → Any
- Annotations
- @Override()
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def getAdjacentNodes(): AdjacentNodes
Gets the adjacent nodes with properties, in internal packed format.
Gets the adjacent nodes with properties, in internal packed format. This function is really package-private, and only formally public to simplify internal organization of overflowdb.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getEdgeProperties[V](direction: Direction, edge: Edge, blockOffset: Int, keys: <repeated...>[String]): Iterator[V]
- final def getStrideSize(edgeLabel: String): Int
- returns
number of elements reserved in
adjacentNodesWithEdgeProperties
for a given edge label includes space for the node ref and all properties
- def graph(): Graph
- def hashCode(): Int
- Definition Classes
- NodeDb → AnyRef → Any
- Annotations
- @Override()
- def id(): Long
- def in(edgeLabels: <repeated...>[String]): Iterator[Node]
- def in(): Iterator[Node]
- def inE(edgeLabels: <repeated...>[String]): Iterator[Edge]
- def inE(): Iterator[Edge]
- final def instantiateDummyEdge(label: String, outNode: NodeRef, inNode: NodeRef): Edge
instantiate and return a dummy edge, which doesn't really exist in the graph
- final def isDirty(): Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def label(): String
- def markAsClean(): Unit
- def markAsDirty(): Unit
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def occurrenceToBlockOffset(direction: Direction, label: String, adjacentNode: NodeRef, occurrence: Int): Int
- direction
OUT or IN
- label
the edge label
- occurrence
if there are multiple edges between the same two nodes with the same label, this is used to differentiate between those edges. Both nodes use the same occurrence index in their
adjacentNodesWithEdgeProperties
array for the same edge.- returns
the index into
adjacentNodesWithEdgeProperties
- Attributes
- protected[overflowdb]
- def out(edgeLabels: <repeated...>[String]): Iterator[Node]
- def out(): Iterator[Node]
- def outE(edgeLabels: <repeated...>[String]): Iterator[Edge]
- def outE(): Iterator[Edge]
- def outEdgeCount(): Int
- Attributes
- protected[overflowdb]
- def propertiesMap(): Map[String, AnyRef]
Map with all properties, including the default property values which haven't been explicitly set
- def propertiesMapForStorage(): Map[String, AnyRef]
All properties *but* the default values, to ensure we don't serialize those.
All properties *but* the default values, to ensure we don't serialize those. Providing a default implementation here, but the codegen overrides this for efficiency. Properties may have different runtime types here than what they have in
properties()
, e.g. if the domain classes use primitive arrays for efficiency. - def property[A](key: PropertyKey[A]): A
- def property[A](key: PropertyKey[A], defaultValue: A): A
- Definition Classes
- Element
- def property[A](key: String, defaultValue: A): A
- Definition Classes
- Element
- def propertyDefaultValue(propertyKey: String): AnyRef
override this in specific element class, to define a default value
- def propertyKeys(): Set[String]
- def propertyOption(key: String): Optional[AnyRef]
- def propertyOption[A](key: PropertyKey[A]): Optional[A]
- final def removeEdge(direction: Direction, label: String, blockOffset: Int): Unit
Removes an 'edge', i.e.
Removes an 'edge', i.e. in reality it removes the information about the adjacent node from
adjacentNodesWithEdgeProperties
. The corresponding elements will be set tonull
, i.e. we'll have holes. Note: this decrements theoffset
of the following edges in the same block by one, but that's ok because the only thing that matters is that the offset is identical for both connected nodes (assuming thread safety).- blockOffset
must have been initialized
- Attributes
- protected[overflowdb]
- def removeEdgeProperty(direction: Direction, edgeLabel: String, key: String, blockOffset: Int): Unit
- def removeImpl(): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Element
- Annotations
- @Override()
- def removePropertyImpl(key: String): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Element
- Annotations
- @Override()
- def setEdgeProperty[V](direction: Direction, edgeLabel: String, key: String, value: V, blockOffset: Int): Unit
- def setPropertyImpl(property: Property[_ <: AnyRef]): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Element
- Annotations
- @Override()
- def setPropertyImpl[A](key: PropertyKey[A], value: A): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Element
- Annotations
- @Override()
- def setPropertyImpl(key: String, value: AnyRef): Unit
- Attributes
- protected[overflowdb]
- Definition Classes
- NodeDb → Element
- Annotations
- @Override()
- def startIndex(adjacentNodesTmp: AdjacentNodes, offsetPosition: Int): Int
- def storeAdjacentNode(direction: Direction, edgeLabel: String, adjacentNode: NodeRef, edgeKeyValues: <repeated...>[AnyRef]): Int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def trim(): Long
Trims the node to save storage: shrinks overallocations
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- final def addEdge(label: String, inNode: Node, keyValues: Map[String, AnyRef]): Edge
Add an outgoing edge to the node with provided label and edge properties as key/value pairs.
Add an outgoing edge to the node with provided label and edge properties as key/value pairs.
- Definition Classes
- Node
- Annotations
- @Deprecated
- Deprecated
- final def addEdge(label: String, inNode: Node, keyValues: <repeated...>[AnyRef]): Edge
Add an outgoing edge to the node with provided label and edge properties as key/value pairs.
Add an outgoing edge to the node with provided label and edge properties as key/value pairs. These key/values must be provided in an even number where the odd numbered arguments are
String
property keys and the even numbered arguments are the related property values.- Definition Classes
- Node
- Annotations
- @Deprecated
- Deprecated
- final def addEdgeSilent(label: String, inNode: Node, keyValues: Map[String, AnyRef]): Unit
Add an outgoing edge to the node with provided label and edge properties as key/value pairs.
Add an outgoing edge to the node with provided label and edge properties as key/value pairs. Just like
addEdge2}}, but doesn't instantiate and return a dummy edge
- Definition Classes
- Node
- Annotations
- @Deprecated
- Deprecated
- final def addEdgeSilent(label: String, inNode: Node, keyValues: <repeated...>[AnyRef]): Unit
Add an outgoing edge to the node with provided label and edge properties as key/value pairs.
Add an outgoing edge to the node with provided label and edge properties as key/value pairs. These key/values must be provided in an even number where the odd numbered arguments are
String
property keys and the even numbered arguments are the related property values. Just likeaddEdge2}}, but doesn't instantiate and return a dummy edge
- Definition Classes
- Node
- Annotations
- @Deprecated
- Deprecated
- final def remove(): Unit
- Definition Classes
- Element
- Annotations
- @Deprecated
- Deprecated
- final def removeProperty(key: String): Unit
- Definition Classes
- Element
- Annotations
- @Deprecated
- Deprecated
- final def setProperty(property: Property[_ <: AnyRef]): Unit
- Definition Classes
- Element
- Annotations
- @Deprecated
- Deprecated
- final def setProperty[A](key: PropertyKey[A], value: A): Unit
- Definition Classes
- Element
- Annotations
- @Deprecated
- Deprecated
- final def setProperty(key: String, value: AnyRef): Unit
- Definition Classes
- Element
- Annotations
- @Deprecated
- Deprecated