Spark Core
RDD, Lazy Execution, Distributed Data Processing, Transformation
Last updated
Was this helpful?
RDD, Lazy Execution, Distributed Data Processing, Transformation
Last updated
Was this helpful?
RDD λ λΆμ°νκ²½μμ μμ»€λ Έλμ νν°μ λμ΄ μλ λΆμ°κ°μ²΄μ΄λ€. λ³κ²½ λΆκ°λ₯νκ³ , μ°μ° μμλ₯Ό κΈ°μ΅νκ³ μμ΄μ νν°μ μ΄ κΉ¨μ§λ©΄ λ€μ 볡ꡬν μ μλ μ₯μ 볡ꡬ κΈ°λ₯μ κ°μ§κ³ μλ€.
RDD λ λ΄κ³ μ₯μ±(fault-tolerant) λ°μ΄ν°μ μΌλ‘ λ©λͺ¨λ¦¬μ μ€κ°μ°μΆλ¬Όμ μ μ₯ν μ μκ³ , RDD μμ μ 곡νλ API λ‘ λ°μ΄ν°λ₯Ό μ‘°μν μ μλ€. λ³΄ν΅ Low-level transformation API, Action API μ¬μ©ν΄μΌ νκ±°λ, λΉμ ν λ°μ΄ν°(unstructured data)λ₯Ό μ²λ¦¬ν λ RDDλ₯Ό μ¬μ©νλ€. μ ν λ°μ΄ν°(structured data)λ₯Ό μ²λ¦¬ν λλ Datasetμ μ¬μ©νλ€.
Lazy Executionμ RDD κ° μ΄λ»κ² λ§λ€μ΄μ§λμ§ Lineage μ 보λ₯Ό λ¨Όμ λ§λ€κ³ Job μ μ€ννκΈ° λλ¬Έμ μμμ κ³ λ €ν΄μ μ΅μ μ Jobμ μ€νν μ μλ€.
Driver μ½λλ₯Ό μμ±νκ³ Spark μ ν리μΌμ΄μ μ μ€ννλ©΄, Driver λ μ½λλ₯Ό λΆμνμ¬ Transformation μ½λλ‘ Job μ€νκ³ν(Execution Plan, Lineage μ 보)μ μΈμ΄ ν, Action μ½λλ₯Ό μννμ¬ Job μ μ€ννλ€.
Sparkμμ νμΌμμ€ν μΌλ‘ HDFSμ κ°μ λΆμ°νμΌμμ€ν μ μ¬μ©νλ©΄, λ°μ΄ν°κ° μ¬λ¬ νν°μ μΌλ‘ μͺΌκ°μ Έμ λΆμ°λμ΄ μ μ₯λκΈ° λλ¬Έμ νν°μ λ§λ€ Transformation μμ μ μνν μ μλ€. μμ μ Data Localityλ₯Ό κ³ λ €ν΄ νν°μ λ³λ‘ μνλλ©°, Shuffleμ΄ νμν κ²½μ°μ λ°μ΄ν°κ° λ€λ₯Έ λ¨Έμ μΌλ‘ μ μ‘λλ€.
RDD λ Transformation API(map, filter, join, etc)λ₯Ό μ¬μ©νμ¬ λΆμ°λμ΄ μλ λμ©λ λ°μ΄ν°λ₯Ό μ‘°μν μ μλ€.
Narrow transformation API λ μ νλ§νμ§ μκ³ μμ λ Έλμ μλ λ°μ΄ν°λ§ κ°μ§κ³ μμ νκΈ° λλ¬Έμ λΉ λ₯΄λ©°, νν°μ μ΄ κΉ¨μ Έλ μμ λ Έλμμ 볡μμ΄ κ°λ₯νλ€.
Wide transformation μ μ νλ§μ΄ νμνλ©°, λ°μ΄ν°κ° κΉ¨μ‘μ λ Network IO λΉμ©μ΄ λ°μνλ€. Wide transformation APIλ₯Ό μ¬μ©ν κ²½μ°, 체ν¬ν¬μΈνΈ ν΄μ£Όλ κ²μ΄ μ’μ μ μλ€.
μ±λ₯μ μ΅μ ννκΈ° μν΄μλ Wide transformation API λ μ£Όμ κΉκ² μ¬μ©ν΄μΌ νλ©° Narrow transformation APIλ₯Ό μ΅λν νμ©ν΄μΌ νλ€.
Narrow, Wide transformation κ³Ό action API(Operation)μ λν΄ μμ보μ.
http://blog.cloudera.com/blog/2015/03/how-to-tune-your-apache-spark-jobs-part-1/