SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Introducing Apache Giraph for
 Large Scale Graph Processing

 Sebastian Schelter

 PhD student at the Database Systems and Information
 Management Group of TU Berlin

 Committer and PMC member at Apache Mahout and Apache Giraph

 mail ssc@apache.org blog http://ssc.io
Graph recap
graph: abstract representation of a set of objects
(vertices), where some pairs of these objects are
connected by links (edges), which can be directed or
undirected

Graphs can be used to model arbitrary things like
road networks, social networks, flows of goods, etc.

Majority of graph algorithms             B

are iterative and traverse
the graph in some way              A             D

                                             C
Real world graphs are really large!
• the World Wide Web has several billion pages
  with several billion links
• Facebook‘s social graph had more than 700
  million users and more than 68 billion
  friendships in 2011
• twitter‘s social graph has billions of follower
  relationships
Why not use MapReduce/Hadoop?
• Example: PageRank, Google‘s famous algorithm for
  measuring the authority of a webpage based on the
  underlying network of hyperlinks
• defined recursively: each vertex distributes its
  authority to its neighbors in equal proportions


                             pj
   pi                      dj
          j  ( j , i ) 
Textbook approach to
           PageRank in MapReduce
• PageRank p is the principal eigenvector of the Markov matrix
  M defined by the transition probabilities between web pages
• it can be obtained by iteratively multiplying an initial
  PageRank vector by M (power iteration)

    p  M p0
              k



       row 1 of M         ∙
       row 2 of M         ∙    pi
                                                            pi+1



       row n of M         ∙
Drawbacks
• Not intuitive: only crazy scientists
  think in matrices and eigenvectors
• Unnecessarily slow: Each iteration is scheduled
  as separate MapReduce job with lots of overhead
  –   the graph structure is read from disk
  –   the map output is spilled to disk
  –   the intermediary result is written to HDFS
• Hard to implement: a join has to be implemented
  by hand, lots of work, best strategy is data
  dependent
Google Pregel
• distributed system especially developed for
  large scale graph processing
• intuitive API that let‘s you ‚think like a vertex‘
• Bulk Synchronous Parallel (BSP) as execution
  model
• fault tolerance by checkpointing
Bulk Synchronous Parallel (BSP)
                    processors




local computation


                                 superstep



communication


barrier
synchronization
Vertex-centric BSP
• each vertex has an id, a value, a list of its adjacent vertex ids and the
  corresponding edge values
• each vertex is invoked in each superstep, can recompute its value and
  send messages to other vertices, which are delivered over superstep
  barriers
• advanced features : termination votes, combiners, aggregators, topology
  mutations
          vertex1                vertex1                 vertex1



          vertex2                vertex2                 vertex2



          vertex3                vertex3                 vertex3


        superstep i          superstep i + 1           superstep i + 2
Master-slave architecture
• vertices are partitioned and
  assigned to workers
   – default: hash-partitioning
   – custom partitioning possible



• master assigns and coordinates,
  while workers execute vertices               Master
  and communicate with each
  other

                                    Worker 1   Worker 2   Worker 3
PageRank in Pregel
class PageRankVertex {
 void compute(Iterator messages) {
   if (getSuperstep() > 0) {
     // recompute own PageRank from the neighbors messages
     pageRank = sum(messages);
                                                                                            pj
                                                                            
     setVertexValue(pageRank);
   }
                                                                  pi 
                                                                         j  ( j , i )    dj
     if (getSuperstep() < k) {
        // send updated PageRank to each neighbor
        sendMessageToAllNeighbors(pageRank / getNumOutEdges());
     } else {
       voteToHalt(); // terminate
     }
}}
PageRank toy example
      .17         .33
.33         .33         .33   Superstep 0
      .17         .17
            .17
                                                Input graph
      .25         .34
.17         .50         .34   Superstep 1   A       B         C
      .09         .25
            .09


      .22         .34
.25         .43         .34   Superstep 2
      .13         .22
            .13
Cool, where can I download it?
• Pregel is proprietary, but:
  – Apache Giraph is an open source
    implementation of Pregel
  – runs on standard Hadoop infrastructure
  – computation is executed in memory
  – can be a job in a pipeline (MapReduce, Hive)
  – uses Apache ZooKeeper for synchronization
Giraph‘s Hadoop usage

   TaskTracker        TaskTracker          TaskTracker

