co.teapot.tempest.graph

MemoryMappedDirectedGraph

Related Docs: object MemoryMappedDirectedGraph | package graph

class MemoryMappedDirectedGraph extends DirectedGraph

A graph which reads edge data from a memory mapped file. There is no object overhead per node: the memory used for with both in-neighbor and out-neighbor access is 8 bytes per edge and 8 bytes per node. Loading is very fast because no parsing of text is required. Loading time is exactly the time it takes the operating system to page data from disk into memory. Nodes are numbered sequentially from 0 to nodeCount - 1 and must be a range of this form (i.e. nodeCount == maxNodeId + 1).

Graphs are converted to this format using MemoryMappedDirectedGraphConverter, then loaded using this class. When transforming a graph where nodeCount <= maxNodeId to this format, new nodes with no neighbors will be implicitly created. The binary format is currently subject to change.

Linear Supertypes
DirectedGraph, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MemoryMappedDirectedGraph
  2. DirectedGraph
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MemoryMappedDirectedGraph(file: File)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def defaultNeighbors(id: Int): IndexedSeq[Int]

    Called by other methods when given an id that doesn't exist in this graph.

    Called by other methods when given an id that doesn't exist in this graph. By default it throws an exception, but implementations can override it to return an IndexedSeq which is the neighbor seq of non-existing nodes (typically an empty IndexedSeq).

    Definition Classes
    DirectedGraph
  7. val edgeCount: Long

    The number of edges in this graph.

    The number of edges in this graph.

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def existsNode(id: Int): Boolean

  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. def inDegree(id: Int): Int

    Returns the number of in-neighbors of the given id.

    Returns the number of in-neighbors of the given id.

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  15. def inDegreeOr0(id: Int): Int

    Returns the in-degree of the given node id, or 0 if the node id does not exist.

    Returns the in-degree of the given node id, or 0 if the node id does not exist.

    Definition Classes
    DirectedGraph
  16. def inNeighbor(id: Int, i: Int): Int

    Returns the ith in-neighbor of the node with the given id.

    Returns the ith in-neighbor of the node with the given id. Throws IndexOutOfBoundsException unless 0 <= i < inDegree(id).

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  17. def inNeighborList(id: Int): List[Integer]

    Returns the in-neighbors of the given id as a java.util.List.

    Returns the in-neighbors of the given id as a java.util.List.

    Definition Classes
    DirectedGraph
  18. def inNeighbors(id: Int): IndexedSeq[Int]

    Returns the in-neighbors of the given id.

    Returns the in-neighbors of the given id.

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def maxNodeId: Int

    The largest node id in this graph (or an upper bound on it).

    The largest node id in this graph (or an upper bound on it).

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. val nodeCount: Int

    Returns the nodeCount if it is defined.

    Returns the nodeCount if it is defined. Otherwise throws an UnsupportedOperationException.

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  23. def nodeCountOption: Option[Int]

    The number of nodes in this graph.

    The number of nodes in this graph. May return None if it is expensive to compute (for example, for the union of two graphs).

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  24. def nodeIds: Iterable[Int]

    All nodeIds that exist in the graph.

    All nodeIds that exist in the graph.

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def outDegree(id: Int): Int

    Returns the number of out-neighbors of the given id.

    Returns the number of out-neighbors of the given id.

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  28. def outDegreeOr0(id: Int): Int

    Returns the out-degree of the given node id, or 0 if the node id does not exist.

    Returns the out-degree of the given node id, or 0 if the node id does not exist.

    Definition Classes
    DirectedGraph
  29. def outNeighbor(id: Int, i: Int): Int

    Returns the ith out-neighbor of the node with the given id.

    Returns the ith out-neighbor of the node with the given id. Throws IndexOutOfBoundsException unless 0 <= i < outDegree(id).

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  30. def outNeighborList(id: Int): List[Integer]

    Returns the out-neighbors of the given id as a java.util.List.

    Returns the out-neighbors of the given id as a java.util.List.

    Definition Classes
    DirectedGraph
  31. def outNeighbors(id: Int): IndexedSeq[Int]

    Returns the out-neighbors of the given id.

    Returns the out-neighbors of the given id.

    Definition Classes
    MemoryMappedDirectedGraphDirectedGraph
  32. def preloadToRAM(): Unit

    Loads the graph data into physical RAM, so later graph operations don't have lag.

    Loads the graph data into physical RAM, so later graph operations don't have lag. Makes a "best effort" (see MappedByteBuffer.load()).

  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  34. def toString(): String

    Definition Classes
    DirectedGraph → AnyRef → Any
  35. def transposeView: DirectedGraph

    Returns a view of the transpose of this graph.

    Returns a view of the transpose of this graph.

    Definition Classes
    DirectedGraph
  36. def uniformRandomInNeighbor(id: Int, random: Random = Random.self): Int

    Definition Classes
    DirectedGraph
  37. def uniformRandomOutNeighbor(id: Int, random: Random = Random.self): Int

    Definition Classes
    DirectedGraph
  38. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def getNodeById(id: Int): Option[NodeWrapper]

    Returns the node with the given id or else None if the given node does not exist in this graph.

    Returns the node with the given id or else None if the given node does not exist in this graph. Deprecated: to decrease the number of objects used, get node neighbors and degrees directly through the graph.

    Definition Classes
    DirectedGraph
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) Rather than using Node objects, use graph method directly

Inherited from DirectedGraph

Inherited from AnyRef

Inherited from Any

Ungrouped