com.twitter.cassovary.util.io

ListOfEdgesGraphReader

Related Docs: object ListOfEdgesGraphReader | package io

class ListOfEdgesGraphReader[T] extends GraphReaderFromDirectory[T]

Reads in a multi-line list of edges from multiple files in a directory, which nodes have ids of type T. Does not check for duplicate edges or nodes.

You can optionally specify which files in a directory to read. For example, you may have files starting with "part-" that you'd like to read. Only these will be read in if you specify that as the file prefix.

You should also specify nodeNumberer, idReader for reading node ids.

For a default version for Int graphs see ListOfEdgesGraphReader.forIntIds builder method.

In each file, a directed edges is defined by a pair of T: from and to. For example, we use String ids with (space) separator, when reading file:

a b
b d
d c
a e
...

In this file, node a has two outgoing edges (to b and e), node b has an outgoing edge to node d and node d has an outgoing edge to node c.

Note that, it is recommended to use AdjacencyListGraphReader, because of its efficiency.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ListOfEdgesGraphReader
  2. GraphReaderFromDirectory
  3. GraphReader
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ListOfEdgesGraphReader(directory: String, prefixFileNames: String, nodeNumberer: NodeNumberer[T], idReader: (String) ⇒ T)

    directory

    the directory to read from

    prefixFileNames

    the string that each part file starts with

    nodeNumberer

    nodeNumberer to use with node ids

    idReader

    function that can read id from String

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. val directory: String

    the directory to read from

    the directory to read from

    Definition Classes
    ListOfEdgesGraphReaderGraphReaderFromDirectory
  7. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  9. def executorService: ExecutorService

    Override to use multiple threads

    Override to use multiple threads

    Definition Classes
    GraphReader
  10. def finalize(): Unit

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

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

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. def iteratorSeq: Seq[() ⇒ Iterator[NodeIdEdgesMaxId]]

    Should return a sequence of iterators over NodeIdEdgesMaxId objects

    Should return a sequence of iterators over NodeIdEdgesMaxId objects

    Definition Classes
    GraphReaderFromDirectoryGraphReader
  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. val nodeNumberer: NodeNumberer[T]

    nodeNumberer to use with node ids

    nodeNumberer to use with node ids

    Definition Classes
    ListOfEdgesGraphReaderGraphReader
  17. final def notify(): Unit

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

    Definition Classes
    AnyRef
  19. def oneShardReader(filename: String): Iterator[NodeIdEdgesMaxId]

    Returns a reader for a given file (shard).

    Returns a reader for a given file (shard).

    Definition Classes
    ListOfEdgesGraphReaderGraphReaderFromDirectory
  20. def parallelismLimit: Int

    Definition Classes
    GraphReader
  21. val prefixFileNames: String

    the string that each part file starts with

    the string that each part file starts with

    Definition Classes
    ListOfEdgesGraphReaderGraphReaderFromDirectory
  22. val separator: String

    Attributes
    protected
  23. def storedGraphDir: StoredGraphDir

    Override to modify the graph's stored direction

    Override to modify the graph's stored direction

    Definition Classes
    GraphReader
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toArrayBasedDirectedGraph(): ArrayBasedDirectedGraph

    Create an ArrayBasedDirectedGraph

    Create an ArrayBasedDirectedGraph

    Definition Classes
    GraphReader
  26. def toSharedArrayBasedDirectedGraph(numShards: Int = 128): SharedArrayBasedDirectedGraph

    Create a SharedArrayBasedDirectedGraph

    Create a SharedArrayBasedDirectedGraph

    numShards

    Number of shards to split the in-memory array into 128 is an arbitrary default

    Definition Classes
    GraphReader
  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from GraphReaderFromDirectory[T]

Inherited from GraphReader[T]

Inherited from AnyRef

Inherited from Any

Ungrouped