worker    worker   worker      worker   worker    worker




                                           TaskTracker

  ZooKeeper                             master    worker
                       JobTracker
                       NameNode
Anatomy of an execution
Setup                               Teardown
• load the graph from disk          • write back result
• assign vertices to workers        • write back aggregators
• validate workers health




Compute                        Synchronize
• assign messages to workers   • send messages to workers
• iterate on active vertices   • compute aggregators
• call vertices compute()      • checkpoint
Who is doing what?
• ZooKeeper: responsible for computation state
    – partition/worker mapping
    – global state: #superstep
    – checkpoint paths, aggregator values, statistics

• Master: responsible for coordination
    –   assigns partitions to workers
    –   coordinates synchronization
    –   requests checkpoints
    –   aggregates aggregator values
    –   collects health statuses

• Worker: responsible for vertices
    – invokes active vertices compute() function
    – sends, receives and assigns messages
    – computes local aggregation values
What do you have to implement?
• your algorithm as a Vertex
  – Subclass one of the many existing implementations:
    BasicVertex, MutableVertex, EdgeListVertex,
    HashMapVertex, LongDoubleFloatDoubleVertex,...
• a VertexInputFormat to read your graph
  – e.g. from a text file with adjacency lists like
    <vertex> <neighbor1> <neighbor2> ...
• a VertexOutputFormat to write back the result
  – e.g. <vertex> <pageRank>
Starting a Giraph job
• no difference to starting a Hadoop job:

  $ hadoop jar giraph-0.1-jar-with-dependencies.jar
  o.a.g.GiraphRunner o.a.g.examples.ConnectedComponentsVertex
  --inputFormat o.a.g.examples.IntIntNullIntTextInputFormat
  --inputPath hdfs:///wikipedia/pagelinks.txt
  --outputFormat o.a.g.examples.ComponentOutputFormat
  --outputPath hdfs:///wikipedia/results/
  --workers 89
  --combiner o.a.g.examples.MinimumIntCombiner
What‘s to come?
• Current and future work in Giraph
  – graduation from the incubator
  – out-of-core messaging
  – algorithms library

• 2-day workshop after Berlin Buzzwords
  – topic: ‚Parallel Processing beyond MapReduce‘
  – meet the developers of Giraph and Stratosphere
  http://berlinbuzzwords.de/content/workshops-berlin-buzzwords
Everything is a network!
Further resources
• Apache Giraph homepage
  http://incubator.apache.org/giraph


• Claudio Martella: “Apache Giraph: Distributed
  Graph Processing in the Cloud”
  http://prezi.com/9ake_klzwrga/apache-giraph-distributed-graph-
  processing-in-the-cloud/

• Malewicz et al.: „Pregel – a system for large scale
  graph processing“, PODC 09
  http://dl.acm.org/citation.cfm?id=1582723
Thank you.
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Page rank algortihm
Page rank algortihmPage rank algortihm
Page rank algortihm
Siddharth Kar
 
Processing edges on apache giraph
Processing edges on apache giraphProcessing edges on apache giraph
Processing edges on apache giraph
DataWorks Summit
 
Test suite minimization
Test suite minimizationTest suite minimization
Test suite minimization
Gaurav Saxena
 

Was ist angesagt? (20)

Building zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaBuilding zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafka
 
Google PageRank
Google PageRankGoogle PageRank
Google PageRank
 
Pregel
PregelPregel
Pregel
 
How Apache Drives Music Recommendations At Spotify
How Apache Drives Music Recommendations At SpotifyHow Apache Drives Music Recommendations At Spotify
How Apache Drives Music Recommendations At Spotify
 
Seo and page rank algorithm
Seo and page rank algorithmSeo and page rank algorithm
Seo and page rank algorithm
 
Spark Compute as a Service at Paypal with Prabhu Kasinathan
Spark Compute as a Service at Paypal with Prabhu KasinathanSpark Compute as a Service at Paypal with Prabhu Kasinathan
Spark Compute as a Service at Paypal with Prabhu Kasinathan
 
Google's Dremel
Google's DremelGoogle's Dremel
Google's Dremel
 
Page rank algortihm
Page rank algortihmPage rank algortihm
Page rank algortihm
 
