com.twitter.cassovary.util.io

AdjacencyListGraphReader

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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AdjacencyListGraphReader(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
    AdjacencyListGraphReaderGraphReaderFromDirectory
  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
    AdjacencyListGraphReaderGraphReader
  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
    AdjacencyListGraphReaderGraphReaderFromDirectory
  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
    AdjacencyListGraphReaderGraphReaderFromDirectory
  24. val separator: String

    Separator between node ids forming edge.

    Separator between node ids forming edge.

    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