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

topics in data science
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

MapReduce ¡Extension ¡

Topics ¡in ¡Data ¡Science

Cheng ¡Ren, ¡Lixing ¡Lian ¡

slide-2
SLIDE 2
  • 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)

Outline

slide-3
SLIDE 3

Hadoop's ¡adolescence ¡ ¡ ¡ ¡An ¡analysis ¡

  • f ¡Hadoop ¡usage ¡ ¡in ¡scien7fic ¡

workload ¡

slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22

HaLoop: ¡Efficient ¡Itera7ve ¡Data ¡ Processing ¡On ¡Large ¡Clusters

Yingyi ¡Bu, ¡Bill ¡Howe, ¡Magda ¡Balazinska, ¡Michael ¡D. ¡Ernst

slide-23
SLIDE 23
  • Mo7va7on ¡
  • Examples ¡that ¡cannot ¡be ¡executed ¡perfectly ¡
  • Architecture ¡
  • Caching ¡ideas ¡

¡

Outline

slide-24
SLIDE 24
  • 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 ¡
  • p7miza7on ¡

Mo7va7on

  • ­‑ ¡lays ¡a ¡founda7on ¡for ¡scalable ¡implementa7ons ¡of ¡

recursive ¡languages

slide-25
SLIDE 25

Example ¡1: ¡PageRank

slide-26
SLIDE 26

PageRank ¡Implementa7on ¡on ¡MapReduce

slide-27
SLIDE 27

¡ ¡ ¡ ¡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
slide-28
SLIDE 28

¡ ¡ ¡ ¡Example ¡2: ¡Transi7ve ¡Closure

slide-29
SLIDE 29

Transi7ve ¡Closure ¡on ¡MapReduce

slide-30
SLIDE 30

¡ ¡ ¡ ¡What’s ¡the ¡problem?

Friend ¡is ¡loop ¡invariant, ¡but ¡

  • 1. Friend ¡is ¡loaded ¡on ¡each ¡itera7on ¡
  • 2. Friend ¡is ¡shuffled ¡on ¡each ¡itera7on
slide-31
SLIDE 31
  • Architecture ¡
  • Cache ¡loop-­‑invariant ¡data ¡

¡

  • Programming ¡Model

Push ¡loops ¡into ¡MapReduce!

slide-32
SLIDE 32

HaLoop ¡Architecture

slide-33
SLIDE 33

Inter-­‑itera7on ¡caching

slide-34
SLIDE 34

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 ¡

slide-35
SLIDE 35

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 ¡

slide-36
SLIDE 36

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
slide-37
SLIDE 37
  • 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

Programming ¡Model

slide-38
SLIDE 38
  • 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 ¡

Conclusions

slide-39
SLIDE 39

Only ¡Aggressive ¡Elephants ¡ are ¡fast ¡Elephants

Jens ¡Diirich, ¡Jorge-­‑Arnulfo ¡Quiané-­‑Ruiz, ¡Stefan ¡Richter, ¡ Stefan ¡Schuh, ¡Alekh ¡Jindal, ¡Jörg ¡Schad

slide-40
SLIDE 40
  • Mo7va7on ¡
  • Comparison ¡between ¡Hadoop ¡and ¡HAIL ¡

¡

  • Upload ¡pipeline ¡
  • Query ¡pipeline ¡

¡

Outline

slide-41
SLIDE 41
  • Analyze ¡a ¡large ¡web ¡log ¡by ¡filtering ¡condi7ons. ¡(source ¡

IP, ¡web ¡address) ¡ ¡

  • He ¡uses ¡a ¡sequence ¡of ¡different ¡filter ¡condi7ons, ¡each ¡
  • ne ¡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.”

Bob

slide-42
SLIDE 42
  • 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.

Bob

slide-43
SLIDE 43

Hadoop ¡Aggressive ¡Indexing ¡Library

slide-44
SLIDE 44

VS.

HAIL ¡+ ¡ MapReduce HDFS ¡+ ¡ MapReduce

slide-45
SLIDE 45

HDFS ¡+ ¡MapReduce

slide-46
SLIDE 46

HDFS

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

slide-47
SLIDE 47

HDFS

slide-48
SLIDE 48

HDFS

slide-49
SLIDE 49

HDFS

slide-50
SLIDE 50

HDFS

slide-51
SLIDE 51

HDFS

Allows ¡two ¡Failovers

slide-52
SLIDE 52

MapReduce

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

slide-53
SLIDE 53

MapReduce

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

slide-54
SLIDE 54

MapReduce

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

slide-55
SLIDE 55

MapReduce

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

slide-56
SLIDE 56

HAIL ¡+ ¡MapReduce

slide-57
SLIDE 57

HAIL

horizontal ¡par77ons HDFS ¡blocks ¡ 64MB ¡(default)

slide-58
SLIDE 58

HAIL

slide-59
SLIDE 59

HAIL

slide-60
SLIDE 60

HAIL

slide-61
SLIDE 61

HAIL

slide-62
SLIDE 62

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.
slide-63
SLIDE 63

HAIL ¡changes ¡the ¡upload ¡pipeline ¡

  • f ¡HDFS ¡in ¡order ¡to ¡create ¡different ¡

clustered ¡indexes ¡on ¡each ¡data ¡ block ¡replica.

slide-64
SLIDE 64

HAIL ¡Upload ¡Pipeline

slide-65
SLIDE 65

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.

HAIL ¡Upload ¡Pipeline

slide-66
SLIDE 66

Seman7cs ¡of ¡an ¡ACK ¡for ¡a ¡packet ¡of ¡a ¡block ¡are ¡changed ¡ ¡ ¡From ¡“packet ¡received, ¡validated, ¡and ¡flushed” ¡ ¡ ¡ To ¡“packet ¡received ¡and ¡validated”.

HAIL ¡Upload ¡Pipeline

In ¡parallel ¡to ¡forwarding ¡and ¡reassembling ¡packets, ¡each ¡ datanode ¡sorts ¡the ¡data, ¡creates ¡indexes,and ¡forms ¡a ¡HAIL ¡

  • block. ¡
slide-67
SLIDE 67

HAIL ¡Upload ¡Pipeline

Enrich ¡the ¡HDFS ¡namenode ¡to ¡schedule ¡map ¡tasks ¡close ¡to ¡replicas ¡ having ¡a ¡suitable ¡index ¡

  • Dir_rep ¡mapping ¡(blockID, ¡datanode) ¡à ¡HAILBlockReplicaInfo ¡
  • HAILBlockReplicaInfo ¡contains ¡detailed ¡informa7on ¡about ¡the ¡

types ¡of ¡available ¡indexes

slide-68
SLIDE 68

HAIL ¡Query ¡Pipeline

slide-69
SLIDE 69

Upload ¡Time

slide-70
SLIDE 70

Query ¡Times

Individual ¡Jobs: ¡Weblog

slide-71
SLIDE 71

Fast ¡Indexing ¡and ¡Fast ¡Querying

slide-72
SLIDE 72

Ques7ons? ¡Ask ¡Bob. ¡