Chapter 4 pc
Chapter 4 pcChapter 4 pc
Chapter 4 pc
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarAnatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur Datar
 
Link analysis : Comparative study of HITS and Page Rank Algorithm
Link analysis : Comparative study of HITS and Page Rank AlgorithmLink analysis : Comparative study of HITS and Page Rank Algorithm
Link analysis : Comparative study of HITS and Page Rank Algorithm
 
State of the Trino Project
State of the Trino ProjectState of the Trino Project
State of the Trino Project
 
Processing edges on apache giraph
Processing edges on apache giraphProcessing edges on apache giraph
Processing edges on apache giraph
 
Page rank
Page rankPage rank
Page rank
 
PageRank
PageRankPageRank
PageRank
 
Actor critic algorithm
Actor critic algorithmActor critic algorithm
Actor critic algorithm
 
Page rank algorithm
Page rank algorithmPage rank algorithm
Page rank algorithm
 
Cost-based query optimization in Apache Hive
Cost-based query optimization in Apache HiveCost-based query optimization in Apache Hive
Cost-based query optimization in Apache Hive
 
Amdahl`s law -Processor performance
Amdahl`s law -Processor performanceAmdahl`s law -Processor performance
Amdahl`s law -Processor performance
 
Test suite minimization
Test suite minimizationTest suite minimization
Test suite minimization
 

Andere mochten auch

Scaling Up Machine Learning: How to Benchmark GraphLab Create on Huge Datasets
Scaling Up Machine Learning: How to Benchmark GraphLab Create on Huge DatasetsScaling Up Machine Learning: How to Benchmark GraphLab Create on Huge Datasets
Scaling Up Machine Learning: How to Benchmark GraphLab Create on Huge Datasets
Turi, Inc.
 
Introduction into scalable graph analysis with Apache Giraph and Spark GraphX
Introduction into scalable graph analysis with Apache Giraph and Spark GraphXIntroduction into scalable graph analysis with Apache Giraph and Spark GraphX
Introduction into scalable graph analysis with Apache Giraph and Spark GraphX
rhatr
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0
Cloudera, Inc.
 

Andere mochten auch (14)

Using Kafka and Kudu for fast, low-latency SQL analytics on streaming data
Using Kafka and Kudu for fast, low-latency SQL analytics on streaming dataUsing Kafka and Kudu for fast, low-latency SQL analytics on streaming data
Using Kafka and Kudu for fast, low-latency SQL analytics on streaming data
 
Kudu - Fast Analytics on Fast Data
Kudu - Fast Analytics on Fast DataKudu - Fast Analytics on Fast Data
Kudu - Fast Analytics on Fast Data
 
Scaling Up Machine Learning: How to Benchmark GraphLab Create on Huge Datasets
Scaling Up Machine Learning: How to Benchmark GraphLab Create on Huge DatasetsScaling Up Machine Learning: How to Benchmark GraphLab Create on Huge Datasets
Scaling Up Machine Learning: How to Benchmark GraphLab Create on Huge Datasets
 
Introduction to Apache Kudu
Introduction to Apache KuduIntroduction to Apache Kudu
Introduction to Apache Kudu
 
Time Series Analysis with Spark
Time Series Analysis with SparkTime Series Analysis with Spark
Time Series Analysis with Spark
 
Machine Learning with GraphLab Create
Machine Learning with GraphLab CreateMachine Learning with GraphLab Create
Machine Learning with GraphLab Create
 
Apache kudu
Apache kuduApache kudu
Apache kudu
 
Introduction into scalable graph analysis with Apache Giraph and Spark GraphX
Introduction into scalable graph analysis with Apache Giraph and Spark GraphXIntroduction into scalable graph analysis with Apache Giraph and Spark GraphX
Introduction into scalable graph analysis with Apache Giraph and Spark GraphX
 
Hadoop Graph Processing with Apache Giraph
Hadoop Graph Processing with Apache GiraphHadoop Graph Processing with Apache Giraph
Hadoop Graph Processing with Apache Giraph
 
Apache Arrow (Strata-Hadoop World San Jose 2016)
Apache Arrow (Strata-Hadoop World San Jose 2016)Apache Arrow (Strata-Hadoop World San Jose 2016)
Apache Arrow (Strata-Hadoop World San Jose 2016)
 
