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. Each edge is in its own line and is of the form: source-id<separator>destination-id where separator is a single character.

One can optionally specify which files in a directory to read. For example, one may have files starting with "part-" that one would like to read, perhaps containing subgraphs of one single graph.

One can optionally specify two additional operations during reading: - to remove duplicate edges - to sort list of adjacent nodes

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, Int, Int) ⇒ T, removeDuplicates: Boolean = false, sortNeighbors: Boolean = false, separator: Char = ' ')

    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

    removeDuplicates

    if false (default), the edges are guaranteed to be unique

    sortNeighbors

    if true, the neighbors of a node should be sorted by this class

    separator

    the character that separates the source and destination ids

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 finalize(): Unit

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

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

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

    Definition Classes
    Any
  13. def iterableSeq: Seq[Iterable[NodeIdEdgesMaxId]]

    Should return a sequence of NodeIdEdgesMaxId iterables

    Should return a sequence of NodeIdEdgesMaxId iterables

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

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

    nodeNumberer to use with node ids

    nodeNumberer to use with node ids

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

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

    Definition Classes
    AnyRef
  18. def oneShardReader(filename: String): Iterable[NodeIdEdgesMaxId]

    Returns a reader for a given file (shard).

    Returns a reader for a given file (shard).

    Definition Classes
    ListOfEdgesGraphReaderGraphReaderFromDirectory
  19. def parallelismLimit: Int

    Definition Classes
    GraphReader
  20. val prefixFileNames: String

    the string that each part file starts with

    the string that each part file starts with

    Definition Classes
    ListOfEdgesGraphReaderGraphReaderFromDirectory
  21. def reverseParseNode(n: NodeIdEdgesMaxId): String

    The reader knows the format as it knows how to read the file.

    The reader knows the format as it knows how to read the file. This reverse parses the input n to a string in that same format.

    Definition Classes
    ListOfEdgesGraphReaderGraphReader
  22. def storedGraphDir: StoredGraphDir

    Override to modify the graph's stored direction

    Override to modify the graph's stored direction

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

    Definition Classes
    AnyRef
  24. def toArrayBasedDirectedGraph(neighborsSortingStrategy: NeighborsSortingStrategy = LeaveUnsorted, forceSparseRepr: Option[Boolean] = None): ArrayBasedDirectedGraph

    Create an ArrayBasedDirectedGraph

    Create an ArrayBasedDirectedGraph

    Definition Classes
    GraphReader
  25. def toArrayBasedDynamicDirectedGraph(): ArrayBasedDynamicDirectedGraph

    Create an ArrayBasedDynamicDirectedGraph

    Create an ArrayBasedDynamicDirectedGraph

    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