Hey all --
I'm trying to determine if this flow-based programming paradigm is good for us. We're going to, soon, be inundated with multiple different "streams" of inbound data in multiple formats and there are further requirements for ex-filtrating data in multiple OTHER formats as well as the "native" formats (i.e., the same as they come in.)
Apache NiFi was suggested by another organization and I'd like to "code" something up in it just to see how it all works.
I've got a data format in mind; its a bugger to program to with simple programming (at least from my attempts to make a simple parser.) However, since the actual format is proprietary, I'll use a placeholder format that works similarly (but is considerably simpler than the actual format.)
Description:
I think that covers the big parts.
So, I've had success starting out without the header/footer, using a simple SplitContext processor, splitting on the SOR line identifier, yielding three flows out of that processor.
However, I'm kinda stuck on how to deal with the header/footer and the matching and the warning message (even if its simply to a log.) I have no real idea how to proceed (and I feel stupid because I can't see an obvious answer.)
Now, I don't want a full solution (yet), but I would like a nudge in the right direction.
Any ideas?
I'm trying to determine if this flow-based programming paradigm is good for us. We're going to, soon, be inundated with multiple different "streams" of inbound data in multiple formats and there are further requirements for ex-filtrating data in multiple OTHER formats as well as the "native" formats (i.e., the same as they come in.)
Apache NiFi was suggested by another organization and I'd like to "code" something up in it just to see how it all works.
I've got a data format in mind; its a bugger to program to with simple programming (at least from my attempts to make a simple parser.) However, since the actual format is proprietary, I'll use a placeholder format that works similarly (but is considerably simpler than the actual format.)
Code:
FILENAME|FILE-META-DATA
SOR|XXYYZZ12|20170420|120215|U|S|SOMETHING||
LOC|W020D05M15S|N65D15M05S||
INF|12|14|16|18|20||
AUX|13|15|17|19|21||
TXT|COMMENT TEXT||
SOR|XXYYZZ15|20170420|120217|U|B|SOMETHING ELSE||
LOC|W145D15M00S|N45D05M25S||
INF|22|24|26|28|30||
AUX|23|25|27|29|31|
33|35||
TXT|DIFFERENT COMMENT TEXT||
SOR|XXXXZZ16|20170420|120315|U|C|SOMETHING COMPLETELY DIFFERENT||
LOC|E105D15M00S|S08D23M25S||
ITM|1|12|40|55||
ADD|1|5500|90||
ITM|2|19|39|62||
ADD|2|5600|92||
TXT|EVEN MORE COMMENT TEXT||
FILENAME|FILE-META-DATA
Description:
- File begins and ends with a matching header/footer. They should match, but only need to worry about issuing a warning if they don't match.
- Records consist of multiple lines, with no "vertical whitespace" or any other inter-record markers between them.
- Each line begins with a line identifier.
- A line is separated by its field separator character (the pipe)
- A line is terminated by a double field separator and carriage return
- Unless otherwise specified, a line can only appear once
- Note that a line can be continued by not providing the termination string.
- Each record starts with a start-of-record line (SOR line-identifier)
- SOR fields are record-id, record-date, record-time, precedence (A-Z), record-type (S/C), short-description (free-text)
- LOC is required and represents latitude/longitude
- Each record requires a SOR and a LOC record
- If record-type is S (simple), an INF line is required and an AUX line is optional.
- If record-type is C (complex), one or more ITM lines are required and, optionally, an equal number of ADD lines.
- INF and AUX lines are simply lists of numbers.
- ITM and ADD lines are linked together by their first field
- ADD lines add amplifying data to the ITM data
- You can kind of consider the ITM/ADD data as a "Pivot" to the INF/AUX data but with more detailed data
- TXT lines are optional and can occur up to 50 times. It is free-text remarks, processed in-order of receipt and, essentially, a mechanism to pass around comments about the record.
I think that covers the big parts.
So, I've had success starting out without the header/footer, using a simple SplitContext processor, splitting on the SOR line identifier, yielding three flows out of that processor.
However, I'm kinda stuck on how to deal with the header/footer and the matching and the warning message (even if its simply to a log.) I have no real idea how to proceed (and I feel stupid because I can't see an obvious answer.)
Now, I don't want a full solution (yet), but I would like a nudge in the right direction.
Any ideas?