topics in data science

Topics in Data Science Cheng Ren, Lixing Lian Outline - PowerPoint PPT Presentation

MapReduce Extension Topics in Data Science Cheng Ren, Lixing Lian Outline Scien7fic Workloads - Hadoops Adolescence: An Analysis of Hadoop Usage in


  1. MapReduce ¡Extension ¡ Topics ¡in ¡Data ¡Science Cheng ¡Ren, ¡Lixing ¡Lian ¡

  2. Outline • Scien7fic ¡Workloads ¡ ¡-­‑ ¡ Hadoop’s ¡Adolescence: ¡An ¡Analysis ¡of ¡Hadoop ¡Usage ¡in ¡Scien7fic ¡Workloads ¡ ¡ • Itera7ve ¡extension ¡ ¡-­‑ ¡ Haloop: ¡efficient ¡itera7ve ¡data ¡processing ¡on ¡large ¡clusters ¡ ¡ • Adap7ve ¡Indexes ¡ ¡-­‑ ¡ Only ¡Aggressive ¡Elephants ¡are ¡Fast ¡Elephants(HAIL)

  3. Hadoop's ¡adolescence ¡ ¡ ¡ ¡An ¡analysis ¡ of ¡Hadoop ¡usage ¡ ¡in ¡scien7fic ¡ workload ¡

  4. HaLoop: ¡Efficient ¡Itera7ve ¡Data ¡ Processing ¡On ¡Large ¡Clusters Yingyi ¡Bu, ¡Bill ¡Howe, ¡Magda ¡Balazinska, ¡Michael ¡D. ¡Ernst

  5. Outline • Mo7va7on ¡ • Examples ¡that ¡cannot ¡be ¡executed ¡perfectly ¡ • Architecture ¡ • Caching ¡ideas ¡ ¡

  6. Mo7va7on • MapReduce ¡can’t ¡express ¡recursion/itera7on ¡ • Lots ¡of ¡interes7ng ¡programs ¡need ¡loops ¡ ¡ -­‑ ¡graph ¡algorithms ¡ ¡ -­‑ ¡clustering ¡ ¡ -­‑ ¡machine ¡learning ¡ ¡ -­‑ ¡recursive ¡queries ¡(CTEs, ¡datalog, ¡WITH ¡clause) ¡ • Dominant ¡solu7on: ¡Use ¡a ¡driver ¡program ¡outside ¡of ¡ MapReduce ¡ • Hypothesis: ¡making ¡MapReduce ¡loop-­‑aware ¡affords ¡ op7miza7on ¡ -­‑ ¡lays ¡a ¡founda7on ¡for ¡scalable ¡implementa7ons ¡of ¡ recursive ¡languages

  7. Example ¡1: ¡PageRank

  8. PageRank ¡Implementa7on ¡on ¡MapReduce

  9. ¡ ¡ ¡ ¡What’s ¡the ¡problem? L ¡and ¡Count ¡are ¡loop ¡invariants, ¡but ¡ 1. ¡They ¡are ¡loaded ¡on ¡each ¡itera7on ¡ 2. ¡They ¡are ¡shuffled ¡on ¡each ¡itera7on ¡ 3. ¡Also, ¡fixpoint ¡evaluated ¡as ¡a ¡separate ¡MapReduce ¡job ¡per ¡itera7on

  10. ¡ ¡ ¡ ¡Example ¡2: ¡Transi7ve ¡Closure

  11. Transi7ve ¡Closure ¡on ¡MapReduce

  12. ¡ ¡ ¡ ¡What’s ¡the ¡problem? Friend ¡is ¡loop ¡invariant, ¡but ¡ 1. Friend ¡is ¡loaded ¡on ¡each ¡itera7on ¡ 2. Friend ¡is ¡shuffled ¡on ¡each ¡itera7on

  13. Push ¡loops ¡into ¡MapReduce! • Architecture ¡ • Cache ¡loop-­‑invariant ¡data ¡ ¡ • Programming ¡Model

  14. HaLoop ¡Architecture

  15. Inter-­‑itera7on ¡caching

  16. RI: ¡Reducer ¡Input ¡Cache • Provides: ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡Access ¡to ¡loop ¡invariant ¡data ¡without ¡map/shuffle ¡ • Data: ¡ ¡ -­‑ ¡Reducer ¡func7on ¡ • Assumes: ¡ ¡ 1. ¡Sta7c ¡par77oning ¡(implies: ¡no ¡new ¡nodes) ¡ ¡ 2. ¡Determinis7c ¡mapper ¡implementa7on ¡ ¡ • PageRank ¡ ¡ -­‑ ¡Avoid ¡loading ¡and ¡shuffling ¡the ¡web ¡graph ¡at ¡every ¡itera7on ¡ • Transi7ve ¡Closure ¡ ¡ -­‑ ¡Avoid ¡loading ¡and ¡shuffling ¡the ¡friends ¡graph ¡at ¡every ¡itera7on ¡

  17. RO: ¡Reducer ¡Output ¡Cache • Provides: ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡Distributed ¡access ¡to ¡output ¡of ¡previous ¡itera7ons ¡ • Used ¡by: ¡ ¡ -­‑ ¡Fixpoint ¡evalua7on ¡ • Assumes: ¡ ¡ 1. ¡Par77oning ¡constant ¡across ¡itera7ons ¡ ¡ 2. ¡Reducer ¡output ¡key ¡func7onally ¡determines ¡ ¡ ¡ Reducer ¡input ¡key ¡ ¡ • PageRank ¡ ¡ -­‑ ¡Allows ¡distributed ¡fixpoint ¡evalua7on ¡ ¡ -­‑ ¡Obviates ¡extra ¡MapReduce ¡job ¡ • Transi7ve ¡Closure ¡ ¡ -­‑ ¡No ¡help ¡

  18. MI: ¡Mapper ¡Input ¡Cache • Provides: ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡Access ¡to ¡non-­‑local ¡mapper ¡input ¡on ¡later ¡itera7ons ¡ • Data ¡for: ¡ ¡ ¡ ¡ -­‑ ¡Map ¡func7on ¡ • Assumes: ¡ ¡ Mapper ¡input ¡does ¡not ¡change ¡ ¡ -­‑ ¡Avoids ¡non-­‑local ¡data ¡reads ¡on ¡itera7ons ¡> ¡0

  19. Programming ¡Model • Mapper/reducer ¡stay ¡the ¡same! ¡ • Touch ¡points ¡ ¡ ¡ ¡– ¡Input/Output: ¡for ¡each ¡<itera7on, ¡step> ¡ ¡ ¡ ¡– ¡Cache ¡filter: ¡which ¡tuple ¡to ¡cache? ¡ ¡ ¡ ¡– ¡Distance ¡func7on: ¡op7onal ¡ • Nested ¡job ¡containing ¡child ¡jobs ¡as ¡loop ¡body ¡ • Minimize ¡extra ¡programming ¡efforts

  20. Conclusions Rela7vely ¡simple ¡changes ¡to ¡MapReduce/Hadoop ¡can ¡ • ¡-­‑ ¡support ¡itera7ve/recursive ¡programs ¡ ¡-­‑ ¡TaskTracker ¡(Cache ¡management) ¡ ¡-­‑ ¡Scheduler ¡(Cache ¡awareness) ¡ ¡-­‑ ¡Programming ¡model ¡(mul7-­‑step ¡loop ¡bodies, ¡cache ¡control) ¡ ¡ Op7miza7ons ¡ • ¡-­‑ ¡Caching ¡reducer ¡input ¡realizes ¡the ¡largest ¡gain ¡ ¡-­‑ ¡Good ¡to ¡eliminate ¡extra ¡MapReduce ¡step ¡for ¡termina7on ¡checks ¡ ¡-­‑ ¡Mapper ¡input ¡cache ¡benefit ¡inconclusive; ¡need ¡a ¡busier ¡cluster ¡

  21. Only ¡Aggressive ¡Elephants ¡ are ¡fast ¡Elephants Jens ¡Diirich, ¡Jorge-­‑Arnulfo ¡Quiané-­‑Ruiz, ¡Stefan ¡Richter, ¡ Stefan ¡Schuh, ¡Alekh ¡Jindal, ¡Jörg ¡Schad

  22. Outline • Mo7va7on ¡ • Comparison ¡between ¡Hadoop ¡and ¡HAIL ¡ ¡ • Upload ¡pipeline ¡ • Query ¡pipeline ¡ ¡

  23. Bob • Analyze ¡a ¡large ¡web ¡log ¡by ¡filtering ¡condi7ons. ¡(source ¡ IP, ¡web ¡address) ¡ ¡ • He ¡uses ¡a ¡sequence ¡of ¡different ¡filter ¡condi7ons, ¡each ¡ one ¡triggering ¡a ¡new ¡MapReduce ¡job. ¡ ¡ • He ¡is ¡not ¡exactly ¡sure ¡what ¡he ¡is ¡looking ¡for. ¡ ¡ • “Let’s ¡see ¡what ¡I ¡am ¡going ¡to ¡encounter ¡on ¡the ¡way . ”

  24. Bob • This ¡kind ¡of ¡use-­‑case ¡illustrates ¡an ¡exploratory ¡usage ¡of ¡ Hadoop ¡MapReduce. ¡ ¡ • It ¡is ¡a ¡major ¡use-­‑case ¡of ¡Hadoop ¡MapReduce. ¡ ¡ -­‑ ¡One ¡major ¡problem: ¡slow ¡query ¡run7mes. ¡ ¡ -­‑ ¡Time ¡dominated ¡by ¡the ¡I/O ¡for ¡reading ¡all ¡input ¡data.

  25. H adoop ¡ A ggressive ¡ I ndexing ¡ L ibrary

  26. VS. HDFS ¡+ ¡ HAIL ¡+ ¡ MapReduce MapReduce

  27. HDFS ¡+ ¡MapReduce

  28. HDFS HDFS ¡blocks ¡ 64MB ¡(default) horizontal ¡par77ons Datanodes

  29. HDFS

  30. HDFS

  31. HDFS

  32. HDFS

  33. HDFS Allows ¡two ¡Failovers

  34. MapReduce map(row) ¡-­‑> ¡set ¡of ¡(ikey, ¡value)

  35. MapReduce map(row) ¡-­‑> ¡set ¡of ¡(ikey, ¡value)

  36. MapReduce map(row) ¡-­‑> ¡set ¡of ¡(ikey, ¡value)

  37. MapReduce map(docID, ¡document) ¡-­‑> ¡set ¡of ¡(term, ¡docID)

  38. HAIL ¡+ ¡MapReduce

  39. HAIL HDFS ¡blocks ¡ 64MB ¡(default) horizontal ¡par77ons

  40. HAIL

  41. HAIL

  42. HAIL

  43. HAIL

  44. HAIL 1. Convert ¡the ¡input ¡file ¡into ¡binary ¡PAX ¡ ¡ 2. Create ¡a ¡series ¡of ¡different ¡sort ¡orders ¡ ¡ 3. Create ¡mul7ple ¡clustered ¡indexes. -­‑ ¡If ¡indexes ¡cannot ¡help, ¡fall ¡back ¡to ¡standard ¡Hadoop ¡scanning.

  45. HAIL ¡changes ¡the ¡upload ¡pipeline ¡ of ¡HDFS ¡in ¡order ¡to ¡create ¡different ¡ clustered ¡indexes ¡on ¡each ¡data ¡ block ¡replica.

  46. HAIL ¡Upload ¡Pipeline

  47. HAIL ¡Upload ¡Pipeline Why ¡Clustered ¡Indexes? ¡ -­‑ Unclustered ¡indexes ¡are ¡only ¡compe77ve ¡for ¡very ¡selec7ve ¡ queries ¡as ¡they ¡may ¡trigger ¡considerable ¡random ¡I/O ¡for ¡ non-­‑selec7ve ¡index ¡traversals. ¡ ¡ -­‑ Clustered ¡index ¡do ¡not ¡have ¡that ¡problem. ¡Whatever ¡the ¡ selec7vity, ¡we ¡will ¡read ¡the ¡clustered ¡index ¡and ¡scan ¡the ¡ qualifying ¡blocks.

Recommend


More recommend