CC 5212 1 PROCESAMIENTO MASIVO DE DATOS OTOO

  • Slides: 10
Download presentation
CC 5212 -1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2019 Lecture 1: Introduction (Lab) Aidan

CC 5212 -1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2019 Lecture 1: Introduction (Lab) Aidan Hogan aidhog@gmail. com

LAB

LAB

Why did it work in memory? We processed a lot of data. Why did

Why did it work in memory? We processed a lot of data. Why did it work in memory? • Not so many unique words … – but lots of new proper nouns – Heap’s law: – U(n) ≈ Knβ – English text • K ≈ 10 • β ≈ 0. 6

What if it doesn’t work in memory? How could we implement a wordcount (or

What if it doesn’t work in memory? How could we implement a wordcount (or a bi-gram count) using the hard disk for storage?

Most generic method: use sorting tengo que aprender más español tan pronto que puedo

Most generic method: use sorting tengo que aprender más español tan pronto que puedo y tengo que tomar cada oportunidad para practicar como ahora aprender cada como español más oportunidad para practicar pronto puedo que que tan tengo tomar y ahora 1 aprender cada 1 como 1 español 1 más 1 oportunidad para 1 practicar pronto 1 puedo 1 que 3 tan 1 tengo 2 tomar 1 y 1 1 que 3 tengo 2 ahora 1 aprender cada 1 como 1 español 1 más 1 oportunidad para 1 practicar pronto 1 puedo 1 tan 1 tomar 1 y 1 How can we use the disk to sort? 1 1 1

External Merge-Sort 1: Batch • Sort in batches Input on-disk (Input size: n) es

External Merge-Sort 1: Batch • Sort in batches Input on-disk (Input size: n) es que de la por qué de la ha sido no hay de la y de ha sido de la así es ha sido In-memory sort (Batch size b) así la de es ha la de sido es que no ha hay sido ypor ha desido qué Output batches on-disk (�n/b�batches) de la es que por qué de la ha sido no hay y de así es de la ha sido

External Merge-Sort 2: Merge Sorted output (Output size: n) así es de la es

External Merge-Sort 2: Merge Sorted output (Output size: n) así es de la es que ha sido no hay por qué y de In-memory sort asíque de es ha la sido es [1][3] [1] [2] no hay por qué [1] [2] dede es ha yno que la [2] sido hay [1][2] [1] [3] ypor dequé [2] [1] de que es ha por laqué[3] sido [2][1] [2] [3] Input batches on-disk (�n/b�batches) de la es que por qué [1] de la ha sido no hay y de [2] así es de la ha sido [3]

Counting bigrams is then easy? Could use merge-sort again to order by occurrence! así

Counting bigrams is then easy? Could use merge-sort again to order by occurrence! así es de la es que ha sido no hay por qué y de así es, 1 de la, 4 es que, 1 ha sido, 3 no hay, 1 por qué, 1 y de, 1

Does external merge-sorting scale? Any problem with external merge-sorting as we scale really high?

Does external merge-sorting scale? Any problem with external merge-sorting as we scale really high? • If you have too many batches to read simultaneously, disk will go crazy Any solution(s)? – Use lots of main-memory to reduce batch count – Only merge k at a time If we have n batches and merge them k at a time, how many passes will we need?

Does external merge-sorting scale? – Use multiple machines!

Does external merge-sorting scale? – Use multiple machines!