Nifi: how to avoid copying file that are partially written -
i trying use nifi file sftp server. potentially file can big , question how avoid getting file while being written. planning use listsftp+fetchsftp okay getsftp if can avoid copying partially written files.
thank you
in addition andy's solid answer can bit more flexible using listsftp/fetchsftp processor pair doing metadata based routing.
after listsftp each flowfile have attributes such 'file.lastmodifiedtime' , others. can read them here https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache.nifi.processors.standard.listsftp/index.html
you can put routeonattribute process in between list , fetch detect objects @ least based on reported last modified time 'too new'. route processor slow pass through intentionally wait bit. can run through first router until 'old enough'. now, admittedly power user approach give lot of flexibility , control. approach i'm mentioning here not fool proof source system may not report last mod time correctly, may not mean source file doing being written, etc.. gives additional options if cannot correct thing above andy talks about.
Comments
Post a Comment