Skip to main content
Deenag
Gold ⭐️
Oct 16, 2019 4:22 PM UTC
Solved

Nifi Moving files on HDFS path for the previous day merged json file

I have a requirement to move the previous day processed and merged json files into new hdfs path. The requirement is to recursively search unprocessed files and move the pending unprocessed files.

Path 1 → /data/nifi/working/2019/10/source_2019_10_15.json — Daily processed files are merged under this path and gets added on daily basis.

Path 2 → /data/nifi/incoming/ — The code should search if folders doesn't exist then create and move the files are just move the files if the folders are already present.

 

Currently, I am using nifi flow -- ListHDFS→ MoveHDFS but unable to achieve it.

 

Need help how this can be achieved.

 

Thank you for the help.

 

 

Deenag
DeenagAnswer
Gold ⭐️
Oct 24, 2019 6:17 PM UTC

The current flow worked fine.

 listhdfs->fethchdfs->updateattribute->puthdfs->deletehdfs

 

In the list hdfs set the Minimum File Age wait time before consuming. This will allow the process to search files recursively.

 

I have completed all the activates except generating sequence number for each received flow file for the same date. Could you please check and help.

2 replies

Deenag
DeenagAuthor
Gold ⭐️
Oct 16, 2019 8:58 PM UTC

ListHDFS->RouteonAttribute->MoveHDFS

Can the above process flow be worked by utilizing RouteonAttribute to split and process previous day pending file to HDFS path?

Daily created Fileformat

stream_es_2019_10_14.json1
stream_es_2019_10_15.json1
stream_es_2019_10_16.json1

  1. If the filename is equal to today's date ignore to pick and process
  2. If the filename is lesser than today's date pick and move the file to defined folder path.

Please help if this can be achieved. 

 

 

Translate
Deenag
DeenagAuthorAnswer
Gold ⭐️
Oct 24, 2019 6:17 PM UTC

The current flow worked fine.

 listhdfs->fethchdfs->updateattribute->puthdfs->deletehdfs

 

In the list hdfs set the Minimum File Age wait time before consuming. This will allow the process to search files recursively.

 

I have completed all the activates except generating sequence number for each received flow file for the same date. Could you please check and help.

Translate