zoukankan      html  css  js  c++  java
  • Spark GraphX

    1 Overview
    GraphX is a new component in Spark for graphs and graph-parallel computation. At a high level, GraphX extends the Spark RDD by introducing a new Graph abstraction: a directed multigraph with properties attached to each vertex and edge. 
    Migrating from Spark 1.1

    2 Getting Started

    3 The Property Graph
    Example Property Graph
    The EdgeTriplet class extends the Edge class by adding the srcAttr and dstAttr members which contain the source and destination properties respectively. 
    4 Graph Operators
    The core operators that have optimized implementations are defined in Graph and convenient operators that are expressed as a compositions of the core operators are defined in GraphOps. However, thanks to Scala implicits the operators in GraphOps are automatically available as members of Graph. For example, we can compute the in-degree of each vertex (defined in GraphOps) by the following:
    4.1 Summary List of Operators

    4.2 Property Operators
    mapVertices、mapEdges、mapTriplets
    Each of these operators yields a new graph with the vertex or edge properties modified by the user defined map function.
    Note that in each case the graph structure is unaffected. This is a key feature of these operators which allows the resulting graph to reuse the structural indices of the original graph.
    eg: the first one does not preserve the structural indices and would not benefit from the GraphX system optimizations:
         val newVertices = graph.vertices.map { case (id, attr) => (id, mapUdf(id, attr)) }
         val newGraph = Graph(newVertices, graph.edges)
    Instead, use mapVertices to preserve the indices:
         val newGraph = graph.mapVertices((id, attr) => mapUdf(id, attr))
    4.3 Structural Operators
    reverse、subgraph、mask、groupEdges
    reverse: The reverse operator returns a new graph with all the edge directions reversed.

    4.4 Join Operators
    joinVertices、outJoinVertices

    4.5 Neighborhood Aggregation
    mapReduceTriplets、maxInDegree、collectNeighbors
     
    Aggregate Messages (aggregateMessages)
    Map Reduce Triplets Transition Guide (Legacy)
    Computing Degree Information
    Collecting Neighbors
     

    4.6 Caching and Uncaching
    cache、unpersistVertices

    5 Pregel API

    6 Graph Builders

    7 Vertex and Edge RDDs
    7.1 VertexRDDs

    7.2 EdgeRDDs

    8 Optimized Representation

    9 Graph Algorithms
    9.1 PageRank

    9.2 Connected Components

    9.3 Triangle Counting

    10 Examples

     

  • 相关阅读:
    LoadRunner利用ODBC编写MySql脚本(转)
    未在本地计算机上注册 microsoft.jet.oledb.4.0 提供程序
    趣文:舌尖上的程序猿
    Hadoop之我见
    C语言的经典排序算法源码
    Oracle自学笔记(一)
    log4j.properties 详解与配置步骤总结
    修改oracle用户密码永不过期
    Android 发送短信总结
    CEF禁止右键菜单
  • 原文地址:https://www.cnblogs.com/sunflower627/p/4997662.html
Copyright © 2011-2022 走看看