com.twitter.cassovary.util.io

ListOfEdgesGraphReader

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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val directory: String

    the directory to read from

    the directory to read from

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

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

    Definition Classes
    AnyRef → Any
  11. def executorService: ExecutorService

    Override to use multiple threads

    Override to use multiple threads

    Definition Classes
    GraphReader
  12. def finalize(): Unit

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

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

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

    Definition Classes
    Any
  16. 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
  17. final def ne(arg0: AnyRef): Boolean

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

    nodeNumberer to use with node ids

    nodeNumberer to use with node ids

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

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

    Definition Classes
    AnyRef
  21. 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
  22. def parallelismLimit: Int

    Definition Classes
    GraphReader
  23. val prefixFileNames: String

    the string that each part file starts with

    the string that each part file starts with

    Definition Classes
    ListOfEdgesGraphReaderGraphReaderFromDirectory
  24. val separator: String

    Attributes
    protected
  25. def storedGraphDir: StoredGraphDir

    Override to modify the graph's stored direction

    Override to modify the graph's stored direction

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

    Definition Classes
    AnyRef
  27. def toArrayBasedDirectedGraph(): ArrayBasedDirectedGraph

    Create an ArrayBasedDirectedGraph

    Create an ArrayBasedDirectedGraph

    Definition Classes
    GraphReader
  28. 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
  29. def toString(): String

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. 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