Class/Object

com.twitter.cassovary.util.io

AdjacencyListGraphReader

Related Docs: object AdjacencyListGraphReader | package io

Permalink

class AdjacencyListGraphReader[T] extends GraphReaderFromDirectory[T]

Reads in a multi-line adjacency list from multiple files in a directory, where ids are 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.

In each file, a node and its neighbors is defined by the first line being that node's id and its # of neighbors, followed by that number of ids on subsequent lines. For example, when ids are Ints, 241 3 2 4 1 53 1 241 ... In this file, node 241 has 3 neighbors, namely 2, 4 and 1. Node 53 has 1 neighbor, 241.

Similarly, when ids are String, input file should follow the example: Alice 2 Bob Chris Bob 1 Chris Chris 1 Bob ... In this file Alice has 2 directed edges to Bob and Chris, Bob has an edge to Chris, and Chris has outgoing edge to Bob. *

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AdjacencyListGraphReader
  2. GraphReaderFromDirectory
  3. GraphReader
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

    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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

    Permalink

    the directory to read from

    the directory to read from

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

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

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

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

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

    Permalink

    Should return a sequence of NodeIdEdgesMaxId iterables

    Should return a sequence of NodeIdEdgesMaxId iterables

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

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

    Permalink

    nodeNumberer to use with node ids

    nodeNumberer to use with node ids

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

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

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

    Permalink

    Returns a reader for a given file (shard).

    Returns a reader for a given file (shard).

    Definition Classes
    AdjacencyListGraphReaderGraphReaderFromDirectory
  19. def parallelismLimit: Int

    Permalink
    Definition Classes
    GraphReader
  20. val prefixFileNames: String

    Permalink

    the string that each part file starts with

    the string that each part file starts with

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

    Permalink

    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
    AdjacencyListGraphReaderGraphReader
  22. val separator: String

    Permalink

    Separator between node ids forming edge.

    Separator between node ids forming edge.

    Attributes
    protected
  23. def storedGraphDir: StoredGraphDir

    Permalink

    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

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

    Permalink

    Create an ArrayBasedDirectedGraph

    Create an ArrayBasedDirectedGraph

    Definition Classes
    GraphReader
  26. def toArrayBasedDynamicDirectedGraph(): ArrayBasedDynamicDirectedGraph

    Permalink

    Create an ArrayBasedDynamicDirectedGraph

    Create an ArrayBasedDynamicDirectedGraph

    Definition Classes
    GraphReader
  27. def toSharedArrayBasedDirectedGraph(forceSparseRepr: Option[Boolean] = None): SharedArrayBasedDirectedGraph

    Permalink
    Definition Classes
    GraphReader
  28. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from GraphReaderFromDirectory[T]

Inherited from GraphReader[T]

Inherited from AnyRef

Inherited from Any

Ungrouped