Chapter 3. Some fundamentals
Listing 3.1. helloworld.sbt
Listing 3.2. hellworld.scala
Chapter 4. GraphX Basics
Listing 4.1. Construct a graph as shown in figure 4.3
Listing 4.2. Retrieve the edges from the just-constructed graph
Listing 4.3. Get a triplet(s) version of the graph data
Listing 4.4. Add Boolean annotation to edges indicating a condition
Listing 4.5. Using aggregateMessages[]() to compute the out-degree of each vertex
Listing 4.6. RDD join() to match up VertexIds with vertex data
Listing 4.7. map() and swap() to clean up output
Listing 4.8. rightOuterJoin() instead of join() to pull in “forgotten” vertices
Listing 4.9. Option[]’s getOrElse() to clean up rightOuterJoin() output
Listing 4.10. Iterated (via recursion) Map/Reduce to find distance of furthest vertex
Listing 4.11. Round-trip persisting to and reading from file
Listing 4.12. Saving to a single file in HDFS using the Hadoop Java API
Listing 4.13. Command line commands to use jackson-module-scala in the REPL
Listing 4.14. Naïve approach to serialize to JSON
Listing 4.15. Better performing way to serialize/deserialize to/from JSON
Listing 4.16. Export to GEXF for Gephi visualization software
Listing 4.17. Generate a grid graph
Listing 4.18. Generate a star graph
Listing 4.19. Generate a log normal graph
Listing 4.20. Generate an R-MAT graph
Listing 4.21. Pregel to find distance of furthest vertex
Chapter 5. Built-in algorithms
Listing 5.1. Personalized PageRank to find the most important related paper