HPE Keynote Hadoop Summit San Jose 2016
HPE Keynote Hadoop Summit San Jose 2016HPE Keynote Hadoop Summit San Jose 2016
HPE Keynote Hadoop Summit San Jose 2016
 
The Columnar Era: Leveraging Parquet, Arrow and Kudu for High-Performance Ana...
The Columnar Era: Leveraging Parquet, Arrow and Kudu for High-Performance Ana...The Columnar Era: Leveraging Parquet, Arrow and Kudu for High-Performance Ana...
The Columnar Era: Leveraging Parquet, Arrow and Kudu for High-Performance Ana...
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0
 
Next-generation Python Big Data Tools, powered by Apache Arrow
Next-generation Python Big Data Tools, powered by Apache ArrowNext-generation Python Big Data Tools, powered by Apache Arrow
Next-generation Python Big Data Tools, powered by Apache Arrow
 

Ähnlich wie Introducing Apache Giraph for Large Scale Graph Processing

Large Scale Graph Processing with Apache Giraph
Large Scale Graph Processing with Apache GiraphLarge Scale Graph Processing with Apache Giraph
Large Scale Graph Processing with Apache Giraph
sscdotopen
 
Hadoop fault tolerance
Hadoop  fault toleranceHadoop  fault tolerance
Hadoop fault tolerance
Pallav Jha
 

Ähnlich wie Introducing Apache Giraph for Large Scale Graph Processing (20)

Large Scale Graph Processing with Apache Giraph
Large Scale Graph Processing with Apache GiraphLarge Scale Graph Processing with Apache Giraph
Large Scale Graph Processing with Apache Giraph
 
Random Walks on Large Scale Graphs with Apache Spark with Min Shen
Random Walks on Large Scale Graphs with Apache Spark with Min ShenRandom Walks on Large Scale Graphs with Apache Spark with Min Shen
Random Walks on Large Scale Graphs with Apache Spark with Min Shen
 
Giraph+Gora in ApacheCon14
Giraph+Gora in ApacheCon14Giraph+Gora in ApacheCon14
Giraph+Gora in ApacheCon14
 
Hadoop classes in mumbai
Hadoop classes in mumbaiHadoop classes in mumbai
Hadoop classes in mumbai
 
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
 
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
 
Hive Anatomy
Hive AnatomyHive Anatomy
Hive Anatomy
 
Apache HAMA: An Introduction toBulk Synchronization Parallel on Hadoop
Apache HAMA: An Introduction toBulk Synchronization Parallel on HadoopApache HAMA: An Introduction toBulk Synchronization Parallel on Hadoop
Apache HAMA: An Introduction toBulk Synchronization Parallel on Hadoop
 
Apache HAMA: An Introduction toBulk Synchronization Parallel on Hadoop
Apache HAMA: An Introduction toBulk Synchronization Parallel on HadoopApache HAMA: An Introduction toBulk Synchronization Parallel on Hadoop
Apache HAMA: An Introduction toBulk Synchronization Parallel on Hadoop
 
MapReduce basics
MapReduce basicsMapReduce basics
MapReduce basics
 
Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a cluster
 
Hadoop fault tolerance
Hadoop  fault toleranceHadoop  fault tolerance
Hadoop fault tolerance
 
Giraph
GiraphGiraph
Giraph
 
hadoop
hadoophadoop
hadoop
 
Apache Spark Overview part1 (20161107)
Apache Spark Overview part1 (20161107)Apache Spark Overview part1 (20161107)
Apache Spark Overview part1 (20161107)
 
Apache Flink & Graph Processing
Apache Flink & Graph ProcessingApache Flink & Graph Processing
Apache Flink & Graph Processing
 
Hadoop Architecture
Hadoop ArchitectureHadoop Architecture
Hadoop Architecture
 
Ling liu part 02:big graph processing
Ling liu part 02:big graph processingLing liu part 02:big graph processing
Ling liu part 02:big graph processing
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2
 
Big data shim
Big data shimBig data shim
Big data shim
 

Mehr von sscdotopen

Co-occurrence Based Recommendations with Mahout, Scala and Spark
Co-occurrence Based Recommendations with Mahout, Scala and SparkCo-occurrence Based Recommendations with Mahout, Scala and Spark
Co-occurrence Based Recommendations with Mahout, Scala and Spark
sscdotopen
 
Bringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to MahoutBringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to Mahout
sscdotopen
 
