decision

Definition

decision ๋…ธ๋“œ์— ์ž…๋ ฅํ•˜๋Š” ์กฐ๊ฑด์— ๋”ฐ๋ผ N๊ฐœ์˜ Node๋กœ ์ž‘์—… flow๋ฅผ ๋ถ„๊ธฐ์‹œํ‚จ๋‹ค. ์„ ํ–‰ ๋…ธ๋“œ์˜ ๊ฒฐ๊ณผ์— ๋”ฐ๋ผ ์‹คํ–‰๋  ํ›„ํ–‰ ๋…ธ๋“œ๊ฐ€ ๋‹ค๋ฅผ ๊ฒฝ์šฐ ์„ ํƒํ•œ๋‹ค.
์ขŒ์ธก [Flow๊ตฌ์„ฑ]๋…ธ๋“œ ์ค‘ [decision]๋…ธ๋“œ๋ฅผ drag & drop ํ•œ ํ›„ Property ํ•ญ๋ชฉ์„ ์ž…๋ ฅํ•œ๋‹ค.

Set

[setting], [scheduler], [parameter] ์„ค์ •์€ [์›Œํฌํ”Œ๋กœ์šฐ ์ƒ์„ฑ] > [์„ค์ •]์„ ์ฐธ๊ณ ํ•œ๋‹ค.

property

[Node Description] ์ž‘์„ฑ ์ค‘์ธ ๋…ธ๋“œ๋ช… ์ž…๋ ฅ

  1. switch : ์กฐ๊ฑด๋ฌธ๊ณผ ์ด๋™ํ•  action์„ ์ž…๋ ฅํ•œ๋‹ค.
    • case : ์กฐ๊ฑด ์ž…๋ ฅ
    • to : ์กฐ๊ฑด์— ๋”ฐ๋ผ ์ˆ˜ํ–‰ํ•  ํ›„์† ๋…ธ๋“œ ์„ ํƒ(์ฝค๋ณด๋ฐ•์Šค)
  2. default : ๊ธฐ๋ณธ์œผ๋กœ ์ด๋™ํ•  action
    • to : ๋…ธ๋“œ ์„ ํƒ

Example

HDFS์— ํŠน์ • ํŒŒ์ผ ์ €์žฅ์—ฌ๋ถ€๋ฅผ ์ฒดํฌํ•˜์—ฌ ํŒŒ์ผ์ด ์žˆ์„ ๊ฒฝ์šฐ "fileexist_yes", ์—†์„ ๊ฒฝ์šฐ "no_files"๋ผ๋Š” 0byte ํŒŒ์ผ์„ ์ƒ์„ฑํ•œ๋‹ค. ETL ์ˆ˜ํ–‰๊ฒฐ๊ณผ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ƒ์„ฑ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๊ฒ€์ฆ๋กœ์ง ๋“ฑ์œผ๋กœ ์‘์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

flow060

  1. kbtest ํด๋Ÿฌ์Šคํ„ฐ์— ๊ฒ€์‚ฌ๋Œ€์ƒ ํŒŒ์ผ์„ ์ ์žฌํ•œ๋‹ค(/tmp/test-ods/AIR_HOUR_2019_2.csv).
  2. [decision] ๋ฐ [fs] ๋…ธ๋“œ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
  3. [decision] ๋…ธ๋“œ๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•œ๋‹ค.
  • ๊ฒฝ๋กœ์— ํŒŒ์ผ์ด ์žˆ์„ ๊ฒฝ์šฐ [fs_fileexist]๋กœ ์ด๋™
    • case : ${fs:exists(("/tmp/test-ods/AIR_HOUR_2019_2.csv")) == "true"}
    • to : fs_fileexist
  • ๊ฒฝ๋กœ์— ํŒŒ์ผ์ด ์—†์„ ๊ฒฝ์šฐ [fs_nofiles]๋กœ ์ด๋™
    • case : ${fs:exists(("/tmp/test-ods/AIR_HOUR_2019_2.csv")) == "false"}
    • to : fs_nofiles

flow061

[Note] : oozie el function
case ์ž…๋ ฅ ๊ตฌ๋ฌธ์€ oozie el function ์œผ๋กœ ์„ธ๋ถ€ ์‚ฌํ•ญ์€ ์•„๋ž˜๋ฅผ ์ฐธ๊ณ ํ•œ๋‹ค.
https://oozie.apache.org/docs/4.3.0/WorkflowFunctionalSpec.html#a4.2.2_Basic_EL_Functions

  1. [fs]๋…ธ๋“œ(fs_fileexist, fs_nofiles)๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•œ๋‹ค.
  • fs_fileexist : property "5.touchz" > HDFS File Browser์—์„œ "hdfs://kbtest-accu-hdfs-nn.suka:9000/tmp/test-ods"๊ฒฝ๋กœ ์„ค์ • ํ›„ "/fileexist.yes" ์ž…๋ ฅ
  • fs_nofiles : property "5.touchz" > HDFS File Browser์—์„œ "hdfs://kbtest-accu-hdfs-nn.suka:9000/tmp/test-ods"๊ฒฝ๋กœ ์„ค์ • ํ›„ "/no_files" ์ž…๋ ฅ
  1. ์‹คํ–‰๊ฒฐ๊ณผ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
  • ๋ฐ์ดํ„ฐ๊ฐ€ ์žˆ์„ ๊ฒฝ์šฐ ์ง€์ •ํ•œ ๊ฒฝ๋กœ์— fileexist.yes ์ƒ์„ฑ flow062

  • ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์„ ๊ฒฝ์šฐ ์ง€์ •ํ•œ ๊ฒฝ๋กœ์— no_files ์ƒ์„ฑ flow063