New Directions in Mahout's Recommenders
New Directions in Mahout's RecommendersNew Directions in Mahout's Recommenders
New Directions in Mahout's Recommenders
sscdotopen
 
Introduction to Collaborative Filtering with Apache Mahout
Introduction to Collaborative Filtering with Apache MahoutIntroduction to Collaborative Filtering with Apache Mahout
Introduction to Collaborative Filtering with Apache Mahout
sscdotopen
 
Scalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduceScalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduce
sscdotopen
 
Latent factor models for Collaborative Filtering
Latent factor models for Collaborative FilteringLatent factor models for Collaborative Filtering
Latent factor models for Collaborative Filtering
sscdotopen
 

Mehr von sscdotopen (8)

Co-occurrence Based Recommendations with Mahout, Scala and Spark
Co-occurrence Based Recommendations with Mahout, Scala and SparkCo-occurrence Based Recommendations with Mahout, Scala and Spark
Co-occurrence Based Recommendations with Mahout, Scala and Spark
 
Bringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to MahoutBringing Algebraic Semantics to Mahout
Bringing Algebraic Semantics to Mahout
 
Next directions in Mahout's recommenders
Next directions in Mahout's recommendersNext directions in Mahout's recommenders
Next directions in Mahout's recommenders
 
New Directions in Mahout's Recommenders
New Directions in Mahout's RecommendersNew Directions in Mahout's Recommenders
New Directions in Mahout's Recommenders
 
Introduction to Collaborative Filtering with Apache Mahout
Introduction to Collaborative Filtering with Apache MahoutIntroduction to Collaborative Filtering with Apache Mahout
Introduction to Collaborative Filtering with Apache Mahout
 
Scalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduceScalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduce
 
Latent factor models for Collaborative Filtering
Latent factor models for Collaborative FilteringLatent factor models for Collaborative Filtering
Latent factor models for Collaborative Filtering
 
mahout-cf
mahout-cfmahout-cf
mahout-cf
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Kürzlich hochgeladen (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 

Introducing Apache Giraph for Large Scale Graph Processing

  • 1. Introducing Apache Giraph for Large Scale Graph Processing Sebastian Schelter PhD student at the Database Systems and Information Management Group of TU Berlin Committer and PMC member at Apache Mahout and Apache Giraph mail ssc@apache.org blog http://ssc.io
  • 2. Graph recap graph: abstract representation of a set of objects (vertices), where some pairs of these objects are connected by links (edges), which can be directed or undirected Graphs can be used to model arbitrary things like road networks, social networks, flows of goods, etc. Majority of graph algorithms B are iterative and traverse the graph in some way A D C
  • 3. Real world graphs are really large! • the World Wide Web has several billion pages with several billion links • Facebook‘s social graph had more than 700 million users and more than 68 billion friendships in 2011 • twitter‘s social graph has billions of follower relationships
  • 4. Why not use MapReduce/Hadoop? • Example: PageRank, Google‘s famous algorithm for measuring the authority of a webpage based on the underlying network of hyperlinks • defined recursively: each vertex distributes its authority to its neighbors in equal proportions pj pi   dj j  ( j , i ) 
  • 5. Textbook approach to PageRank in MapReduce • PageRank p is the principal eigenvector of the Markov matrix M defined by the transition probabilities between web pages • it can be obtained by iteratively multiplying an initial PageRank vector by M (power iteration) p  M p0 k row 1 of M ∙ row 2 of M ∙ pi pi+1 row n of M ∙
  • 6. Drawbacks • Not intuitive: only crazy scientists think in matrices and eigenvectors • Unnecessarily slow: Each iteration is scheduled as separate MapReduce job with lots of overhead – the graph structure is read from disk – the map output is spilled to disk – the intermediary result is written to HDFS • Hard to implement: a join has to be implemented by hand, lots of work, best strategy is data dependent
  • 7. Google Pregel • distributed system especially developed for large scale graph processing • intuitive API that let‘s you ‚think like a vertex‘ • Bulk Synchronous Parallel (BSP) as execution model • fault tolerance by checkpointing
  • 8. Bulk Synchronous Parallel (BSP) processors local computation superstep communication barrier synchronization
  • 9. Vertex-centric BSP • each vertex has an id, a value, a list of its adjacent vertex ids and the corresponding edge values • each vertex is invoked in each superstep, can recompute its value and send messages to other vertices, which are delivered over superstep barriers • advanced features : termination votes, combiners, aggregators, topology mutations vertex1 vertex1 vertex1 vertex2 vertex2 vertex2 vertex3 vertex3 vertex3 superstep i superstep i + 1 superstep i + 2
  • 10. Master-slave architecture • vertices are partitioned and assigned to workers – default: hash-partitioning – custom partitioning possible • master assigns and coordinates, while workers execute vertices Master and communicate with each other Worker 1 Worker 2 Worker 3
  • 11. PageRank in Pregel class PageRankVertex { void compute(Iterator messages) { if (getSuperstep() > 0) { // recompute own PageRank from the neighbors messages pageRank = sum(messages); pj  setVertexValue(pageRank); } pi  j  ( j , i )  dj if (getSuperstep() < k) { // send updated PageRank to each neighbor sendMessageToAllNeighbors(pageRank / getNumOutEdges()); } else { voteToHalt(); // terminate } }}
  • 12. PageRank toy example .17 .33 .33 .33 .33 Superstep 0 .17 .17 .17 Input graph .25 .34 .17 .50 .34 Superstep 1 A B C .09 .25 .09 .22 .34 .25 .43 .34 Superstep 2 .13 .22 .13
  • 13. Cool, where can I download it? • Pregel is proprietary, but: – Apache Giraph is an open source implementation of Pregel – runs on standard Hadoop infrastructure – computation is executed in memory – can be a job in a pipeline (MapReduce, Hive) – uses Apache ZooKeeper for synchronization
  • 14. Giraph‘s Hadoop usage TaskTracker TaskTracker TaskTracker worker worker worker worker worker worker TaskTracker ZooKeeper master worker JobTracker NameNode
  • 15. Anatomy of an execution Setup Teardown • load the graph from disk • write back result • assign vertices to workers • write back aggregators • validate workers health Compute Synchronize • assign messages to workers • send messages to workers • iterate on active vertices • compute aggregators • call vertices compute() • checkpoint
  • 16. Who is doing what? • ZooKeeper: responsible for computation state – partition/worker mapping – global state: #superstep – checkpoint paths, aggregator values, statistics • Master: responsible for coordination – assigns partitions to workers – coordinates synchronization – requests checkpoints – aggregates aggregator values – collects health statuses • Worker: responsible for vertices – invokes active vertices compute() function – sends, receives and assigns messages – computes local aggregation values
  • 17. What do you have to implement? • your algorithm as a Vertex – Subclass one of the many existing implementations: BasicVertex, MutableVertex, EdgeListVertex, HashMapVertex, LongDoubleFloatDoubleVertex,... • a VertexInputFormat to read your graph – e.g. from a text file with adjacency lists like <vertex> <neighbor1> <neighbor2> ... • a VertexOutputFormat to write back the result – e.g. <vertex> <pageRank>
  • 18. Starting a Giraph job • no difference to starting a Hadoop job: $ hadoop jar giraph-0.1-jar-with-dependencies.jar o.a.g.GiraphRunner o.a.g.examples.ConnectedComponentsVertex --inputFormat o.a.g.examples.IntIntNullIntTextInputFormat --inputPath hdfs:///wikipedia/pagelinks.txt --outputFormat o.a.g.examples.ComponentOutputFormat --outputPath hdfs:///wikipedia/results/ --workers 89 --combiner o.a.g.examples.MinimumIntCombiner
  • 19.
  • 20. What‘s to come? • Current and future work in Giraph – graduation from the incubator – out-of-core messaging – algorithms library • 2-day workshop after Berlin Buzzwords – topic: ‚Parallel Processing beyond MapReduce‘ – meet the developers of Giraph and Stratosphere http://berlinbuzzwords.de/content/workshops-berlin-buzzwords
  • 21. Everything is a network!
  • 22. Further resources • Apache Giraph homepage http://incubator.apache.org/giraph • Claudio Martella: “Apache Giraph: Distributed Graph Processing in the Cloud” http://prezi.com/9ake_klzwrga/apache-giraph-distributed-graph- processing-in-the-cloud/ • Malewicz et al.: „Pregel – a system for large scale graph processing“, PODC 09 http://dl.acm.org/citation.cfm?id=1582723